God damn maths.
#2

If I understood you properly, you could have an array (with the size of MAX_VEHICLES) and you could store vehicle IDs like that...
pawn Код:
new flaggedVehicles,
    vehicles[MAX_VEHICLES];

vehicles[flaggedVehicles] = AddStaticVehicle(...);
flaggedVehicles ++;
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.
pawn Код:
vehicleid = 10;
for(new i = 0; i != sizeof(vehicles); i++)
{
    if(vehicles[i] == vehicleid)
         return i;
}
Is this what you're looking for or am I misunderstanding something?
Reply


Messages In This Thread
[ - FIXED - ] - by MP2 - 30.03.2012, 20:37
Re: God damn maths. - by AndreT - 30.03.2012, 20:43
Re: God damn maths. - by MP2 - 30.03.2012, 20:47
Re: God damn maths. - by AndreT - 30.03.2012, 21:13
Re: God damn maths. - by MP2 - 30.03.2012, 21:18

Forum Jump:


Users browsing this thread: 2 Guest(s)