21.03.2016, 09:08
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:
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 !
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]));
}
}
}
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 !