Posts: 734
Threads: 8
Joined: Jun 2009
Yes it is but it's uneccesary, you know MAX_PLAYERS is "1000" max, and vehicle IDs go through 1..1999 so just add a check if "i" is less than MAX_PLAYERS:
pawn Код:
for (new i = 0; i < MAX_VEHICLES; i++)
{
if (i < MAX_PLAYERS]
// Destroy admin spawned vehicles here
// Anything else
}
Second version with TWO loops:
pawn Код:
for (new i = 0, iv = 1; i < MAX_PLAYERS, iv < MAX_VEHICLES; i++, iv++)
{
// Do stuff
}
Posts: 734
Threads: 8
Joined: Jun 2009
Well that would be a 1min job for me and I would gladly do it if I were on my PC.
So here are the steps, first loop through all the vehicles, name the iterator "v", then use "foreach" and loop through connected players only, name that "i", use only GetPlayerVehicleID(i) and set your vehicleused[v] variable to true. Then make a new loop to loop through all vehicles again and do whatever you have to do.