• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

[HELP] Promotion!

Nottinghster

Tibia World RPG Developer
Joined
Oct 24, 2007
Messages
1,618
Solutions
6
Reaction score
537
Location
Brazil - Rio de Janeiro
GitHub
Nottinghster
Hello Guys!

I created the code, but dosn't work fine, can you help me?

I will explain how the code:

Premium Player have Promotion
Premium ends and player lost promotion
Player buy premium again and get promotion again...
Like Tibia Global works...

Here is the code on login.lua
Code:
-- Players promovidos
if isPremium(cid) == TRUE and getPlayerVocation(cid) > 4 and getPlayerStorageValue(cid, 30003) == -1 then
setPlayerStorageValue(cid, 30003, 1)
elseif isPremium(cid) == FALSE and getPlayerVocation(cid) > 4 and getPlayerStorageValue(cid, 30003) == 1 then
doPlayerSetVocation(cid, getPlayerVocation(cid)-4)
setPlayerStorageValue(cid, 30003, -1)
elseif isPremium(cid) == TRUE and getPlayerVocation(cid) < 5 and getPlayerStorageValue(cid, 30003) == 1 then
doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
end

Thank you!
 
LUA:
	local s = 30003
	if isPremium(cid) then
		if getPlayerVocation(cid) >= 5 then
			if getPlayerStorageValue(cid,s) < 1 then
				setPlayerStorageValue(cid,s,1)
			end
		elseif getPlayerVocation(cid) <= 4 then
			if getPlayerStorageValue(cid,s) == 1 then
				doPlayerSetVocation(cid,getPlayerVocation(cid)+4)
			end
		end
	else
		if getPlayerVocation(cid) > 4 then
			doPlayerSetVocation(cid,getPlayerVocation(cid)-4)
		end
	end
 
Back
Top