29.04.2012, 14:49
I'm not sure if this is the most efficient way of doing it, but I think when you use CreateVehicle, it assigns the highest vehicle id.
It also might not work if you have the 2k cars in your script.
pawn Код:
for(new i=0; i<MAX_VEHICLES; i++) // Loop through all the cars.
{
// The first invalid vehicle ID is obviously one that hasn't been made yet.
if(i == INVALID_VEHICLE_ID)
{
i = CreateVehicle(blahblah); break; // so it breaks out of the loop at the highest vehicle.
}
}
PutPlayerInVehicle(playerid, i, 0);