01.10.2014, 17:03
pawn Код:
CMD:upgradelevel(playerid, params[])
{
// You close the "GetPlayerScore" function as it only returns a number.
// Check if it's equal to 0, and if it is...
if(GetPlayerScore(playerid) == 0)
{
// Give them +2 score, and add to their level variable.
SetPlayerScore(playerid, GetPlayerScore(playerid) + 2);
// pInfo[playerid][Level] += 2;
}
// Else, if level is equal to or higher than 2...
else if(GetPlayerScore(playerid) >= 2)
{
// Add only one level to their current score.
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
//pInfo[playerid][Level] ++; // And doing the same for their level variable.
}
// Returning a positive value.
return true;
}