Author Topic: Blow Up Vehicle  (Read 573 times)

What code do I use to destroy a vehicle that a player is driving?
« Last Edit: April 18, 2010, 11:11:02 PM by Deathwishez »

%vehicle.finalexplosion(); - Skips the first explosion and instantly destroys the vehicle
%vehicle.setDamageLevel(0); - Destroys the vehicle normally, mounted players will still be riding the wreckage

Thanks.

Also, what do I use to check if the player is in a vehicle, and what function can I use for when the player gets in a vehicle?

what do I use to check if the player is in a vehicle
isObject(%player.getObjectMount())
what function can I use for when the player gets in a vehicle?
armor::onMount(%data, %obj, %mount, %slot)

For %player.getObj..., would I use %player = %client.player prior?

Ah yes, I also need an parent::onVehicleDamage kinda thingy.
« Last Edit: April 18, 2010, 11:23:36 PM by Deathwishez »

Ok, you obviously have a lot of questions about vehicles, so I recommend you do this:
Start a single player server and spawn a jeep. Point at it and enter /getid. Take the object ID number you receive and enter it into the console followed by .dump();. This will give you a list of all variables and functions attached to the object.


Ok, you obviously have a lot of questions about vehicles, so I recommend you do this:
Start a single player server and spawn a jeep. Point at it and enter /getid. Take the object ID number you receive and enter it into the console followed by .dump();. This will give you a list of all variables and functions attached to the object.

Now way! Thanks. This will probably answer 80% of my questions.