Destroy cars command
#10

Quote:
Originally Posted by Mастерминд
Quote:
Originally Posted by Joe Staff
IsVehicleConnected is stupid.
I didnt make that function, I copied it somewhere from useful functions..

This is more efficient than the one I posted before. It destroys all vehicles after id 348 and stops after first non-existing vehicle:
pawn Код:
new Float:x, Float:y, Float:z, carid = 348;
while(GetVehiclePos(++carid, x, y, z)) DestroyVehicle(carid);
But if theres still an existing vehicles after the non-existing vehicle, they wont get destroyed. It may only happen if some vehicle
gets destroyed and there are still vehicles with higher id than the destroyed vehicle, so you may wanna loop through all vehicles..

EDIT:
Quote:
Originally Posted by Joe Staff
just use GetVehicleModel.
..this is even more efficient than the one above
pawn Код:
new carid = 348;
while(GetVehicleModel(++carid)) DestroyVehicle(carid);
Quote:
Originally Posted by Joe Staff
And DestroyVehicle has a check in it to see if the vehicle exists or not, so you can just delete vehicle 349 to 2000 without concern.
pawn Код:
for(new carid = 348; DestroyVehicle(carid++); ) {}
Reply


Messages In This Thread
Destroy cars command - by Richie - 22.04.2010, 13:14
Re: Destroy cars command - by M4S7ERMIND - 22.04.2010, 13:31
Re: Destroy cars command - by Richie - 22.04.2010, 19:17
Re: Destroy cars command - by GTAguillaume - 22.04.2010, 19:21
Re: Destroy cars command - by Richie - 22.04.2010, 19:29
Re: Destroy cars command - by GTAguillaume - 22.04.2010, 19:47
Re: Destroy cars command - by Joe Staff - 22.04.2010, 19:48
Re: Destroy cars command - by Richie - 22.04.2010, 19:58
Re: Destroy cars command - by M4S7ERMIND - 22.04.2010, 20:49
Re: Destroy cars command - by Nero_3D - 22.04.2010, 20:58

Forum Jump:


Users browsing this thread: 1 Guest(s)