Postado Abril 13, 2013 12 anos Olá a todos, Esta função serve para que você possa verificar se o jogador (loga, por exemplo) pela primeira vez "por algum tempo". Então, aqui está o código: function checkFirstByTime(cid,storage,value,year,month,day,times) local funcDate = day.." "..month.." "..times.." "..year if getPlayerStorageValue(cid, storage) ~= value then if funcDate < os.date("%d %b %X %Y", os.time()) then setPlayerStorageValue(cid, storage, value) return true end end return false end E aqui está um exemplo:function onLogin(cid) if checkFirstByTime(cid,6546,1,2013,Apr,30,21:30:00) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Hello, you have login for the first time durning the event! You have recived an dildo and a bucket!") doPlayerAddItem(cid, dildo) doPlayerAddItem(cid, bucket) end return true end Créditos - Erexo ►[Mega Topic] Seu Primeiro Open Tibia Server◄ ►Lista Dos Meus Trabalhos◄
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.