SA-MP Forums Archive
[Question] Crating And Destroying Cars And Objects. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Question] Crating And Destroying Cars And Objects. (/showthread.php?tid=184121)



[Question] Crating And Destroying Cars And Objects. - Alex_Valde - 18.10.2010

I made a command, and when I enter this command player should be teleported to a certain place.
When he arives there should be cars what admin created with this command...

And when admin types eg. /quitrace i want to destroy all the cars and objects

i tryed with RaceCars = AddStat........

and then DestroyVehicle....but doesn't work....

Do you have any suggestions how to do that?


Re: [Question] Crating And Destroying Cars And Objects. - Mauzen - 18.10.2010

To create vehicles ingame, you have to use CreateVehicle. To remove them later on, you have to store their ids, as you already tried.
pawn Код:
racecar1 = CreateVehicle...
racecar2 = CreateVehicle...

//or with an array
new racecar[max_cars];
racecar[0] = ...
racecar[1] = ...
Then in /quitrace use DestroyVehicle with the stored ids.