• 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!

Promotion Command

hukuru

New Member
Joined
Dec 10, 2010
Messages
8
Reaction score
0
I need a command that promotes you when you say it (like !promotion)

It costs 2cc (20,000 gp), and you have to be level 20 to get it.

Thanks
 
If i dont have wrong put this in login.lua

Lua:
if getPlayerPremiumDays(cid) >= 1 then
	if getPlayerPromotionLevel(cid) < 1 then
		doPlayerSetPromotionLevel(cid, 1)
		doSendMagicEffect(getCreaturePosition(cid),30)
		doPlayerSendTextMessage(cid,22,"You have been promoted!")
	end
end

if that dont work try this:

Lua:
local t = {
[1] = {"You are now a master sorcerer",5},
[2] = {"You are now an elder druid",6},
[3] = {"You are now a royal paladin",7},
[4] = {"You are now an elite knight",8}
}
 
function onLogin(cid)
         ppos = getPlayerPosition(cid)
local v = t[getPlayerVocation(cid)]
    if t then
		if getPremiumDays >= 0 then
                doPlayerSetVocation(cid,v[2])
                doSendMagicEffect(ppos,5)
                doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,v[1])
				setPlayerStorageValue(cid,7000,1)
			elseif getPlayerStorageValue(cid,7000) > 0 then
				doPlayerSendCancel(cid,"You have already been promoted")
       end
    return true
end
end
 
@Up: That scripts mine...
And it has a login function, it must be onSay.
Lol, and it doesnt even check level nor money..
EDIT: This should work

data/talkactions/scripts/promote.lua
Lua:
local t = {
[1] = {"You are now a master sorcerer",5},
[2] = {"You are now an elder druid",6},
[3] = {"You are now a royal paladin",7},
[4] = {"You are now an elite knight",8}
}
 
function onSay(cid, words, param)
ppos = getPlayerPosition(cid)
local v = t[getPlayerVocation(cid)]
    if t then
	if doPlayerRemoveMoney(cid,20000) then
           if getPlayerStorageValue(cid,7000) < 1 then
              doPlayerSetVocation(cid,v[2])
              doSendMagicEffect(ppos,5)
              doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,v[1])
		      setPlayerStorageValue(cid,7000,1)
            else
                doPlayerSendCancel(cid, "You have already been promoted")
            end
        else
            doPlayerSendCancel(cid, "You do not have enough money")
        end
    return true
end
end

data/talkactions/talkactions.xml
XML:
<talkaction words="!promotion" event="script" value="promote.lua"/>
 
Last edited:
tfs 0.3/4
Lua:
local cost = 20000
local level = 20

function onSay(cid, words, param, channel)
    if getPlayerPromotionLevel(cid) == 1 then
        return doPlayerSendCancel(cid, 'You are already promoted.')
    end
    
    if getPlayerLevel(cid) < level then
        return doPlayerSendCancel(cid, 'You must be at least level 20 in order to be promoted.')
    end
    
    if doPlayerRemoveMoney(cid, cost) then
        doPlayerSetPromotionLevel(cid, 1)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Congratulations! You have just been promoted')
        doSendMagicEffect(getThingPos(cid), math.random(28,30))
        doPlayerSave(cid)
    else
        return doPlayerSendCancel(cid, 'You must need '..cost..' gps in order to be promoted.')
    end
    return true
end
XML:
<talkaction words="!promotion" event="script" value="promo.lua"/>
 
@Up: That scripts mine...
And it has a login function, it must be onSay.
Lol, and it doesnt even check level nor money..
EDIT: This should work

data/talkactions/scripts/promote.lua
Lua:
local t = {
[1] = {"You are now a master sorcerer",5},
[2] = {"You are now an elder druid",6},
[3] = {"You are now a royal paladin",7},
[4] = {"You are now an elite knight",8}
}
 
function onSay(cid, words, param)
ppos = getPlayerPosition(cid)
local v = t[getPlayerVocation(cid)]
    if t then
	if doPlayerRemoveMoney(cid,20000) then
           if getPlayerStorageValue(cid,7000) < 1 then
              doPlayerSetVocation(cid,v[2])
              doSendMagicEffect(ppos,5)
              doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,v[1])
		      setPlayerStorageValue(cid,7000,1)
            else
                doPlayerSendCancel(cid, "You have already been promoted")
            end
        else
            doPlayerSendCancel(cid, "You do not have enough money")
        end
    return true
end
end

data/talkactions/talkactions.xml
XML:
<talkaction words="!promotion" event="script" value="promote.lua"/>

Why wouldnt you help him then? :S
 
I added the script and i get promotion and than when i log back in it says i that im only a knight and not a elite knight. What can i do. Ive been lookin and have found nothing yet!
 
Back
Top