KylerXX
Active Member
- Joined
- Jun 24, 2010
- Messages
- 439
- Reaction score
- 30
Hello guys
I dont know if this script is already posted on this forum :S this is exhaustion script, this is functions:
add Function
addExhaust(cid, seconds, interval)
check Function
isExh(cid)
Here are the codes:
add Function
check Function
Example:
:thumbup:
I dont know if this script is already posted on this forum :S this is exhaustion script, this is functions:
add Function
addExhaust(cid, seconds, interval)
check Function
isExh(cid)
Here are the codes:
add Function
Lua:
function addExhaust(cid, seconds, interval)
local storage = 90099 -- storage using exhaustion, needs only 1
if getPlayerStorageValue(cid, storage) == -1 then
doPlayerSendCancel(cid, "You are exhausted.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
addEvent(setPlayerStorageValue, seconds, cid, storage, 2)
addEvent(setPlayerStorageValue, seconds+interval, cid, storage, -1)
end
end
check Function
Lua:
function isExh(cid)
local storage = 90099 -- storage using exhaustion, needs only 1
if getPlayerStorageValue(cid, storage) == -1 then
return true
end
end
Example:
Lua:
if isExh(cid) then
addExhaust(cid,5000, 1000)
else
-- execution
end
:thumbup: