kamilcioo
Veteran OT User
- Joined
- Jul 25, 2008
- Messages
- 979
- Solutions
- 1
- Reaction score
- 291
Hey, I just made a promotion item script. Everything works great but when I log out promotion dissapears.
Can anyone rewrite it to make promotion lasts forever?
When I use
instead
it works but it doesn't give me the promotion I want. Btw I have 3 main vocations and 2 promotions for each of them.
Can anyone rewrite it to make promotion lasts forever?
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerPromotionLevel(cid) < 1 and getPlayerVocation(cid) == 1 and getPlayerLevel(cid) > 29 then
doPlayerSetVocation(cid, 5)
doCreatureSay(cid, "You have been promoted to xxx", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
elseif getPlayerLevel(cid) < 29 and getPlayerVocation(cid) == 1 then
doCreatureSay(cid, "You need to be 30 lvl.", TALKTYPE_ORANGE_1)
elseif getPlayerVocation(cid) ~= 1 then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You need to be a mage to use this item.")
else
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You are already promoted.")
end
return true
end
When I use
Code:
doPlayerSetPromotionLevel(cid, 3)
Code:
doPlayerSetVocation(cid, 5)