Jump to content

Recommended Posts

I cannot believe I need to create a new topic for this one buuuuut   .............

 

So I got an mp mission at the works and at some point the players are to get in a chopper and extract. What I need is a way to add an action to the extraction helicopter. An action that will work in mp and that will only be available to people that are in the extraction helicopter.

 

Not knowing if it will work in mp I have found this:

 

this addAction ["Go Go Go","extraction.sqf",[this],0,false,true,""," driver _target == _this"];

but still this adds an action to the driver and not to the passengers. The players will be in passenger slots while the driver will be AI cotrolled so HEEEELP!!

 

And not to forget, I have tried this but it has failed to work:

 

this addAction ["Go Go Go","extraction.sqf",[this],0,false,true,""," passenger _target == _this"];

 

Share this post


Link to post
Share on other sites

passenger isn't a valid command. I recommend you script this for the player, or add a event handler for "GetIn" and then add the command in the execution.

Then just pass in the player variable to the action and then do (driver _target) == player))

Share this post


Link to post
Share on other sites

Thanks but ehhhh that would be way to complicated for me :dontgetit:

Isn't there anything simpler?

I mean there is a way for the action only to be available for the driver. Isn't there a way to make the action available for the passengers or even for every member on board the chopper?

For mp of course

Share this post


Link to post
Share on other sites

this will give addaction to all seats of any aircraft

 make a repetable trigger with condition: 

vehicle player isKindOf "Air"

and your code in activation field, i use it for an emergensy eject: 

ejectinit = player addAction ["<t color='#f80106'>EMERGENCY EJECT</t>", "Para\eject.sqf",[],9]; 

 

 

to remove it on exit make another repetable trigger with condition: 

vehicle player isKindOf "Land"

in my activation field:

player removeaction ejectinit;

 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks! It works!! but there is a problem...

When I activate the "Go Go Go" action the player stays in the helicopters but stands up. He is no longer seated and his head is out of the chopper. How can I fix that one???

 

Scratch that. I fixed it myself. It was a forgotten played animation :)

Thaaaaaaanks

Share this post


Link to post
Share on other sites

Not sure if it's me, but it looks like you are making it way too confusing/complicated.

Why not use the condition parameter in the addiction.

 

Let me quote it from the addaction wiki page:

Quote

condition (Optional): String - script code that must return true for the action to be shown. Special variables passed to the script code are _target (object to which action is attached to) and _this (caller/executing person). Default value: "true"

 

in there refer to a script that contains:

_a = false;
_veh = vehicle player;


if (_veh isKindOf "Air") then {
  if (!driver _veh == player) then { _a = true; };
};


_a;

 

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

×