09.08.2011, 15:54
(
Последний раз редактировалось Sledge; 09.08.2011 в 18:40.
)
pawn Код:
neededEXP[playerid] = playerVariables[playerid][pLevel] * 8;
if(playerVariables[playerid][pLevel] * 8 >= neededEXP[playerid]) //If I set as > the player keeps leveling up regardless of his EXP amount. If I set it to < the player can't level up no matter what his EXP is.
{
//level 1 player has less than 8
playerVariables[playerid][pLevel] += 1;
playerVariables[playerid][pEXP] = 0;
format(string, sizeof(string), "Congratulations! You have gained a level! You have unlocked new features.");
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "You are now level %d. Your EXP has been resetted to 0.", playerVariables[playerid][pLevel]);
SendClientMessage(playerid, COLOR_YELLOW, string);
SetPlayerScore(playerid, playerVariables[playerid][pLevel]);
}