
raicont
Membro
-
Registro em
-
Última visita
Histórico de Curtidas
-
raicont recebeu reputação de Lurk em Chest daily (Vip)Thank you very much. It served me perfectly. Just tweak the messages a bit and i separated them. What do you think? ... 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 and getPlayerLevel(cid) >= 300 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 Chest.")
elseif getPlayerLevel(cid) < 300 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must be at least level 300.")
elseif getPlayerLevel(cid) < 300 or not isPremium(cid) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You need to have premium account to do this chest.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must wait 24 Hours to get your daily chest. Next avaiable will be at: " .. os.date("%H:%M:%S", getPlayerStorageValue(cid, 13540)) .. ".")
end
return true
end
-
raicont deu reputação a Lurk em Chest daily (Vip)@raicont use this script then
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 and getPlayerLevel(cid) >= 300 and isPremium(cid) 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.") elseif getPlayerLevel(cid) < 300 or not isPremium(cid) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must be at least level 300 AND have premium account to do this quest.") 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 -
raicont deu reputação a Lurk em Chest daily (Vip)@raicont do you use premium account on your server to make the players "vip"?
if not, you probably use an item that when they use they become vip, if you use an item, send me the script of that item
-
raicont deu reputação a Lurk em Chest daily (Vip)@raicont since I don't know the storage of your vip system I made it to 300+ only, if you want it vip only then tell me your vip storage
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 and getPlayerLevel(cid) >= 300 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.") elseif getPlayerLevel(cid) < 300 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You must be at least level 300 to do this quest.") 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 this solves your issue please don't forget to select best answer and upvote