Looping through vehicles with Foreach
#2

Why would you do that? Bad design and it is causing you problems already!

You should have something like

Код:
#define VEHICLE_TYPE_STANDARD 0
#define VEHICLE_TYPE_COP 1

enum VEHICLEINFO {
gVehicleType,
...
...
}

gVehicleData[MAX_VEHICLES][VEHICLEINFO];

foreach(new i : Vehicles)
if(gVehicleData[i][gVehicleType] == VEHICLE_TYPE_COP) {}
This will limit the need for multiple enums, iterators, variables.
Reply


Messages In This Thread
Looping through vehicles with Foreach - by ross8839 - 07.06.2017, 16:01
Re: Looping through vehicles with Foreach - by Pottus - 07.06.2017, 16:07
Re: Looping through vehicles with Foreach - by ross8839 - 07.06.2017, 16:10
Re: Looping through vehicles with Foreach - by Pottus - 07.06.2017, 16:11
Re: Looping through vehicles with Foreach - by ross8839 - 07.06.2017, 16:52

Forum Jump:


Users browsing this thread: 1 Guest(s)