Problem with a loop
#1

Hi, I'm having an issue with a loop! I've been trying to persist with fixing it myself for hours and I just can't figure it out.. it's probably something small

Code:
pawn Код:
for(new i = 0; i < sizeof(personalVehicleData); i++)
    {
        if(!strcmp(personalVehicleData[i][owner], playersName[playerid], false))
        {
            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]));
            }
        }
    }
It's obviously meant to select the data where the names match, but it's selecting all of the data, weird thing is the data it selects where the names don't match, is empty.

Example:
[19:43:30] 0: Jack Leslie, 411
[19:43:30] 1: Jack Leslie, 415
[19:43:30] 2: Jack Leslie, 444
[19:43:30] 4: , 0 <-- Empty

Help is appreciated !
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)