local config = {promotion = 1,minLevel = 20,cost = 20000,premium = "yes"}
local disabledVocations = {0}
config.premium = getBooleanFromString(config.premium)
function onSay(cid,words,param)
if (isInArray(disabledVocations, getPlayerVocation(cid)) == TRUE) then
elseif (config.premium == TRUE and isPremium(cid) == FALSE) then
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_RED,"Sorry, you do not have Premium account.")
elseif (getPlayerPromotionLevel(cid) >= config.promotion) then
elseif (getPlayerLevel(cid) < config.minLevel) then
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_RED,"Musisz posiadac "..config.minLevel.." poziom lub wyzszy.")
elseif (doPlayerRemoveMoney(cid, config.cost) ~= TRUE) then
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_RED,"Sorry, you do not have enough money.")
else
setPlayerPromotionLevel(cid,config.promotion)
doPlayerSendTextMessage(cid,19,'You bought promotion! Now your profession is '..getVocationInfo(getPlayerVocation(cid)).name..'.')
doSendMagicEffect(getCreaturePosition(cid),14)
doPlayerSave(cid)
end
return TRUE
end