02.07.2012, 14:07
First off create a variable to save the exp and level:
After this you can need to create a timer SetTimer to make exp +1 for the player
Using the levelup:
I hope this help.
pawn Код:
new exp[MAX_PLAYERS];
new level[MAX_PLAYERS];
pawn Код:
exp[playerid]++;
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;
}