freddzor11
Member
- Joined
- May 25, 2009
- Messages
- 695
- Reaction score
- 5
Hello I want a script, when I click on the item I will be promoted with super vocation, now I got this and it's not exactly what Im looking for...
Code:
function onSay(cid, words, param, channel)
local cfg = { level = 100, vocs = { 5, 6, 7, 8 }, storage = 45231, cost = 100000, 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 promoted 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 purchase the second promotion.")
end
else
doPlayerSendTextMessage(cid, cfg.msgtype, "Only players with first promotion may get the second promotion.")
end
else
doPlayerSendTextMessage(cid, cfg.msgtype, "Only characters of level ".. cfg.level .." or above, may purchase the second promotion.")
end
else
doPlayerSendTextMessage(cid, cfg.msgtype, "You have already purchased the second promotion.")
end
return true
end