Author Topic: Request - On{Insert input here}>ToggleChat>{Variables/option menu} Event  (Read 1110 times)

/title.

Make sense? I want an event to toggle chat when, for example, OnTouch>ToggleChat>NAMEDBRICK that turns off the chat only when touching it.
Reason being is for chat-based description events, chat can be a little interrupting.


I'm not getting what you are trying to say.

you can't turn off the chat anyway
the closest you can get is setting the messages to show for 0ms and I'm pretty sure you can't change that with an event

the closest you can get is setting the messages to show for 0ms and I'm pretty sure you can't change that with an event
Yeah it's client sided. I've seen servers with muting the server. Take my mod for example you can mute players. All you need is to make an event call a loop to mute all players and maybe exclude admins. Then call a loop to unmute players etc etc.

Yeah it's client sided. I've seen servers with muting the server. Take my mod for example you can mute players. All you need is to make an event call a loop to mute all players and maybe exclude admins. Then call a loop to unmute players etc etc.
Mute everyone every time somebody wants to read a description? That doesn't sound like a good solution.

Only way I can think of doing this is overwriting serverCmdMessageSent and only sending the chat to clients if their chat is not being muted by a brick. But that's a terrible way as it will break other mods.

If what you are trying to do is prevent messages going to multiple clients at once, couldn't you do something like this?
Code: [Select]
package chatMod
{
function serverCmdMessageSent(%client, %message)
{
//Spam prevention stuff here, also e-tard filter

//Messaging system
%tags = "\c7%2\c3%1\c7%3\c6: ";
for(%i = 0;%i < clientGroup.getCount();%i++)
{
%messagingClient = clientGroup.getObject(%i);
if(%messagingClient.noMessages)
continue;

messageClient(%messagingClient, '', %tags @ %message, %client.getPlayerName(), %client.clanPrefix, %client.clanSuffix);
}
}
};
activatePackage("chatMod");
Of course, I didn't test this.
But its just an example, loop through all the clients, and if they aren't receiving messages, don't message them.

Of course a post was posted while I was typing this up, and it suggested the same thing I did.
Only way I can think of doing this is overwriting serverCmdMessageSent and only sending the chat to clients if their chat is not being muted by a brick. But that's a terrible way as it will break other mods.

Only works as a client script.

Also, welcome back.  Long time no see.

Thanks SWAT.

Now, I thought it might be hard to interpret, though Starzy got pretty close. Also sounds plausible.
All you need is to make an event call a loop to mute all players and maybe exclude admins. Then call a loop to unmute players etc etc.

Thanks SWAT.

Now, I thought it might be hard to interpret, though Starzy got pretty close. Also sounds plausible.
SWAT is wrong. Although there is no good way to do it server sided. It's possible. It will just break some other mods(like Slayer's chat features).


no.
I only written it up as an example, of course its a bad code, I even stated its an example in the post.
If I were to really attempt making the code it wouldn't look like that.