Jump to content
Sign in to follow this  
mr_shadow

action question

Recommended Posts

Hello guys,

I have playeble:

unit1, unit2 and unit 3.

There is an object on a map that have:

station1 addAction ["Take a hostage","take1.sqf",[],1,true,true,"",""];

take1.sqf:


unit1 addaction ["Test 2","takereb.sqf",[],1,true,true,"","(player distance unit1 <= 3)"];    
unit2 addaction ["Test 2","takereb.sqf",[],1,true,true,"","(player distance unit2 <= 3)"];    
unit3 addaction ["Test 2","takereb.sqf",[],1,true,true,"","(player distance unit3 <= 3)"];  

But my question is how to hide the takereb.sqf from myself if im unit1? So only unit2 will be able to press it on me.

Edited by mr_shadow

Share this post


Link to post
Share on other sites

[b]player [/b]addaction ["Test 2","takereb.sqf",[],1,true,true,"","(player distance unit1 <= 3) && (player == Unit1 && player != Unit2 && Player != Unit3)"]; 

alternatively

[b]player [/b]addaction ["Test 2","takereb.sqf",[],1,true,true,"","(player distance unit1 <= 3) && (player == Unit2 || player == Unit3)"]; 

- not tested BTW

EDIT: another alternative

[b]player [/b]addaction ["Test 2","takereb.sqf",[],1,true,true,"","(player distance unit1 <= 3) && (player != Unit1)"]; 

then repeat for the other units addaction's

Edited by KevsnoTrev

Share this post


Link to post
Share on other sites

easiest way I can think of would be like this as it will guarantee adding to all units.

again not tested, but should function.

{ player addaction ["Test2","takerb.sqf",[],`,true,true,"","(player distance _x <= 3) && (player !=_x)"] } foreach (if ismultiplayer then {playableunits} else {switchableunits});

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
Sign in to follow this  

×