Jump to content
dernikkl1

Eject all players in my Helicopter but me

Recommended Posts

Hello,

how do I eject all players from my vehicle (Helicopter) but me, just like in King of the Hill.
I know that

player action ["getOut", vehicle player;

ejects me. But I want it in a forEach loop or something else (depends on what is better) that eject all players but me from the Vehicle. What do I have to put in my forEach loop?


Greetings.

Share this post


Link to post
Share on other sites

@dernikkl1, try this:

{ _x action ["GetOut", _vehicle]; } forEach ((crew _vehicle) - [player]);

 

Share this post


Link to post
Share on other sites
yourHelo  addEventHandler ["GetIn", {
  params ["_veh", "_role", "_unit", "_turret"];
  if (objectParent player == _veh && isPlayer _unit && _unit != player) then {
    moveOut _unit;
  };
}];

 

Share this post


Link to post
Share on other sites
On 5/16/2021 at 2:04 PM, Schatten said:

@dernikkl1, try this:


{ _x action ["GetOut", _vehicle]; } forEach ((crew _vehicle) - [player]);

 

Thanks it worked.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×