local exhaustTime = 3 -- How many seconds of exhaust between equipping
function onEquip(cid, item, slot)
if item.uid ~= 0 then
if tonumber(getItemAttribute(item.uid, "equipped")) and tonumber(getItemAttribute(item.uid, "equipped")) == 1 then
return true
end
if getCreatureStorage(cid, "ssaexhaust") < os.time() then
callFunction(cid, item.uid, slot, false)
doCreatureSetStorage(cid, "ssaexhaust", os.time() + exhaustTime)
doItemSetAttribute(item.uid, "equipped", 1)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You may not equip an ssa for " .. getCreatureStorage(cid, "ssaexhaust") - os.time() .. " seconds.")
return false
end
end
return true
end
function onDeEquip(cid, item, slot)
callFunction(cid, item.uid, slot, false)
doItemSetAttribute(item.uid, "equipped", -1)
return true
end