SA-MP Forums Archive
Vehicle Check? - 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: Vehicle Check? (/showthread.php?tid=316741)



Vehicle Check? - ixesas - 08.02.2012

Hi, I want to ask you to make a vehicle check. I mean: Every 1min, server automatically destroy all empty vehicles (vehicles without drivers and passengers).

I try to create it, but I could not :S


Re: Vehicle Check? - Vince - 08.02.2012

You could set the respawn time for the vehicles in AddStaticVehicleEx/CreateVehicle to 60 seconds. Then at OnVehicleSpawn you destroy the vehicle. Since OnVehicleSpawn is only ever called when a vehicle re-spawns, this shouldn't be a problem.


Re: Vehicle Check? - ixesas - 08.02.2012

Quote:
Originally Posted by Vince
Посмотреть сообщение
You could set the respawn time for the vehicles in AddStaticVehicleEx/CreateVehicle to 60 seconds. Then at OnVehicleSpawn you destroy the vehicle. Since OnVehicleSpawn is only ever called when a vehicle re-spawns, this shouldn't be a problem.
I didn't add vehicles. I have /Car script, which made vehicles.


Re: Vehicle Check? - Face9000 - 08.02.2012

//Delete this,sorry.


Re: Vehicle Check? - Vince - 08.02.2012

Like I said, set the respawn_delay in CreateVehicle to 60 seconds ...
native CreateVehicle(vehicletype, Float:x, Float:y, Float:z, Float:rotation, color1, color2, respawn_delay);