Destroying empty cars - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Destroying empty cars (
/showthread.php?tid=320559)
Destroying empty cars -
mitchboy - 23.02.2012
Hi,
I am making a sumo server atm, and it is now working fine but when it loads a new map, it spawns some vehicles from the previous round, i need a script that automaticly destroys the cars without a driver.
Could you guys help me? I realy need it.
Re: Destroying empty cars -
mitchboy - 23.02.2012
Please help me, i need this.
Re: Destroying empty cars -
N0FeaR - 24.02.2012
Use this
https://sampforum.blast.hk/showthread.php?tid=187229
Re: Destroying empty cars -
DeathTone - 24.02.2012
Quote:
Originally Posted by N0FeaR
|
That's not helpful
Anyways, you could loop through all the cars, check if they have a player in them, and destroy all the empty ones
Re: Destroying empty cars -
ArmyOps - 24.02.2012
not sure it helps u out, or maybe u have already tryed that, but inject driver and then destroy?
Re: Destroying empty cars -
lorigio - 24.02.2012
pawn Код:
for (new i = 0; i < MAX_VEHICLES; i++)
{
new found = 0;
for (new a = 0; a < MAX_PLAYERS; a++)
{
if (GetPlayerVehicleID(a) == i)
{
found = 1;
break;
}
}
if (!found)
{
DestroyVehicle(i);
}
}
Re: Destroying empty cars -
mitchboy - 24.02.2012
Thnx, it helped me

.