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

Promotion OnAdvance

Joined
Sep 29, 2009
Messages
224
Reaction score
0
When player up level 20 he win promotion automatication.
I search in forum more all scripts no work ;s

Thx
 
Code:
function onAdvance(cid, skill, oldLevel, newLevel)
    if getPlayerLevel(cid) == 20 then
        if getPlayerStorageValue(cid, 1234) ~= 1 then
            if getPlayerVocation(cid) == 1 then
                doPlayerSetVocation(cid, 5)
                setPlayerStorageValue(cid, 1234, 1)
            elseif getPlayerVocation(cid) == 2 then
                doPlayerSetVocation(cid, 6)
                setPlayerStorageValue(cid, 1234, 1)
            elseif getPlayerVocation(cid) == 3 then
                doPlayerSetVocation(cid, 7)
                setPlayerStorageValue(cid, 1234, 1)
            elseif getPlayerVocation(cid) == 4 then
                doPlayerSetVocation(cid, 8)
                setPlayerStorageValue(cid, 1234, 1)
            end
        end
    end
return true
end
test this one ;p
 
Slaktaren
Maybe setPlayerPromotionLevel? It will be more shortly...
PHP:
function onAdvance(cid, skill, oldLevel, newLevel)
    if skill == SKILL__LEVEL and newlevel >= 20 then
        if getPlayerPromotionLevel(cid) ~= 1 then
            setPlayerPromotionLevel(cid, 1)
        end
    end
end
 
Last edited:
Lua:
function onAdvance(cid, skill, oldLevel, newLevel)
    if skill == SKILL__LEVEL and newlevel >= 20 and getPlayerPromotionLevel(cid) < 1 then
		doPlayerSetPromotionLevel(cid, 1)
		doCreatureSay(cid, "Promoted!", TALKTYPE_ORANGE_1)
	end
	return true
end
 
Back
Top