26.01.2010, 03:32
Just add this function
and replace
with
Or alternatively.
instead of an array of taxis, have each car have its group.
This depends on how you intend to use them, I think for you the first option is better.
enum VGroups
{
g_NOGROUP = 0,
g_TAXI,
g_GROUP2
}
new VehicleGroup[MAX_VEHICLES];
new vehicleid;
vehicleid = AddStaticVehicle(438,2107.1741,1396.9814,10.8259,3 59.2047,6,76);
VehicleGroup[vehicleid] = g_TAXI;
Код:
stock IsInArray(item, groupArray[]) { for(new i=0; i<sizeof(groupArray); i++) { if(item==groupArray[i]) return 1; } return 0; }
Код:
if(GetVehicleModel(vehicleid) == Taxis[10])
Код:
if(IsInArray(vehicleid, Taxis))
Or alternatively.
instead of an array of taxis, have each car have its group.
This depends on how you intend to use them, I think for you the first option is better.
enum VGroups
{
g_NOGROUP = 0,
g_TAXI,
g_GROUP2
}
new VehicleGroup[MAX_VEHICLES];
new vehicleid;
vehicleid = AddStaticVehicle(438,2107.1741,1396.9814,10.8259,3 59.2047,6,76);
VehicleGroup[vehicleid] = g_TAXI;