Jump to content
fin_soldier

Directly target a command to a specific player

Recommended Posts

For example, how would I go about targeting a cutText to the _caller of an addAction so it's visible only to the _caller,

or wanting to kill the player who walked into a trigger.

 

Thanks in advance! 🙂

Share this post


Link to post
Share on other sites

It`s always different, I guess.

correct me if there are better options.

 

trigger:

(thisList select 0) setDamage 1

 

talking about the addAction. I don't think it's necessary to remoteExec it, as the code is executed locally.

But anyway, if you want to do it with something else:

 

//description.ext
class CfgFunctions {
  class JF {
    class Scripts {
      class cutText {file = "cutText.sqf"};
    };
  };
};
//cutText.sqf
params ["_text"];

cutText [format ["<t color='#ff0000' size='5'>%1</t><br/>***********", _text], "PLAIN", -1, true, true];
//objects init
this addAction 
[ 
 "cutText", 
 { 
  params ["_target", "_caller", "_actionId", "_arguments"]; 
  [name _caller] remoteExec ["JF_fnc_cutText", _caller];  
 }, 
 nil, 
 1.5, 
 true, 
 true, 
 "", 
 "true", 
 5, 
 false, 
 "", 
 "" 
];

 

  • Thanks 1
  • Confused 1

Share this post


Link to post
Share on other sites

addAction

This command is EL. That means the action (code) will run on the caller's PC only. There is no need the remoteExec on the caller only!

cutText is EL, so it's already perfect for displaying on the caller's PC.

 

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
2 hours ago, pierremgi said:

There is no need the remoteExec on the caller only

That's what I tried to say. I just wanted to give him an example on how to set up a remote execution. 

 

For example the caller could remoteExec a text on a other players pc. 

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

×