Hi to all, I've got a problem with a movement script.
It working fine, but when a player die, he get full stamina.... so, idk why it happen.
Thank you all guys
Lua:
STAMINA_MESSAGE = "You won 1 minute of stamina."
STAMINA_TIME = 180 * 1000
STAMINA_EFFECT = 12
STAMINA_ADD = 1
function event(cid)
if isPlayer(cid) then
doPlayerAddStamina(cid, STAMINA_ADD)
doPlayerSendTextMessage(cid, 27, STAMINA_MESSAGE)
eventCheck = addEvent(event, STAMINA_TIME, cid)
end
end
function onStepIn(cid, item, position, fromPosition, pos)
if isPlayer(cid) then
doPlayerSendTextMessage(cid, 27, "Every 3 minutes of training you gain 1 minute of stamina.")
eventCheck = addEvent(event, STAMINA_TIME, cid)
end
return true
end
function onStepOut(cid, item, position, fromPosition)
if isPlayer(cid) then
doPlayerSendTextMessage(cid, 27, "You left the training area.")
stopEvent(eventCheck)
end
return true
end
It working fine, but when a player die, he get full stamina.... so, idk why it happen.
Thank you all guys