function onLogin(cid)
local free_points = 130
local players = 500 -- how much players shall it gives
local players_value = players - 1 -- dont edit this line
local pos = getPlayerPosition(cid)
local effectPositions = { -- dont edit
{x = pos.x - 5, y = pos.y - 5, z = pos.z},
{x = pos.x + 5, y = pos.y - 5, z = pos.z},
{x = pos.x + 5, y = pos.y + 5, z = pos.z},
{x = pos.x - 5, y = pos.y + 5, z = pos.z},
{x = pos.x, y = pos.y - 4, z = pos.z},
{x = pos.x, y = pos.y + 4, z = pos.z},
{x = pos.x - 4, y = pos.y, z = pos.z},
{x = pos.x + 4, y = pos.y, z = pos.z},
{x = pos.x - 4, y = pos.y - 4, z = pos.z},
{x = pos.x + 4, y = pos.y - 4, z = pos.z},
{x = pos.x + 4, y = pos.y + 4, z = pos.z},
{x = pos.x - 4, y = pos.y + 4, z = pos.z}
}
local storage_1 = 15253 --put any empty storage for counting the ten times
local storage_2 = 15251 --empty storage for players
local function doPlayerAddPremiumPoints(cid, points)
return db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points`+"..points.." WHERE `id` = "..getPlayerAccountId(cid)..";")
end
if isPlayer(cid) then
if getGlobalStorageValue(storage_1) < players_value then
if getCreatureStorage(cid, storage_2) < 0 then
doPlayerAddPremiumPoints(cid, free_points)
doPlayerSendTextMessage(cid, 19, 'You have been rewarded with ' .. free_points .. ' premium points. Thanks for playing Hero Biba.')
for _, ePos in ipairs(effectPositions) do
doSendDistanceShoot(ePos, pos, 30)
doSendAnimatedText(pos, "+130 Premium Points", 180)
doSendDistanceShoot(ePos, pos, 30)
end
doCreatureSetStorage(cid, storage_2, 1)
setGlobalStorageValue((storage_1), getGlobalStorageValue(storage_1) +1)
end
end
end
return true
end