Blockland Forums > Modification Help
Clientsided Chat Message Interception
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 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: ---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:
}
--- End code ---
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.
Minnax:
hi
Crøwn:
--- Quote from: Minnax on January 10, 2012, 09:11:59 PM ---hi
--- End quote ---
what is wrong with you?
Brian Smithers:
--- Quote from: Minnax on January 10, 2012, 09:11:59 PM ---hi
--- End quote ---
--- Quote from: Crøwn on January 10, 2012, 09:13:10 PM ---what is wrong with you?
--- End quote ---
Superb:
--- Quote from: Brian Smithers on January 10, 2012, 09:11:26 PM ---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: ---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:
}
--- End code ---
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.
--- End quote ---
Whenever someone talks? No, it's whenever you talk.. This makes no sense..