SA-MP Forums Archive
Exp system. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Exp system. (/showthread.php?tid=364279)



Exp system. - oblexive - 30.07.2012

Hey everyone, im working on an exp or respect system. Its going to be basic, so this should be a basic question.
Iv created the system thus for yet want a better way of checking players level / exp without having tons of lines
checking each level. So far I have about 30 lines all checking what the players level is and there exp then leveling them up based on that.

pawn Код:
if(PlayerInfo[playerid][pLevel] == 1 && PlayerInfo[playerid][pExp] >= 2) PlayerInfo[playerid][pLevel]++;
The Exp is only 1 more than their actual level each time. So at level 1, 2 exp. Level 5, 6 etc..
Is there a way of cutting down the code to a loop or something like that so I dont need 1 line to check each
individual level?

Thanks so much guys.