Ir para conteúdo
  • 0

Chest daily (Premium)


raicont

Pergunta

Hello people! 
I need help with this script, I want to add that only vip players can take the content, or that it needs to be at least level 300+(Without removing the 24-hrs period to take the content again)...

Thank you!

 

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)
local daysvalue = 1 * 24 * 60 * 60
local daily = getPlayerStorageValue(cid, 13541)


local rewards = {
       { item = 12832, count = 1 },
    { item = 2160, count = 100 },
    { item = 12227, count = 1 },
    { item = 12331, count = 1 },
    { item = 12618, count = 5 },
    { item = 12242, count = 1 },
    { item = 2145, count = 1 }
}

if (daily == -1) then
daily = 0
end
if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then
local random = math.random(1, #rewards)
doPlayerAddItem(cid, rewards[random].item, rewards[random].count)
time = os.time() + daysvalue
setPlayerStorageValue(cid, 13540, time)
setPlayerStorageValue(cid, 13541, daily+1)
local daily = getPlayerStorageValue(cid, 13541)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You done your " .. daily .. " Daily Quest. You got 1 cc.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must wait 24 Hours to get your daily quest. Next avaiable will be at: " .. os.date("%H:%M:%S", getPlayerStorageValue(cid, 13540)) .. ".")
end
return true
end

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

  • 0
10 minutos atrás, raicont disse:

Hello people! 
I need help with this script, I want to add that only vip players can take the content, or that it needs to be at least level 300+(Without removing the 24-hrs period to take the content again)...


Thank you!

 

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)
local daysvalue = 1 * 24 * 60 * 60
local daily = getPlayerStorageValue(cid, 13541)


local rewards = {
       { item = 12832, count = 1 },
    { item = 2160, count = 100 },
    { item = 12227, count = 1 },
    { item = 12331, count = 1 },
    { item = 12618, count = 5 },
    { item = 12242, count = 1 },
    { item = 2145, count = 1 }
}

if (daily == -1) then
daily = 0
end
if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then
local random = math.random(1, #rewards)
doPlayerAddItem(cid, rewards[random].item, rewards[random].count)
time = os.time() + daysvalue
setPlayerStorageValue(cid, 13540, time)
setPlayerStorageValue(cid, 13541, daily+1)
local daily = getPlayerStorageValue(cid, 13541)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You done your " .. daily .. " Daily Quest. You got 1 cc.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must wait 24 Hours to get your daily quest. Next avaiable will be at: " .. os.date("%H:%M:%S", getPlayerStorageValue(cid, 13540)) .. ".")
end
return true
end

if player:getPremiumDays() < 1 then
    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Você não possui premium account.')
    else
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...