Jump to content
Sign in to follow this  
Dariox

A question about systemChat

Recommended Posts

Inside a script I have this code, so as I wrote all player in the game will display the message?

_messaggio = {
if ( isPlayer _killer && isPlayer _unit ) then {systemchat format ["%1 was injured by %2",  name (_unit), name (_killer)];
};
};
publicVariable "_messaggio";

thx

Dario

Share this post


Link to post
Share on other sites

Ah, unfortunately that will not work. publicVariable is used to broadcast the value of a variable to all machines (it also only works with global variables), but it doesn't run code. If you wish to display the message on all machines then take a look at BIS_fnc_MP.

You would use it like so:

if ( isPlayer _killer && isPlayer _unit ) then {
   [format ["%1 was injured by %2",  name (_unit), name (_killer)],"systemchat"] call BIS_fnc_MP;
};

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  

×