Postado Novembro 25, 2015 9 anos BOM EU TO FAZENDO UM SCRIPT EM QUE QUANDO LOGA O CHAR PELA PRIMEIRA VEZ AKELE IP GNAHAR DIAS VIPS , ESTA QUASE PRONTO O SCRIPT SO QUE FALTA AJEITA ALGUMAS COISAS. PROBLEMAS: 1> TODAS VEZ Q LOGA O CHAR GANHA VIP E EU SO QUERIA Q GANHASE SO UMA VEZ NA VIDA COM AKELE IP 2> COLOKA O SISTEMA DE IP > TIPO : O CHAR QUE LOGAR PELA PRIMEIRA VEZ COM AKELE IP GNAHAR DIAS VIPS AKI O SCRIPT Q TA QUASE PRONTO ALGUEM AJUDA ? function onLogin(cid) local days = 2 -- dias que serão adicionados local daysvalue = days * 24 * 60 * 60 local storageplayer = getPlayerStorageValue(cid, 13500) local timenow = os.time() if getPlayerStorageValue(cid, 13500) - os.time() <= 0 then time = timenow + daysvalue else time = storageplayer + daysvalue end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.") setPlayerStorageValue(cid, 13500, time) local quantity = math.floor((getPlayerStorageValue(cid, 13500) - timenow)/(24 * 60 * 60)) doSendMagicEffect(getPlayerPosition(cid), math.random(28,30)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.") return TRUE end
Postado Novembro 26, 2015 9 anos Por IP daria vários problemas, você pode usar globalStorage para ganhar a VIP somente uma vez por conta. function onLogin(cid) local days = 2 -- dias que serão adicionados local daysvalue = days * 24 * 60 * 60 local storageplayer = getPlayerStorageValue(cid, 13500) local timenow = os.time() if getPlayerStorageValue(cid, 13500) - os.time() <= 0 then time = timenow + daysvalue else time = storageplayer + daysvalue end if getGlobalStorageValue(getPlayerAccountId(cid)) <= 0 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.") setPlayerStorageValue(cid, 13500, time) local quantity = math.floor((getPlayerStorageValue(cid, 13500) - timenow)/(24 * 60 * 60)) doSendMagicEffect(getPlayerPosition(cid), math.random(28,30)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.") setGlobalStorageValue(getPlayerAccountId(cid), 1) end return true end ➥ Regras | Seções OTServ | Seções BOT
Postado Novembro 26, 2015 9 anos Posta seu login.lua que resolvo sem precisar de storages nem ip nem nada! Pokémon Dust Evolution É aonde começa sua nova aventura!! Facebook Verifique Atualizações
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.