• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Windows !promote script

vegetaaa

New Member
Joined
Mar 13, 2013
Messages
16
Reaction score
0
hey guys , again i :D

now i need search hoe to made script to use comand ! promote (np ; knight chnge to elite knight)
 
Lua:
local config = { 
    promotion = 1,    -- promotion level, default = 1 . Ignore if you don't have new vocations. 
    minLevel = 20,    -- Level needed to buy promotion 
    cost = 20000,    -- Promotion cost in gp 
    premium = "yes"    --is premium needed to buy promotion 
} 

function onSay(cid, words, param) 
    if getPlayerVocation(cid) == 0 then 
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need to have a vocation to buy a promotion.") 
        return TRUE 
    end 
    if (config.premium == "yes" and isPremium(cid)) or (config.premium ~= "yes") then     
        if(getPlayerPromotionLevel(cid) >= config.promotion) then 
            doPlayerSendCancel(cid, "You are already promoted.") 
        elseif(getPlayerLevel(cid) < config.minLevel) then 
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need to be " .. config.minLevel .. " to get promotion.") 
        elseif(doPlayerRemoveMoney(cid, config.cost) ~= TRUE) then 
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You do not have enought money! (Promotion cost " .. config.cost .. " gp.") 
        else 
            setPlayerPromotionLevel(cid, config.promotion) 
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been succesful promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".") 
        end 
    else 
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need a premium account to buy a promotion.") 
    end 
    return TRUE 
end

try search next time
 

Similar threads

Back
Top