SA-MP Forums Archive
how to delete every vehicle that isnt in the ongamemodeinit, and when nobody is driving it - 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: how to delete every vehicle that isnt in the ongamemodeinit, and when nobody is driving it (/showthread.php?tid=397980)



how to delete every vehicle that isnt in the ongamemodeinit, and when nobody is driving it - niels44 - 07.12.2012

hey everyone,

i already checked ****** for this abit and samp forum, but couldnt really find one for my problem.

how can i make it that when doing /deleteallvehs or /deleteallcars, it will delete EVERY SINGLE car that isnt loaded in Ongamemodeinit and when NOBODY is driving it, meaning its just a car that is once spawned by someone and then left behind, also is this possible in a timer, which works every 30 mins or 60 mins?

greets niels


Re: how to delete every vehicle that isnt in the ongamemodeinit, and when nobody is driving it - BleverCastard - 07.12.2012

Well.. When the player/admin spawns the car, make a variable such as admcar = blah and it spawns then when you /despawnvehs, it detects if it's a admcar and if it is it deletes it.


Re: how to delete every vehicle that isnt in the ongamemodeinit, and when nobody is driving it - niels44 - 07.12.2012

ye but, when i use /car infernus, and it spawns it, then admcar is that car, but then when someone else does. that one is too, but when someone is driving it, then it will also delete right?


Re: how to delete every vehicle that isnt in the ongamemodeinit, and when nobody is driving it - BleverCastard - 07.12.2012

Yes but you need to alter the code so it's like if player state is driver then return 0; else continue to code.


Re: how to delete every vehicle that isnt in the ongamemodeinit, and when nobody is driving it - niels44 - 08.12.2012

hmm i still dont really understand you...


Re: how to delete every vehicle that isnt in the ongamemodeinit, and when nobody is driving it - Windrush - 08.12.2012

pawn Код:
for(new v=0;v<MAX_VEHICLES;v++) if(!IsVehicleOccupied(v)) EraseVeh(v);



Re: how to delete every vehicle that isnt in the ongamemodeinit, and when nobody is driving it - niels44 - 08.12.2012

this aint working, all it does it removing me from my vehicle, nothing more