ITEM.name = "Item name"
ITEM.desc = "Item desc"
ITEM.model = "ItemModel.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM:hook("drop", function(item)
local client = item.player
if client:getLocalVar("hasOverlay") and item:getData("equip") then
client:setLocalVar("hasOverlay", false)
item:setData("equip", false)
end
end)
ITEM.functions.Equip =
{
name = "Экипировать/Снять",
tip = "Экипировать/Снять",
icon = "icon16/feed.png",
onRun = function(item)
local client = item.player
item:setData("equip", !item:getData("equip", false))
client:setLocalVar("hasOverlay", !client:getLocalVar("hasOverlay", false))
return false
end,
onCanRun = function(item)
return (!IsValid(item.entity))
end
}
function ITEM:onLoadout()
local client = self.player
if !client:getLocalVar("hasOverlay") and self:getData("equip") then
client:setLocalVar("hasOverlay", true)
end
end