Jump to content
Spaxxow

How to replace player in multiplayer.

Recommended Posts

Following is in the activation part of the Radio Juliet Trigger named Code 99

driver vehicle player sideChat "Code 99";

which in turn shows 

GroupCallsign (PlayerName): Code 99

In the chat.

In addition is an audio file being played which is unrelated to the problem.

So what is supposed to happen is a player presses 0>0>0 and it says in the chat Code 99 and all other players will go to that units location.

But as you can guess it displays in everyones' chat their own callsign. Which causes mass confusion. 

 

How do you replace Player in multiplayer so it returns the activating players name to all other machines.

Share this post


Link to post
Share on other sites
27 minutes ago, Spaxxow said:

Following is in the activation part of the Radio Juliet Trigger named Code 99


driver vehicle player sideChat "Code 99";

which in turn shows 


GroupCallsign (PlayerName): Code 99

In the chat.

In addition is an audio file being played which is unrelated to the problem.

So what is supposed to happen is a player presses 0>0>0 and it says in the chat Code 99 and all other players will go to that units location.

But as you can guess it displays in everyones' chat their own callsign. Which causes mass confusion. 

 

How do you replace Player in multiplayer so it returns the activating players name to all other machines.

 

You can't replace "player", since it's local to everyones machine and therefor different on every client.

What you can do is to broadcast a command from one client to anyone else, something like this will work:

 

[player,"Code 99"] remoteExec ["sideChat",0];

 

Cheers

Share this post


Link to post
Share on other sites

Thank you for the hasty reply. I tested this alone and it appears to do the same thing so that means it is most likely to be working properly. I will test it later with some more people but other than that I believe this is resolved. Thank you for your help.

Share this post


Link to post
Share on other sites

No, radio trigger are specific. if edited, you can't grab the player who activated it (thislist isn't working, local neither);

The only solution is to script it and make it local, on each PC (like in initPlayerLocal.sqf):

 

_localTrigger = createTrigger ["emptyDetector", position player, false]; // false means local, position player or anywhere else for the trigger

_localTrigger setTriggerActivation ["JULIET", "PRESENT", true]; // true means repeatable, present is useless

_localTrigger setTriggerStatements ["this", "'respawn_west' setMarkerPos (getpos player)", ""];  // example to move an existing marker named "respawn_west" to the actual caller's position.

then you can remoteExec your code as GOM wrote.

 

Note: for "Effect local" trigger see syntax.

 

 

Share this post


Link to post
Share on other sites

Thank you so much for these. I intend to use them but how do you apply the chat part too it

 

21 minutes ago, pierremgi said:

No, radio trigger are specific. if edited, you can't grab the player who activated it (thislist isn't working);

The only solution is to script it and make it local, on each PC (like in initPlayerLocal.sqf):

 

_localTrigger = createTrigger ["emptyDetector", position player, false]; // false means local, position player or anywhere else for the trigger

_localTrigger setTriggerActivation ["JULIET", "PRESENT", true]; // true means repeatable, present is useless

_localTrigger setTriggerStatements ["this", "'respawn_west' setMarkerPos (getpos player)", ""];  // example to move an existing marker named "respawn_west" to the actual caller's position.

 

 

And how is a create task module connected to the marker?

Share this post


Link to post
Share on other sites

see setTriggerStatements where on act / deact codes are. Here deactivation doesn't have sense, so " " .

Theses codes are inside quotes " ", so you need to pay attention for the embedded strings like this: " code with 'string' " :

for example:

_localTrigger setTriggerStatements ["this", "

  [player, 'Code 99' ] remoteExec ["sideChat",0];

  < create your task here with bis_fnc_setTask >

 ", ""];

 

 

Share this post


Link to post
Share on other sites
_localTrigger = createTrigger ["emptyDetector", position player, false];
_localTrigger setTriggerActivation ["JULIET", "PRESENT", true];
_localTrigger setTriggerStatements ["this", "'respawn_west' setMarkerPos (getpos player)", ""];

_localTrigger = createTrigger ["emptyDetector", position player, false];
_localTrigger setTriggerActivation ["INDIA", "PRESENT", true];
_localTrigger setTriggerStatements ["this", " [player, 'Code 99' ] remoteExec ["sideChat",0]; 

I tried multiple variations of this and i cannot manage to get it to work. I put it in the initplayer.sqf 

The respawn marker mover works but i cannot get the Code 99 to work. What am I doing wrong?

Share this post


Link to post
Share on other sites

@spaxxow

 

just a quick glance but this line is missing a closing bracket and you only have one " before  [player, 'code 99']

 

_localTrigger setTriggerStatements ["this", " [player, 'Code 99' ] remoteExec ["sideChat",0]; 

not sure but maybe try

Quote

_localTrigger setTriggerStatements ["this", " [player, 'Code 99' ] remoteExec ["sideChat",0]" , "" ];

 

Share this post


Link to post
Share on other sites
_localTrigger setTriggerStatements ["this", "[player, 'Code 99' ] remoteExec ['sideChat',0]", "" ];

 

Share this post


Link to post
Share on other sites
13 minutes ago, nomadd said:

@spaxxow

 

just a quick glance but this line is missing a closing bracket and you only have one " before  [player, 'code 99']

 


_localTrigger setTriggerStatements ["this", " [player, 'Code 99' ] remoteExec ["sideChat",0]; 

not sure but maybe try

 

Thanks for your help but i still got nothing

6 minutes ago, Larrow said:

_localTrigger setTriggerStatements ["this", "[player, 'Code 99' ] remoteExec ['sideChat',0]", "" ];

 

Thank you this actually made it work.

Share this post


Link to post
Share on other sites

 

Thanks Larrow

I completely missed the "sidechat"  quotes

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

×