God damn maths.
#1

-fixed -
Reply
#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
#3

I don't want to use arrays, because there's no need to, the IDs are constant. It's being really weird though, saying the first vehicle in the array is 540 then the last 478 ¬_¬
Reply
#4

To be able to properly predict the IDs without having to use arrays, create them before anything else (also applies for filterscripts). Then it should be less complex, otherwise I suppose you're going to need arrays (but I'm not sure since I'm missing half of the point of this).
Reply
#5

I don't have vehicles in filterscripts.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)