OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: stephen271276 on 21 Feb 2011, 16:55:08

Title: Player force eject?
Post by: stephen271276 on 21 Feb 2011, 16:55:08
Hi How can I force eject a player in a WP from the vehicle he is driving???
Title: Re: Player force eject?
Post by: F2kSel on 21 Feb 2011, 17:35:15
Code: [Select]
player action["eject",car]
Code: [Select]
player action["getout",car]
take your pick.

car being the name of the vehicle.
Title: Re: Player force eject?
Post by: stephen271276 on 21 Feb 2011, 19:04:34
Thankyou
Title: Re: Player force eject?
Post by: Zipper5 on 22 Feb 2011, 20:42:07
If the player is a subordinate in a squad, or if you plan to use this with AI units as well, be sure to also use the following:
Code: [Select]
unassignVehicle unit;Obviously, replace unit with the name of the unit you have ejecting. This will stop the AI squad leader from telling the player to reembark the vehicle once they've ejected, and will prevent AI units in general from automatically reembarking the vehicle anyway.