Author Topic: Unmount  (Read 1593 times)

How do I do something when a player un mounts a vehicle?

I think the best way to do this would be to package the Armor::onUnMount(%this,%player,%obj,%a,%b,%c,%d,%e,%f).
This function gets triggered when an Armor  (%player) unmounts of a vehicle (%obj).
If you want something to happen when the player unmounts a specific vehicle, be sure to check the ID of the vehicle with the id of the datablock of the vehicle (%obj.getDataBlock().getId() == dataBlockName.getId()).

Don't forget to parent when you package an already existing function!

I'm not sure how relevant this is to you but that function will also be called when a player unmounts any kind of object, such as another player. You may want to add a check if you want it to relate specifically to vehicles.

Or if what you wanted to happen was specific to a single vehicle you could package yourVehicle::onUnmount

Or if what you wanted to happen was specific to a single vehicle you could package yourVehicle::onUnmount
onUnMount is called:
when the object(/player) unmounts any kind of object
So i am pretty sure this won't work...

onUnMount is called:So i am pretty sure this won't work...
When it's written specific to a datablock it's only called when that datablock is involved. Whether or not it'll call it when something unmounts from that or if it'll call it when it unmounts from something I'm not positive of.

I'm reasonably sure my method will work properly, provided that what he's doing is vehicle specific. Otherwise just package the main armor function and do some checks to be absolutely certain that what you have is a vehicle and not something else

I wasn't sure about it, but most of the things involving unmounting a specific vehicle go via the packaged onUnMount function. :P