Função feita por min que kicka o player de acordo com os segundos :
function doRemoveCreatureInSeconds(cid, seconds) if type(seconds) ~= "number" then return print("[ERROR] Seconds is not a number.") end if seconds < 0 then seconds = 1 end if seconds == 1 then return doRemoveCreature(cid) else for i = 1, seconds do x = seconds - i if i == 1 and x ~= 0 then doPlayerSendTextMessage(cid, 27, "You will be kicked in ".. x .. " seconds.") elseif i <= seconds and i ~= 1 and x ~= 0 then addEvent(doPlayerSendTextMessage, i * 1000, cid, 27, "You will be kicked in ".. x .. " seconds.") end end addEvent(doRemoveCreature, 1000*seconds, cid) end return true end
Exemplo de uso :
function onSay(cid, words, param, channel) doRemoveCreatureInSeconds(cid, 10) return true end
Resultado :
22:16 You will be kicked in 9 seconds.
22:16 You will be kicked in 8 seconds.
22:16 You will be kicked in 7 seconds.
22:16 You will be kicked in 6 seconds.
22:16 You will be kicked in 5 seconds.
22:16 You will be kicked in 4 seconds.
22:16 You will be kicked in 3 seconds.
22:16 You will be kicked in 2 seconds.
22:16 You will be kicked in 1 seconds.
Para usar ao logar segue o tuto..