Jump to content
mr_shadow

Player sidechat in MP mission

Recommended Posts

Hello everyone, I was wondering how should look my script about sidechat.

 

On keyHold i have a dialog, which is creating a menu like in BF, where you can communmicate by radio.

 

Question is - how should I execute a sript with  

player sidechat "Negative."; player say3d "no"

 

with the BIS function or else?

8cffac66b9c1.jpg

 

 

 

Share this post


Link to post
Share on other sites

Thing I'm trying to do:

 

 

 

 

neg.sqf (when you press on button)

[[], "negative", nil, false] spawn BIS_fnc_MP;

init.sqf

negative = compile preprocessFileLineNumbers "menuQ\negative.sqf";		

negative.sqf

_player= _this select 0 ;
_player sidechat format ["%1: Negative",name _player]

Share this post


Link to post
Share on other sites
negative.sqf
_player= _this select 0 ;
_player sidechat format ["%1: Negative",name _player]

 

This code will display as :

 

Johnny : "Johnny: Negative"

 

"Johnny" being an exemple name of the player who clicked the menu. As you can see format ["%1: Negative",name _player] will output inside the default quotes in sidechat.

 

I think you can just put this :

_player= _this select 0 ;
_player sidechat "Negative"; //player's name will output by default

And this will output like this :

 

Johnny : "Negative"

 

P-S : did you do the UI shown on the screenshot ?

Share this post


Link to post
Share on other sites

Ye, I know how it should work, the problem is - that it's not working)

 

And the problem is in that part:

_player= _this select 0 ;

And I'm not sure if all the players will see the message.

 

 

This part is just for testing, thats why it looks complicated.

_player sidechat format ["%1: Negative",name _player] 

P.S. I'm focusing on  onKeyUp  to make it close when the key was released, didn't get luck yet.

I'm using keydown and key up, so the dialog exists while player is holding button.

Share this post


Link to post
Share on other sites

You have never said ,this is abaut MP.
 

[[_player, format ["%1: Negative",name _player]], "sidechat", west, false ,false] call BIS_fnc_MP;

Share this post


Link to post
Share on other sites

Is it really necessary to put this before the code ?

_player= _this select 0 ;

Isn't this code bellow working as well ?

[player, format ["%1: Negative",player]], "sidechat", west, false ,false] call BIS_fnc_MP;

Share this post


Link to post
Share on other sites

right, so dialog will directly execute the negative.sqf?

 

and that's the code inside it:

[[player, format ["Negative"], "sidechat", west, false ,false] call BIS_fnc_MP;

The thing I wanna completely understand is - how it will work : showing the "Negative" only for the side player or showing this message for all players but in their sidechat(which means that opfor will see blufor message) ?

__________________________________________________________________________________

 

 

Same thing have to be used on the opfor side, but only if (side player == side _theguywhoseethismessage)

 

so as i thought i made this:

_player = player;
closedialog 0;
[[_player], "negative", nil, false] spawn BIS_fnc_MP;
_player= _this select 0;

if (side player == side _player) then{
player sideChat format["Unit %1 : Negative.",name _player];
};

Tell me please the correct way.

Share this post


Link to post
Share on other sites

right, so dialog will directly execute the negative.sqf?

 

and that's the code inside it:

[player, format ["Negative"], "sidechat", west, false ,false] call BIS_fnc_MP;

The thing I wanna completely understand is - how it will work : showing the "Negative" only for the side player or showing this message for all players but in their sidechat(which means that opfor will see blufor message) ?

The triggered chat text will only show to players in the same side (since it has "West" in the array which stands for Bluefor).

 

Global (to all players from all sides)

Side (just to players from your side)

Group (everyone in your group)

Vehicle(everyone in the same vehicle)

 

/******************************************************************/

 

neg.sqf (when you press on button)

[[], "negative", nil, false] spawn BIS_fnc_MP;

init.sqf

negative = compile preprocessFileLineNumbers "menuQ\negative.sqf";        

negative.sqf

...

If I understand correctly you want the file to execute when the player clicks on the icon ?

Share this post


Link to post
Share on other sites

Yes when player clicks on the button in that menu i want him to say3d and send a chat message

so can I do like this?

 

 

negative.sqf(directly from dialog.hpp no other sqf files)

[[player, format ["Negative"], "sidechat", side player, false ,false] call BIS_fnc_MP;

Share this post


Link to post
Share on other sites

I think so, you need to try it. Also the first [ needs to be deleted (there are two) :

[player, format ["Negative], "sidechat", side player, false ,false] call BIS_fnc_MP;

Share this post


Link to post
Share on other sites

No way, that doesn't work.

 

Same as

[player, format ["Negative"], "sidechat", west, false ,false] call BIS_fnc_MP;

or

[[_player, format ["%1: Negative",name _player]], "sidechat", west, false ,false] call BIS_fnc_MP;

Share this post


Link to post
Share on other sites
[player,"hello"] remoteExec ["sideChat", 0];

That should work. But there's an issue. If you call sideChat with the player as parameter, player unit will be different for each client. (Not tested, but in theory).

  • Like 1

Share this post


Link to post
Share on other sites
On 09/01/2016 at 5:01 PM, R3vo said:

[player,"hello"] remoteExec ["sideChat", 0];

That should work. But there's an issue. If you call sideChat with the player as parameter, player unit will be different for each client. (Not tested, but in theory).

This saved my day.

Share this post


Link to post
Share on other sites
On 09/01/2016 at 8:01 PM, R3vo said:

[player,"hello"] remoteExec ["sideChat", 0];

player unit will be different for each client

no, it won't

Share this post


Link to post
Share on other sites

can confirm this works fine in MP.

If you want "Broadway" say something in sidechat with format:

_msgx = format ["var1: %1  | var2: %2", _var1, _var2];
[[west,'BLU'], _msgx] remoteexec ["sidechat"];

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

×