Boa noite!
Uso um sistema que a cada 1h online recebe 1 ponto, eu gostaria de adicionar na talkactions uma função que faz a contagem de tempo para recebe o proximo points.
Se alguem puder ajudar, obrigado!
8.60 / 0.4
points/talkactions
function onSay(cid, words, param, channel)
local getP = getPoints(cid)
doPlayerPopupFYI(cid, "Voce possui ".. getP .." p-points!")
return true
end
points/globalevents
--[[
P Points System by LsM.
###### © 2011
Version : v1.0
]]--
local config = {
p_time = 3600, -- Tempo em segundos para receber os pontos( 3600 = 1hora )
p_points = 1 -- Quantidade de pontos recebida a cada "p_time"
}
local function givePoints(cid, quant)
if os.time() - getCreatureStorage(cid, 1219) >= config.p_time then
doPlayerSendTextMessage(cid, 19, "Parabéns, você recebeu ".. config.p_points .." p-point. Agora você tem ".. config.p_points + getPoints(cid) .." p-points na sua conta. Seu tempo foi zerado, proximo p-points daqui 2 horas.")
doPlayerAddPoints(cid, quant)
doCreatureSetStorage(cid, 1219, 0)
doCreatureSetStorage(cid, 1219, os.time())
end
return true
end
function onThink(interval)
for i, v in pairs(getPlayersOnline()) do
givePoints(v, config.p_points)
end
return true
end