data/talkactions/lib/talkactions.lua
function checkExhausted(cid, storage, seconds)
local v = exhaustion.get(cid, storage)
if(not v) then
exhaustion.set(cid, storage, seconds)
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Please wait " .. v .. " seconds before trying this command again.")
return false
end
return true
end
data/lib/034-exhaustion.lua
get = function (cid, storage)
if(getPlayerFlagValue(cid, PLAYERFLAG_HASNOEXHAUSTION)) then
return false
end
local exhaust = getCreatureStorage(cid, storage)
if(exhaust > 0) then
local left = exhaust - os.time()
if(left >= 0) then
return left
end
end
return false
end,