[HELP] Experience and level system
#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


Messages In This Thread
[HELP] Experience and level system - by anito - 02.07.2012, 12:23
Re: [HELP] Experience and level system - by Ricop522 - 02.07.2012, 14:07

Forum Jump:


Users browsing this thread: 1 Guest(s)