Scripting a Rank + 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: Scripting a Rank + EXP System (
/showthread.php?tid=533389)
Scripting a Rank + EXP System -
JaKe Elite - 24.08.2014
Scripting a Rank + EXP system.
Already scripted it, Adding 2 exp each kill, and decreases 2 EXP when kill a team mate.
However, Now i am having a problem on making rank ups.
My goal is to:
• When player ranks up, 20 EXP Requirements added, for example, The EXP i needed to rank up is 20, once i rank up, the server itself would add another 20 EXP Requirements, making it 40.
Anyone can help me up?
Re: Scripting a Rank + EXP System -
jueix - 24.08.2014
Make a enum for players xp like PlayerInfo[playerid][XpRequired].
When a player reaches 20 xp Do something like.
Код:
if(PlayerInfo[playerid][pXP] == PlayerInfo[playerid][XpRequired])
{
PlayerInfo[playerid][pLevel] = PlayerInfo[playerid][pLevel]+1;
PlayerInfo[playerid][pXpRequired] = PlayerInfo[playerid][pXpRequired]*2;
Playerinfo[playerid][pXp] = 0;
}
Just an idea.
The above code if I did it correctly (not in the mood for programming to day, Feel really tired) will times the xp required for a level up. For example if level = 1 / 0 it will be your xp for level 1 (20) and it will times it by 2 on the level up making it 40, Then 80, Then 160 ETC.
Re: Scripting a Rank + EXP System -
JaKe Elite - 24.08.2014
I would try, thank you for giving me the idea of that.
Re: Scripting a Rank + EXP System -
MicroD - 24.08.2014
Okay so here's where algorithms come in handy.
http://gamedev.stackexchange.com/que...erience-points
http://gamedev.stackexchange.com/que...erience-system
or even take a look on Minecraft one:
http://minecraft.gamepedia.com/Experience