local event = {}
local timeOnline = 60 * 60 * 1000
function addPremiumPoint(cid)
local player = Player(cid)
if player then
db.query("UPDATE `accounts` SET `premium_points` = premium_points + 1 WHERE `id`= " .. player:getGuid() .. " LIMIT 1');")
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "You have been online for an hour and have earned 1 premium point.")
event[cid] = addEvent(addPremiumPoint, timeOnline, cid)
return
end
event[cid] = nil
end
function onLogin(player)
local cid = player:getId()
if not event[cid] then
event[cid] = addEvent(addPremiumPoint, timeOnline, cid)
end
return true
end