Jump to content
Sign in to follow this  
Cain_

How to disable Chat (Typing)

Recommended Posts

I wish to disable the ability to type in multiplayer. Also if someone can explain what this really means.

My previous note is incorrect now, you can use disableConversation and still use the group radio, at least in A2:OA !

http://community.bistudio.com/wiki/disableConversation

does it mean you can talk through the microphone in the group channel but on no other?

Thanks

Cain

Share this post


Link to post
Share on other sites

"enableRadio false" might work. I know this disables usual radio messages along with sideChat, etc.

Share this post


Link to post
Share on other sites

Quick, dirty and untested... but might work:

(findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 in actionKeys 'Chat') then { true } else { false };"]

Share this post


Link to post
Share on other sites
"enableRadio false" might work. I know this disables usual radio messages along with sideChat, etc.
Quick, dirty and untested... but might work:

(findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 in actionKeys 'Chat') then { true } else { false };"]

Thanks alot guys will test this out!

---------- Post added at 12:51 PM ---------- Previous post was at 12:35 PM ----------

player disableConversation true;

player setVariable ["BIS_noCoreConversations", true];

player disableRadio true

player enableRadio false

player (findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 in actionKeys 'Chat') then { true } else { false };"]

player disableRadio=1;

player enableRadio=0;

Nothing works :( Could it be that i need a public variable set or something? Simply meaning it will work once i put it on a dedicated server?

Share this post


Link to post
Share on other sites

player (findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 in actionKeys 'Chat') then { true } else { false };"]

is false.

The right code line is this which Worldeater posted already:

(findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 in actionKeys 'Chat') then { true } else { false };"]

Share this post


Link to post
Share on other sites

Right. I should also mention that this code probably won't do anything on a dedicated server. It's meant to be run on the clients.

What it does is: it searches for the main display and attaches an event handler for key presses. Then every time someone hits a key the handler (that's the "if..." part) checks if it was the "chat" key. If so it simply does nothing and tells the engine to not investigate the event any further.

Share this post


Link to post
Share on other sites

Still not working. I tried to figure it out on biwiki. I tried to use AddEventHandler aswell. I tried both having init.sqs, init.sqf etc. Cant get it too work :)

Some guys maybe just aint made to be scripting in Arma! Give me matlab!

http://community.bistudio.com/wiki/displaySetEventHandler

---------- Post added at 09:00 PM ---------- Previous post was at 08:23 PM ----------

Got it working. Had to clean out my init file and just put in

sleep 1;

waitUntil {sleep 0.01; (!(isNull (findDisplay 46)))};

(findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 in actionKeys 'Chat') then { true } else { false };"]

Thanks!!!

Share this post


Link to post
Share on other sites

make sure you assign the displayevent handler after the main display is not null

waitUntil {!(isNull (findDisplay 46))};
(findDisplay 46) displayAddEventHandler ["KeyDown", "if (_this select 1 in actionKeys 'Chat') then { true } else { false };"]

edit: see you got it

Edited by nuxil

Share this post


Link to post
Share on other sites

Another problem that it might been is that I can only have 1 script in my init.sqf. I also want to remove the map at start. But if i put the remove item line before the eventhandler map will be gone but ill be able to chat. And vice versa.

Share this post


Link to post
Share on other sites

and maby this avalible realize in client-side addon?!

Share this post


Link to post
Share on other sites

Yes but a client side addon makes not much sense unless you can enforce it.

The right approach is mission integration or a server side addon.

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  

×