• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

A script that automaticly gives 10 premium points for the first 10 logged in players

Lightonia

Lightonia.servegame.com
Joined
Jun 4, 2007
Messages
492
Reaction score
9
I request script that automaticly gives 10 premium points for the first 10 logged in players
 
I would also like it to ignore Admins (access 6) if its possible, thanks.
LUA:
local config = {
    useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
    
local text = "- Welcome to Lightonia, here's a list of commands:\n!aol               -> Buy an amulet of loss\n!bless             -> Get blessed by the Gods\n!exp             -> Experience for next level\n!spells            -> List of spells available\n!kills             -> See your current frags\n!explorer             -> Buy a bp with shovel, pick, rope for 500gps\nCtrl+R             -> Report bugs to staff\n- Visit our webpage for a complete list of commands.\n//Lightonia Staff"
local useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
local loss = getConfigValue('deathLostPercent')

    if(loss ~= nil) then
        doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
    end

    local lastLogin = getPlayerLastLoginSaved(cid)
    if(lastLogin > 0) then
        doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, text)
    else
        doPlayerSendOutfitWindow(cid)
    end
    
    if(not isPlayerGhost(cid)) then
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
    end

    registerCreatureEvent(cid, "Mail")
    registerCreatureEvent(cid, "Killb")
  registerCreatureEvent(cid, "GuildMotd")
    registerCreatureEvent(cid, "ReportBug")
    registerCreatureEvent(cid, "rtp")
    registerCreatureEvent(cid, "removetepe")
    registerCreatureEvent(cid, "AdvanceSave")
    registerCreatureEvent(cid, "Frag Reward")
    registerCreatureEvent(cid, "TempleTeleporter")
    registerCreatureEvent(cid, "one")
    registerCreatureEvent(cid, "ZombieAttack")    
    registerCreatureEvent(cid, "Idle")
    if(config.useFragHandler) then
        registerCreatureEvent(cid, "SkullCheck")
    end
    registerCreatureEvent(cid, "inquisitionPortals")
    registerCreatureEvent(cid, "ReportBug")
    registerCreatureEvent(cid, "AdvanceSave")
    registerCreatureEvent(cid, "ArenaKill")
    registerCreatureEvent(cid, "reward")
    registerCreatureEvent(cid, "PythiusTheRotten")
        registerCreatureEvent(cid, "Aol1")    
        registerCreatureEvent(cid, "pacmanhandle")
        registerCreatureEvent(cid, "levelUp")
    registerCreatureEvent(cid, "RemoveTP")     
    registerCreatureEvent(cid, "dungeon_deserter")
    registerCreatureEvent(cid, "forever amulet")
    registerCreatureEvent(cid, "charge amulet")
    registerCreatureEvent(cid, "VipCheck")
    registerCreatureEvent(cid, "vipLook")    
    registerCreatureEvent(cid, "one")  
    registerCreatureEvent(cid, "VipCheck")    
    registerCreatureEvent(cid, "two")    
    registerCreatureEvent(cid, "three")    
    registerCreatureEvent(cid, "four")    
    registerCreatureEvent(cid, "five")--
    
    -- if he did not make full arena 1 he must start from zero
    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 2 he must start from zero
    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- if he did not make full arena 3 he must start from zero
    if getPlayerStorageValue(cid, 42329) < 1 then
        for i = 42320, 42329 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    if getPlayerStorageValue(cid, 42355) == -1 then
        setPlayerStorageValue(cid, 42355, 0) -- did not arena level
    end
    setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
    setPlayerStorageValue(cid, 42352, 0) -- is not in arena  
    registerCreatureEvent(cid, "pvpArena")  
    return true
    end
 
can be a lot shorter :P
LUA:
function onLogin(cid)
local free_points = 10 -- amount of points to add
local storage_1 = 15253 --put any empty storage for counting the ten times
local storage_2 = 15251 --empty storage for players
local rewardsplayer = 9 -- it now give for first 10 players - edit it however you want
local pos = getPlayerPosition(cid)
local function doPlayerAddPremiumPoints(cid, points)
return db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points`+"..points.." WHERE `id` = "..getPlayerAccountId(cid)..";")
end
if isPlayer(cid) and getGlobalStorageValue(storage_1) < rewardsplayer and getCreatureStorage(cid, storage_2) < 0 then
doPlayerAddPremiumPoints(cid, free_points)
doPlayerSendTextMessage(cid, 19, 'you have been rewarded with ' .. free_points .. ' premium points. for being one of the first records here')
doCreatureSetStorage(cid, storage_2, 1)
setGlobalStorageValue((storage_1), getGlobalStorageValue(storage_1) +1)
end
return true
end
 
can be a lot shorter :P
LUA:
function onLogin(cid)
local free_points = 10 -- amount of points to add
local storage_1 = 15253 --put any empty storage for counting the ten times
local storage_2 = 15251 --empty storage for players
local rewardsplayer = 9 -- it now give for first 10 players - edit it however you want
local pos = getPlayerPosition(cid)
local function doPlayerAddPremiumPoints(cid, points)
return db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points`+"..points.." WHERE `id` = "..getPlayerAccountId(cid)..";")
end
if isPlayer(cid) and getGlobalStorageValue(storage_1) < rewardsplayer and getCreatureStorage(cid, storage_2) < 0 then
doPlayerAddPremiumPoints(cid, free_points)
doPlayerSendTextMessage(cid, 19, 'you have been rewarded with ' .. free_points .. ' premium points. for being one of the first records here')
doCreatureSetStorage(cid, storage_2, 1)
setGlobalStorageValue((storage_1), getGlobalStorageValue(storage_1) +1)
end
return true
end

this is from my post :D
http://otland.net/f82/giving-xx-premium-points-first-xx-loggers-your-server-183336/
:P
 
Back
Top