ZeeBeast
Preferable Beta Tester
I need help with a script. I am trying to get my promotion so say if you are a master sorcerer, you could choose to be either a great master sorcerer or an elite master sorcerer. The script I have atm is a little messed up. It will promote me to what I want to be, Until I relog.
This code works perfectly fine. But the problem is the other choice. It is the exact same as the other script but instead of "setPlayerPromotionLevel(cid, getPlayerPromotionLevel(cid) + 1)" it is "setPlayerPromotionLevel(cid, getPlayerPromotionLevel(cid) + 2)" but it still does the same thing as the first script.
Could anyone help me?
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local cfg = { level = 100, vocs = { 5, 6, 7, 8 }, storage = 45231, cost = 10000, msgtype = MESSAGE_STATUS_CONSOLE_BLUE }
if getPlayerStorageValue(cid, cfg.storage) == -1 then
if getPlayerLevel(cid) >= cfg.level then
if isInArray(cfg.vocs, getPlayerVocation(cid)) == true then
if (getPlayerMoney(cid) >= cfg.cost) then
doPlayerRemoveMoney(cid, cfg.cost)
setPlayerPromotionLevel(cid, getPlayerPromotionLevel(cid) + 1)
doPlayerSendTextMessage(cid, cfg.msgtype, "You have been subclassed to ".. getVocationInfo(getPlayerVocation(cid)).name ..".")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN)
setPlayerStorageValue(cid, cfg.storage, 1)
else
doPlayerSendTextMessage(cid, cfg.msgtype, "You need ".. cfg.cost .." gold coins to get a subclass.")
end
else
doPlayerSendTextMessage(cid, cfg.msgtype, "Only players with first promotion may get a subclass.")
end
else
doPlayerSendTextMessage(cid, cfg.msgtype, "Only characters of level ".. cfg.level .." or above, may get a subclass")
end
else
doPlayerSendTextMessage(cid, cfg.msgtype, "You have already been subclassed.")
end
return true
end
Could anyone help me?