function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerVocation(cid) == 5 then
doPlayerSetVocation(cid, 20)
doCreatureSay(cid, "You are now a Super Sorcerer!", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
elseif getPlayerVocation(cid) == 6 then
doPlayerSetVocation(cid, 21)
doCreatureSay(cid, "You are now a Super Druid!", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
elseif getPlayerVocation(cid) == 7 then
doPlayerSetVocation(cid, 22)
doCreatureSay(cid, "You are now a Super Paladin!", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
elseif getPlayerVocation(cid) == 8 then
doPlayerSetVocation(cid, 23)
doCreatureSay(cid, "You are now a Super Knight!", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid,"You need to be promoted in order to use this item.")
end
end
its the code to get this promo
Code:function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerVocation(cid) == 5 then doPlayerSetVocation(cid, 20) doCreatureSay(cid, "You are now a Super Sorcerer!", TALKTYPE_ORANGE_1) doRemoveItem(item.uid, 1) elseif getPlayerVocation(cid) == 6 then doPlayerSetVocation(cid, 21) doCreatureSay(cid, "You are now a Super Druid!", TALKTYPE_ORANGE_1) doRemoveItem(item.uid, 1) elseif getPlayerVocation(cid) == 7 then doPlayerSetVocation(cid, 22) doCreatureSay(cid, "You are now a Super Paladin!", TALKTYPE_ORANGE_1) doRemoveItem(item.uid, 1) elseif getPlayerVocation(cid) == 8 then doPlayerSetVocation(cid, 23) doCreatureSay(cid, "You are now a Super Knight!", TALKTYPE_ORANGE_1) doRemoveItem(item.uid, 1) else doPlayerSendCancel(cid,"You need to be promoted in order to use this item.") end end
but i dont know where this save. Maybe it creaturescripts ?
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerPromotionLevel(cid) < 2 then
setPlayerPromotionLevel(cid, 2)
doCreatureSay(cid, "You have been promoted!", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid,"You need to be promoted in order to use this item.")
end
return TRUE
end
I another problem; When character buys first promotion, after relogging he has second promotion.
if getPlayerPromotionLevel(cid) < 1 then
setPlayerPromotionLevel(cid, 2)