Scripting a Rank + EXP System
#1

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?
Reply
#2

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.
Reply
#3

I would try, thank you for giving me the idea of that.
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)