Problem with a loop
#6

I have no clue to why this actually would work, since strcmp shouldn't accept the values if one returns null, but try:

pawn Код:
for(new i = 0; i < sizeof(personalVehicleData); i++)
    {
        if(!strcmp(personalVehicleData[i][owner], playersName[playerid], false) && !isnull(personalVehicleData[i][owner]))
        {
            if(personalVehicleData[i][spawned] == 0)
            {
                printf("%d: %s, %d", i, personalVehicleData[i][owner], personalVehicleData[i][modelID]);
                vNumbers ++;
                format(string, sizeof(string), "%s\n%s", string, GetVehicleNameFromModel(personalVehicleData[i][modelID]));
            }
        }
    }
Define isnull() if you haven't.
pawn Код:
#if !defined isnull
    #define isnull(%1) ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif
Reply


Messages In This Thread
Problem with a loop - by Jack_Leslie - 21.03.2016, 09:08
Re: Problem with a loop - by K0P - 21.03.2016, 09:23
Re: Problem with a loop - by Jack_Leslie - 21.03.2016, 09:26
Re: Problem with a loop - by introzen - 21.03.2016, 09:39
Re: Problem with a loop - by Jack_Leslie - 21.03.2016, 09:42
Re: Problem with a loop - by introzen - 21.03.2016, 10:10
Re: Problem with a loop - by Jack_Leslie - 21.03.2016, 10:17

Forum Jump:


Users browsing this thread: 1 Guest(s)