• 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!

receive 3 days of premium when creating the account the first time.

function onLogin(cid)
local storage,days = (getPlayerAccountId(cid)+550),1
if getGlobalStorageValue(storage) <= 0 then
setGlobalStorageValue(storage, 1)
addVipDays(cid, days)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você recebeu um "..days.." dias de vip, bom jogo!")
end
return true
end
 
Lua:
function onLogin(cid)
    local storage, days = (getPlayerAccountId(cid) + 550), 1
    if getPlayerStorageValue(cid, storage) <= 0 then
        setPlayerStorageValue(cid, storage, 1)
        doPlayerAddPremiumDays(cid, days)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Bla bla bla " .. days .. " bla bla bla!")
    end
    return true
end
 
Lua:
function onLogin(cid)
    local storage, days = (getPlayerAccountId(cid) + 550), 1
    if getPlayerStorageValue(cid, storage) <= 0 then
        setPlayerStorageValue(cid, storage, 1)
        doPlayerAddPremiumDays(cid, days)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Bla bla bla " .. days .. " bla bla bla!")
    end
    return true
end

Good idea
But there is no limits to storage?
I mean, if i have 1.000.000 accounts it could broke?
 
Good idea
But there is no limits to storage?
I mean, if i have 1.000.000 accounts it could broke?

Each player have it's own storages... so there is no issue. Thats how the game checks for just anything (quest status, promotions, spells...)

The method above will give 3 premium days for EACH new character so unless you limit the amount of characters per account (could be exploited by deleting characters) people will have infinite premium days.

nvm that, I missread the getPlayerAccountId part.

You can also edit the database so instead of giving the premdays a value of 0 by default, make it 3 (or whatever number you want)

Code:
`premdays` int(11) NOT NULL DEFAULT '0',
 
you could also edit PHP script (register page) if you have your own website, that way you do not have to add any storage values and also removes unnecessary check every time player logs in. It's just an alternative
 
Back
Top