Jump to content
redburn

setCaptive true only determinated player x

Recommended Posts

Hello guys,


written this:,

{
    _x addEventHandler ["Fired", 
    {
     
		if(side player == west) then {
			a1 setCaptive false;
		}

		else {
			a2 setCaptive false;
		}

    }];
 
} foreach allUnits;

does nothing
because I do not want all players to go from false to true when activating the event.
How can I make a player pass to true, but not to others?

Share this post


Link to post
Share on other sites

You should read the biki description and apply your code on the parameters.

I'd rather use firedMan... on players instead of allUnits (if I'm right with your aim).

 

Share this post


Link to post
Share on other sites
37 minutes ago, pierremgi said:

You should read the biki description and apply your code on the parameters.

I'd rather use firedMan... on players instead of allUnits (if I'm right with your aim).

 

 

yes, but in this case, what I would like to do is: make two groups of players, one of the groups shoots out of the enemies, the event is activated, but only to that group in particular, without the other group of players being affected and that's what I do not know how to do it.

Share this post


Link to post
Share on other sites

In initPlayerLocal.sqf (add it in your mission folder if not yet present)

 

if (group player == whateverGroup) then {

Player addEventHandler ["FiredMan", {

  params ["_unit"];

 _unit setCaptive false;

  }];

};

 

I'm not sure to understand the difficulty or.. what you want exactly.

Share this post


Link to post
Share on other sites
4 minutes ago, pierremgi said:

In initPlayerLocal.sqf (add it in your mission folder if not yet present)

 

if (group player == whateverGroup) then {

Player addEventHandler ["FiredMan", {

  params ["_unit"];

 _unit setCaptive false;

  }];

};

 

I'm not sure to understand the difficulty or.. what you want exactly.

 

Well, look, I'm doing a mission where there will be two groups of players,

Put it this way, one team of players will be group A1 and another team of players will be group A2, one of the two groups (who do not know which group they want to be) will go undercover to one base, while the other group will also go to another. What I do not want is that if the group of players A1 open fire against some enemy, that the group A2 does not receive fire from the enemy for that, if it did not open fire.

 

 

Thanks man, I'll be testing and then I'll tell you!

Share this post


Link to post
Share on other sites

Understood!

 

in initPlayerLocal.sqf

 

Player addEventHandler ["FiredMan", {

  params ["_badass"];

  {[_x,false] remoteExec ["setCaptive",_x]} forEach units _badass;

  }];

 

Share this post


Link to post
Share on other sites
3 minutes ago, pierremgi said:

Understood!

 

in initPlayerLocal.sqf

 

Player addEventHandler ["FiredMan", {

  params ["_badass"];

  {[_x,false] remoteExec ["setCaptive",_x]} forEach units _badass;

  }];

 

 

Thank you! I'll be testing it and then I'll tell you!

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

×