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

Free promotion for premium

Way20

Well-Known Member
Joined
Sep 29, 2014
Messages
208
Solutions
3
Reaction score
82
I have one login script that check if player has premium, if yes the script set vocation id +4 (promotion), but this script is for loguin, when i search in gesior, says that player does not have promotion. So I need that script set promotion with a query to when I search in website says that the player has promotion.

Part of the Script:
Code:
        if isInArray({1, 2, 3, 4}, getPlayerVocation(cid)) then

            doPlayerSetVocation(cid, getPlayerVocation(cid) + 4)

Sorry for my english
 
There's an easier way to do that also this may help with your problem.
Code:
if isPremium(cid) then
   doPlayerSetPromotionLevel(cid, 1)

To prevent being promoted every login.
Code:
if isPremium(cid) and getPlayerStorageValue(cid, 53214) == -1 then
  doPlayerSetPromotionLevel(cid, 1)
    setPlayerStorageValue(cid, 53214, 1)
 
I think you can just register all players with promotion straight away. They temporarily switch to the non-promoted class when premium time expires, and become promoted again when premium time is reactivated.
 
I've tried this

Code:
    if isPremium(cid) then
        if isInArray({0}, getPlayerPromotionLevel(cid)) then

            doPlayerSetPromotionLevel(cid, 1)
            doPlayerSave(cid, true)
        end
        return true
    else
            if isInArray({1}, getPlayerPromotionLevel(cid)) then

                doPlayerSetPromotionLevel(cid, 0)
                doPlayerSave(cid, true)
            end
        end

Now when I have premium the scripts give me promotion and I can see in gesior, when I lose premium I lose promotion too, but in gesior says that player yet have promotion, someone can help me?
 
As I understand, say you want to remove promotion from every player who has expired his premium time. You can put in your login.lua this part of code:
Code:
    if not isPremium(cid) then
        doPlayerSetPromotionLevel(cid, 0)
        return true
    end
 
As I understand, say you want to remove promotion from every player who has expired his premium time. You can put in your login.lua this part of code:
Code:
    if not isPremium(cid) then
        doPlayerSetPromotionLevel(cid, 0)
        return true
    end

Same thing again, When I lose premium the promotion was removed in game, but in site yet show "Elder Druid", the column 'promotion' in players was not changed still with '1'.
 
Relog your character.
I did it.

Look in game.
Uych55Y.png

In gesior show.
8OHyz34.png

Phpmyadmin
Sa5hi9O.png
 
Try adding this in your script.
Code:
db.query('UPDATE players SET promotion = 0 WHERE name =' .. getPlayerName(cid))
 
I can't understand, when I set manually promotion to 1 in Phpmyadmin and log without premium, the query set promotion to 0, but when I lost premium the query don't set promotion to 0. :mad:
 
Back
Top