Author Topic: Clientsided Chat Message Interception  (Read 1058 times)

Well, looks like quite a few people wanted this. So I wrote up a quick resource that basically calls a blank function when someone chat messages you talk. And stops the chat message.

If you use this in any mod as a resource or anything let alone - please give me credit. Thanks. Please don't mind the large amount of comment spam. I got bored while typing this up.

Code: [Select]
package IGSOMsg
{
function NMH_Type::send(%this)
{
if(NMH_Type.getValue() $= "What you are looking for")
{
commandToServer('stopTalking');
canvas.popdialog(newMessageHud);
NMH_Type.setValue("");
playerHasTalked(NMH_Type.getValue());
}
else
{
Parent::Send(%this);
}
}
};
ActivatePackage(IGSOMsg);

function playerHasTalked(%chat)
{
//holy
//loving
//stuff
//Noway C:    
}

So basicly it stops the player from talking when you message anything that is equivalent to whatever it says in that little if box.
Could be used for some mods idk what, most likely you can make a spellcheck mod. Or something of the such, but thats for you to figure out not me.
« Last Edit: January 10, 2012, 09:18:19 PM by Brian Smithers »




Well, looks like quite a few people wanted this. So I wrote up a quick resource that basically calls a blank function when someone chat messages. And stops the chat message.

If you use this in any mod as a resource or anything let alone - please give me credit. Thanks. Please don't mind the large amount of comment spam. I got bored while typing this up.

Code: [Select]
package IGSOMsg
{
function NMH_Type::send(%this)
{
if(NMH_Type.getValue() $= "What you are looking for")
{
commandToServer('stopTalking');
canvas.popdialog(newMessageHud);
NMH_Type.setValue("");
playerHasTalked(NMH_Type.getValue());
}
else
{
Parent::Send(%this);
}
}
};
ActivatePackage(IGSOMsg);

function playerHasTalked(%chat)
{
//holy
//loving
//stuff
//Noway C:    
}

So basicly it stops the player from talking when you message anything that is equivalent to whatever it says in that little if box.
Could be used for some mods idk what, most likely you can make a spellcheck mod. Or something of the such, but thats for you to figure out not me.


Whenever someone talks? No, it's whenever you talk.. This makes no sense..

Whenever someone talks? No, it's whenever you talk.. This makes no sense..
Fixed lol.

what is wrong with you?
oh im sorry, let me take a different approach

hello

This still has virtually no use, and I don't know anybody who has requested this...

On another note, we need an official resource thread to be stickied.

This still has virtually no use, and I don't know anybody who has requested this...

On another note, we need an official resource thread to be stickied.
this can be the start of a simple auto grammar mod.