SA-MP Forums Archive
Destroy the vehicle on spawn of a new one? - 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: Destroy the vehicle on spawn of a new one? (/showthread.php?tid=98289)



Destroy the vehicle on spawn of a new one? - [mad]MLK - 20.09.2009

When you spawn a vehicle how would i make it destroy the old one because this looks alittle complex

http://mlk.pastebin.com/m718a53d5


Re: Destroy the vehicle on spawn of a new one? - lavamike - 20.09.2009

Quote:
Originally Posted by [mad
MLK (dino-host.com) ]
When you spawn a vehicle how would i make it destroy the old one because this looks alittle complex

http://mlk.pastebin.com/m718a53d5
If I read that right, all you have to do is at the top of the script do this:
pawn Code:
new SpawnedCar[MAX_PLAYERS];
Then when you make a new car do:
pawn Code:
SpawnedCar[playerid] = CreateVehicle(...);
Now the vehicle's ID should be stored there so you can do:
pawn Code:
DestoryVehicle(SpawnedCar[playerid]);



Re: Destroy the vehicle on spawn of a new one? - madman227 - 20.09.2009

Credits to donny for this script he made it i just added destroy system and /car /call commands
ps. Donny if you don't approve i will delete this post..

[REL] vDialog - Vehicle spawning dialog - 0.1c with vehicle destroy system
Pastbin
http://pastebin.com/fd584725


Re: Destroy the vehicle on spawn of a new one? - FrostBytez - 12.10.2009

It's for 0.3


Re: Destroy the vehicle on spawn of a new one? - Donny_k - 12.10.2009

Quote:
Originally Posted by {MadMan}
Credits to donny for this script he made it i just added destroy system and /car /call commands
ps. Donny if you don't approve i will delete this post..

[REL] vDialog - Vehicle spawning dialog - 0.1c with vehicle destroy system
Pastbin
http://pastebin.com/fd584725
No that's fine dude, it's open source for a reason.

Anyway maybe you guys want to check out the thread again as it's version 0.2a now and that script there is from 0.1c so it's four versions behind.

Quote:

In 0.1d I've included a compile option for spawn messages and fixed some key issues (thanks ******, I've not read that key page before).
In 0.1e I've rewritten most of the script, optimised it so it's easier to read, added a compile option to ignore virtual worlds and now the vehicles are linked to the players interior when spawned.
In 0.1f I've added a few more compile options/configs, added vehicle activation for the dialog with a compile option and an extra spawn message, the vehicle is now created directly at your position also and the angle is fixed (no longer + 90).
In 0.2a I've removed key activation and made it command activated only (/vdialog), vehicles now have a default 'respawn_delay' of ten minutes instead of around 18 hours (lmao, my bad!!) and vehicles which are created by the dialog (only the dialog) will by default be destroyed when they respawn (requested) but there is a compile option to control this.