[HELP] Experience and level system
#1

Hi guys. Is there any way to create /levelup and exp. system.For example, i earn exp. on payday and i need %s exp. points for level %s and etc. I used search and i found one using dini and dudb but i don't like it cuz i got 350 exp. when i kill somebody. I want (like to) :
* 1 exp per payday
* need to have certain numbers of exp. to /levelup
* if i /levelup my score gets +1
Thanks in advance!
Sincerely,
anito
Reply
#2

First off create a variable to save the exp and level:

pawn Код:
new exp[MAX_PLAYERS];
new level[MAX_PLAYERS];
After this you can need to create a timer SetTimer to make exp +1 for the player
pawn Код:
exp[playerid]++;
Using the levelup:

pawn Код:
stock nextLevel(playerid){
    return (level[playerid] * 8);
}
if(!strcmp(cmdtext, "/levelup", true)) {
    if(nextLevel(playerid) >= exp[playerid]) {
          // you can have level 2 now!!
          SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
          exp[playerid] = 0; // reset the variable
          level[playerid] ++; // add +1 level          
    }
    return 1;
}
I hope this help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)