NilssoN042
Banned User
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..
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