samuel157
/root
- Joined
- Mar 19, 2010
- Messages
- 447
- Solutions
- 3
- Reaction score
- 49
- Location
- São Paulo, Brazil
- GitHub
- Samuel10M
To charge my stamina you have to leave of game logout, how can I do this and it increases in the game without having to logou of game?
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local cfg = {}
cfg.refuel = 42 * 60 * 1000
if getPlayerStamina(cid) == 2346 then
doPlayerSendCancel(cid, "Your stamina is already full.")
elseif(not isPremium(cid)) then
doPlayerSendCancel(cid, "You must have a premium account.")
else
doPlayerSetStamina(cid, cfg.refuel)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your stamina has been refilled.")
doRemoveItem(item.uid)
end
return true
end