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

How to add vip days to new created accounts?

gerard95

Keep cool :)
Joined
Dec 31, 2011
Messages
276
Reaction score
16
Does anybody know how to add, automatically, 7 days of vip "acces" to all brand new accounts that are made?
Thank you :)

OTX server 2.6 - server 8.6.
 
Last edited:
You can do this in game in the script: \data\creaturescripts\scripts\login.lua
Make the following in the function onlogin(cid)

Code:
if (getPlayerStorageValue(cid, 11552) == -1) then
    setPlayerStorageValue(cid, 11552, 1)
    setPlayerStorageValue(cid, 11551, 1)
end

This adds days to each character that login for the first time only.
Use a storage value that isn't used yet!
In my server storage value for vipdays is 11551, check it before setting this script!
Also characters that exist before you added this script will receive the days when they login.

It's also possible to add a line in the player creation process on your website, this uses a SQL query and is 1 line, this reduces the login time.
 
But in my server, vip days are added to the "account" not to the player, so this ain't working at all. Any clue?
 
You mean premium points? Vip days are usually applied to a player, not an account.
You will have to do this via your website, what aac do you use?
I use ZnoteAcc :)

Which VIP system are you using?
Noone in particular. But it's about using a Doll and giving 7 Vip days. There you go:

Lua:
local days = 7
function onUse(cid, item, fromPosition, itemEx, toPosition)
    doSendMagicEffect(getCreaturePosition(cid),14)
    doSendAnimatedText(getCreaturePosition(cid), "VIP +7!" ,49)
    doAddVipDays(cid, days)
    doWriteLogFile("data/logs/buyeditems.txt", "[".. os.date('%d %B %y - %H:%M') .."] ".. getCreatureName(cid) .." bought VIP for 18 points.")

    doRemoveItem(item.uid)
    return true
end
 
Add this onLogin

Code:
if (getPlayerStorageValue(cid, 11552) == -1) then 
  setPlayerStorageValue(cid, 11552, 1)
  doAddVipDays(cid, 7) 
end
 
Back
Top