Returning wrong number
#5

because if [Owner] is empty strcmp returns 0 (match)

pawn Код:
stock GetPlayerVehicles(playerid)
{
    new Nick[MAX_PLAYER_NAME], count = 0;
    Nick = GetPlayerNameEx(playerid);
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
        if(vInfo[i][Owner][0] != '\0' && strcmp(vInfo[i][Owner], Nick) == 0)
            count++;
    }
    return count;
}
Reply


Messages In This Thread
Returning wrong number - by Yako - 31.05.2014, 21:01
Re: Returning wrong number - by Aerotactics - 31.05.2014, 22:39
Re: Returning wrong number - by Copfan5 - 31.05.2014, 23:47
Re: Returning wrong number - by Abagail - 31.05.2014, 23:56
Re: Returning wrong number - by Jefff - 31.05.2014, 23:56

Forum Jump:


Users browsing this thread: 1 Guest(s)