Using (playerid == )
#5

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;
}
Reply


Messages In This Thread
Using (playerid == ) - by Josh_Main - 01.10.2014, 16:37
Re: Using (playerid == ) - by Sawalha - 01.10.2014, 16:43
Re: Using (playerid == ) - by Rudy_ - 01.10.2014, 16:46
Re: Using (playerid == ) - by Josh_Main - 01.10.2014, 16:56
Re: Using (playerid == ) - by Dignity - 01.10.2014, 17:03
Re: Using (playerid == ) - by Rudy_ - 01.10.2014, 17:06
Re: Using (playerid == ) - by Rudy_ - 01.10.2014, 17:09
Re: Using (playerid == ) - by Josh_Main - 01.10.2014, 17:13
Re: Using (playerid == ) - by Dignity - 01.10.2014, 17:16
Re: Using (playerid == ) - by Rudy_ - 01.10.2014, 17:17

Forum Jump:


Users browsing this thread: 1 Guest(s)