function onSay(cid, words, param, channel)
local cfg = {
level = 100,
vocs = { 5, 6, 7, 8 },
cost = 100000
}
if getPlayerLevel(cid) >= cfg.level then
if isInArray(cfg.vocs, getPlayerVocation(cid)) then
if doPlayerRemoveMoney(cid, cfg.cost) then
return setPlayerPromotionLevel(cid, getPlayerPromotionLevel(cid) + 1) and doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been promoted.")
else
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You need ".. cfg.cost .." gold coins to purchase the second promotion.")
end
else
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Sorry, you cannot get the second promotion.")
end
else
return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Only characters of level ".. cfg.level .." or above, may purchase the second promotion.")
end
return true
end