• 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 not remove on premium end

Exiled Pain

Fervid Learner
Joined
Jan 8, 2008
Messages
552
Reaction score
4
Sup
I'm also using TFS 3.3 and have the same problem, when premium time ends.. if the player got the promotion during this time, it won't be removed when premium time ends... could someone plx wive us some pointers?

I know there is a command in config.lua:

premiumForPromotion = "yes"

Already have it active, but still the FREE players that got promotion when premium, have their promotion showing..
 
Make like this...
LUA:
function onLogin(cid)
local premStorage = 5598
	if isPremium(cid) == TRUE and getPlayerStorageValue(cid, premStorage) == -1 then
		setPlayerStorageValue(cid, premStorage, 1)
	elseif isPremium(cid) == FALSE and getPlayerStorageValue(cid, premStorage) == 1 then
		setPlayerStorageValue(cid, premStorage, -1)
		end
	return TRUE
end

bb.

and just make if player is promoted and premium = false and has premStorage, then remove :)

@edit fixed.
LUA:
function onLogin(cid)
local premStorage = 5598
	if isPremium(cid) == TRUE and getPlayerStorageValue(cid, premStorage) == -1 then
		setPlayerStorageValue(cid, premStorage, 1)
	elseif isPremium(cid) == FALSE and getPlayerStorageValue(cid, premStorage) == 1 then
		setPlayerStorageValue(cid, premStorage, -1)
	elseif isPremium(cid) == FALSE and getPlayerStorageValue(cid, premStorage) == 1 and getPlayerVocation(cid) > 4 then
		doPlayerSetVocation(cid, getPlayerVocation(cid) -4)
		end
	return TRUE
end
if not work
LUA:
function onLogin(cid)
local premStorage = 5598
	if isPremium(cid) == TRUE and getPlayerStorageValue(cid, premStorage) == -1 then
		setPlayerStorageValue(cid, premStorage, 1)
	elseif isPremium(cid) == FALSE and getPlayerStorageValue(cid, premStorage) == 1 then
		setPlayerStorageValue(cid, premStorage, -1)
	elseif isPremium(cid) == FALSE and getPlayerStorageValue(cid, premStorage) == 1 and getPlayerVocation(cid) > 4 then
		setPlayerPromotionLevel(cid, 0)
		end
	return TRUE
end
try this...
 
Last edited:
Thanks, actually had done something like that, but your look great... found out one of the main problems was that I hadt updated my vocation.xml files, had been using a really oldone, but now that I added the PREMIUM validation on vocations.xml its working fine ingame, now the only issue is that in gesior web is not updating this, but that's where your code comes in handy, so thanks... :thumbup:
 
Back
Top