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

Auto promote bug

NilssoN042

Banned User
Joined
Sep 8, 2008
Messages
998
Reaction score
2
Location
Sweden, Helsingborg
I have got a problem whit this script! Its an auto promote script!

The problem is that everytime someoen advance in level they get a message that says,

You have been promoted to (Vocname)

I only want it to say it when they get lvl 20. Not when they advance more..

PHP:
  local config = {
    promoLevel = 1,      -- promotion level : )
    needLevel = 20,      -- level to get promotion
    needPremium = "yes"  -- need premium (YES/NO)? :D
}

function onAdvance(cid, skill, oldlevel, newlevel)
        local promoLevel = nil
        if (skill == 0) and (newlevel >= config.needLevel) and getPlayerPromotionLevel(cid) < config.promoLevel then
                if config.needPremium == "yes" then
                        if isPremium(cid) == TRUE then
                                promote = TRUE
                        end
                elseif config.needPremium == "no" then
                        promote = TRUE
                else
                        error('AUtoPromote: You have to enter "yes" or "no"')
                end
        end
        if promote ~= nil then
                setPlayerPromotionLevel(cid, config.promoLevel)
                doPlayerSendTextMessage(cid, 22, "You have been promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".")
        end
        return TRUE
end
 
Back
Top