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

[Request] Player won't get exp until he buys promotion

spice

CABS ARE HERE
Joined
Apr 5, 2009
Messages
1,226
Reaction score
15
Location
Göteborg, Sweden
So I need some help with my level system, togheter with my new vocation system. The player starts at level 8 and level up to 120. At level 120 he won't get EXP (he can still hunt to get loot, but NO exp). After he bought the promotion he will get exp when hunting.
 
Code:
[LEFT]  function onAdvance(cid, skill, oldlevel, newlevel)
    if skill == SKILL__LEVEL and newlevel >= 120 then
        doPlayerSetExperienceRate(cid, 0.0)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "If don't want txt delete this line")
    end
    return TRUE
end[COLOR=#b1b100]
[/COLOR][/LEFT]
??
it will set 0.0 exp rate for ALL players who are 120 or above ;s

shouldn't it be like this or smth?
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
    if skill == SKILL__LEVEL and newlevel >= 120 then
        if not isPremium(cid) then
            doPlayerSetExperienceRate(cid, 0.0)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "If don't want txt delete this line")
        end
    end
    return TRUE
end
 
I don't undedstand you...
1. doPlayerSetExperienceRate(cid, 0.0) -- doPLAYER not all players and ...(cid,... so only the player who advance...
2. You changed only the lines, so it will work the same way but the 'if' are others ? :D

EDIT
doPlayerSetExperienceRate(cid, 0.0) did you test it? If not then stay quiet :D I use it for my exp ring and there is no problem :S
 
GlobalEvents
PHP:
<globalevent name="expcheck" interval="1" event="script" value="script_name.lua"/>

Code:
function onThink(cid, interval)
	for _, cid in ipairs(getOnlinePlayers()) do
		if getPlayerPromotionLevel(cid) < 2 then
			if getPlayerLevel(cid) < 120 and getPlayerLevel(cid) > 8 then
				doPlayerSetRate(cid, SKILL__LEVEL, 0)
			end
		end
	end
	
	return true
end
 
does that do all 3 JDB?

free acc max level cap 120
promotion max level cap 180
premium account = no level cap?

also say a player gets premium time and can exp again, when he looses premium can he still exp?
 
GlobalEvents
PHP:
<globalevent name="expcheck" interval="1" event="script" value="script_name.lua"/>

Code:
function onThink([B][COLOR="Red"]cid[/COLOR][/B], interval)
	for _, cid in ipairs(getOnlinePlayers()) do
		if getPlayerPromotionLevel(cid) < 2 then
			if getPlayerLevel(cid) < 120 and getPlayerLevel(cid) > 8 then
				doPlayerSetRate(cid, SKILL__LEVEL, 0)
			end
		end
	end
	
	return true
end
no such parametre "cid" in globalevents
 

Similar threads

Back
Top