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

Auto promotion or !promote.

Xapuur

New Member
Joined
Sep 15, 2009
Messages
157
Reaction score
0
Location
Chile
Hello !

I need an script when player pass to level 20 is auto promoted (with 0 cost), OR when he is >= 20 he can promote using talkaction !promote (including no premmy acc, and 20k cost). Any of the two scripts serve me :)

If you wanna, i can rep+ to you :)

I use TFS 0.2.11.2 (9.31)

Regards !
 
wn no sabia ke eras de chile xDDDD
hare el post en ingles por que tu kachay po
si te sirve este script porfa levantame mis temas ke se estan llendo xD

well... the first one its easy!

in data/creaturescripts/creaturescripts.xml
add this new line

XML:
<event type="advance" name="promo" event="script" value="promo.lua"/>

in data/creaturescripts/scripts/login.lua

Lua:
registerCreatureEvent(cid, "promo")

create data/creaturescripts/scripts/promo.lua

Lua:
function onAdvance(cid, skill, oldLevel, newLevel)
local msg = "Congratulations you are now promoted"
if skill == SKILL__LEVEL and newLevel == 20 and getPlayerPromotionLevel(cid) < 2 then
doPlayerSetPromotionLevel(cid, 2)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg)
end
end

and thats it!

ill post the other one on my next post so you can test this one right now!
 
the talkaction

in data/talkactions/talkactions.xml
add this line

XML:
<talkaction words="!promote"  event="script" value="talkpromo.lua"/>

in data/talkactions/scripts/talkpromo.lua

Lua:
function onSay(cid, words, param, channel)

local promoney = 20000
local msg = "Congratulations you are now promoted"
local lvl = getPlayerLevel(cid)

if getPlayerPromotionLevel(cid) >= 2 then
doPlayerSendCancel(cid, 'You are already promoted.')

elseif getPlayerMoney(cid) < promoney then
doPlayerSendCancel(cid, 'You dont have enought money')

elseif lvl < 20 and getPlayerPromotionLevel(cid) < 2 and getPlayerMoney (cid) >= promoney then
doPlayerSetPromotionLevel(cid, 2)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, msg)
doPlayerRemoveMoney(cid, promoney)

end
end

and thats all ;)
 
Son chilenos wns?, tienen algun server? XD

Si Quieren Me Ayudan En Proyecto Que Estoy Trabajando
-Draken Server
-Draken.hopto.org

Entren! y hablamos
 
Back
Top