Ir para conteúdo

Featured Replies

Postado

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

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

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo