ricotjeh
New Member
- Joined
- Apr 21, 2009
- Messages
- 45
- Reaction score
- 0
Well ive been thinking to be able to let players promote theirselves with the command !promote...
with this reason that my promote npc doesnt work xD
so i started trying some Lua functions and it got pretty fluently.
these are my results but seems it has some errors, and i cant figure out what they are...
Can someone help me?
with this reason that my promote npc doesnt work xD
so i started trying some Lua functions and it got pretty fluently.
these are my results but seems it has some errors, and i cant figure out what they are...
Can someone help me?
Code:
function onSay(cid, words, param)
vocation = getPromotedVocation(cid)
if doPlayerRemoveMoney(cid, 20000) == TRUE
and getPlayerVocation(cid) == 1
then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are now Promoted.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
doPlayerSetVocation(cid,5)
end
and getPlayerVocation(cid) == 2
then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are now Promoted.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
doPlayerSetVocation(cid,6)
end
and getPlayerVocation(cid) == 3
then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are now Promoted.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
doPlayerSetVocation(cid,7)
end
and getPlayerVocation(cid) == 4
then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You are now Promoted.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
doPlayerSetVocation(cid,8)
end
else
doPlayerSendCancel(cid, "You Alredy are promoted.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
else
doPlayerSendCancel(cid, "You don't have enough money, Promotin costs 20k!.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
return TRUE
end