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

Lua How to change promotion for vocation

TibiaGameHost

Hello!
Joined
Feb 25, 2009
Messages
255
Reaction score
0
Location
Canadá
Hello everybody.

I have a problem here, I have a system of buying for my VIP site, the VIP arrives, if the player is normal vocation, vocation VIP is changed, if the player is calling with the Vocation promotion of it disappears, so I need a help, how to change the promotion at the VIP database, instance, when you buy VIP promotion change to 0 and then put the new vocation.

help me.

Script for change vocation after activate vip

function onLogin(cid)

if vip.hasVip(cid) == TRUE then
if(isInArray({1, 2, 3, 4}, getPlayerVocation(cid))) then
doPlayerSetVocation(cid,getPlayerVocation(cid)+12)

end
elseif vip.hasVip(cid) == FALSE and vip.getVip(cid) == 0 then
if(isInArray({13, 14, 15, 16}, getPlayerVocation(cid))) then
doPlayerSetVocation(cid,getPlayerVocation(cid)-12)
end
end
return TRUE
end

I need to run a command that changes the player's promotion to 0, why I created this vocation only takes 0 with promotion, thanks
 
Some here..

Try this on creaturescript..

function onLogin(cid)
if vip.hasVip(cid) == TRUE and getPlayerPromotionLevel(cid) <= 1 then
doPlayerSetPromotionLevel(cid, 2)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Your are: " .. getPlayerVocationName(cid) .. ".")

elseif vip.hasVip(cid) == FALSE and vip.getVip(cid) == 0 and getPlayerPromotionLevel(cid) >= 2 then
doPlayerSetPromotionLevel(cid, 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You do not have Vip! Now you are: " .. getPlayerVocationName(cid) .. ".")
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))

end
return true
end

In config.lua

premiumForPromotion = false
 
Last edited:
Back
Top