30.03.2012, 20:43
If I understood you properly, you could have an array (with the size of MAX_VEHICLES) and you could store vehicle IDs like that...
There are numerous ways to do it, even CSTL vectors or something perhaps more efficient, whatever, but it should carry on the idea properly.
So you just carry out a search in the array.
Is this what you're looking for or am I misunderstanding something?
pawn Код:
new flaggedVehicles,
vehicles[MAX_VEHICLES];
vehicles[flaggedVehicles] = AddStaticVehicle(...);
flaggedVehicles ++;
So you just carry out a search in the array.
pawn Код:
vehicleid = 10;
for(new i = 0; i != sizeof(vehicles); i++)
{
if(vehicles[i] == vehicleid)
return i;
}