27.05.2014, 12:47
It's caused run time error 4. Let's say you have 10 vehicles in VehicleStatus for each player. The valid indexes will be 0-9. Indexes always start from 0 so the loop would be:
and PlayerInfo[playerid][pVehicles] would be how many cars you have.
1 car? it loops with index 0.
2 cars? it loops with index 0 and 1
and so on..
that way, it won't go out of bounds.
pawn Код:
for(new i = 0; i < PlayerInfo[playerid][pVehicles]; i++)
1 car? it loops with index 0.
2 cars? it loops with index 0 and 1
and so on..
that way, it won't go out of bounds.