events1,events2= {},{}
local config = {tempo = 180,storage = 20000 }
function onStepIn(cid, item, frompos, topos)
if isPlayer(cid) and getPlayerStorageValue(cid, config.storage) <= 0 then
doPlayerSendTextMessage(cid, 22, "Welcome to the train chamber. You will now start your 3 hours session.")
events1[getPlayerGUID(cid)] = addEvent(setPlayerStorageValue, config.tempo*60*1000-1000, cid, config.storage, -1)
events2[getPlayerGUID(cid)] = addEvent(doTeleportThing, config.tempo*60*1000-500, cid, getTownTemplePosition(getPlayerTown(cid)))
end
return true
end
function onStepOut(cid, item, frompos, topos)
if isPlayer(cid) and getPlayerStorageValue(cid, config.storage) >= 1 then
setPlayerStorageValue(cid, config.storage, -1)
doPlayerSendTextMessage(cid, 23, "System kick off!")
stopEvent(events1[getPlayerGUID(cid)])
stopEvent(events2[getPlayerGUID(cid)])
end
return true
end
No caso eu não quero que mande para o templo o player ... Se passar das 3 horas sem se mexer, que o player apenas deslogue, igual quando acontece quando da 15 Minutos e o IDLE desloga tendeu ??