AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Blocking a message (https://forums.alliedmods.net/showthread.php?t=25880)

capndurk 03-22-2006 16:33

Blocking a message
 
I'm trying to block the "<user> has attacked a teammate" message, and I've tried everything I could think of, which is pretty much only one thing at all.

This:
Code:
set_msg_block(get_user_msgid("Damage"), BLOCK_ONCE)
And this:
Code:
set_msg_block(get_user_msgid("Damage"), BLOCK_SET)

I really just guessed that it was the Damage message that reported the team attacks. I suspect that it might have something to do with register_event(), though, but I can't figure out what.

Does anyone know?

Greenberet 03-22-2006 17:07

Code:
register_event( "Damage", "msgDamage" ); //... public msgDamage( ) {          return PLUGIN_HANDLED; // now the msg will be blocked forever XD }

v3x 03-22-2006 17:32

I don't think that'd work because the message is sent before you can block it, I believe.

Here's what I did for my Grenade Sack plugin:
Code:
register_message(get_user_msgid("TextMsg") , "block_message");
then
Code:
public block_message() {     if(get_msg_argtype(2) == ARG_STRING) {          new value[64];          get_msg_arg_string(2 , value , 63);          if(equali(value , "#Cannot_Carry_Anymore")) {              return PLUGIN_HANDLED;          }     }     return PLUGIN_CONTINUE; }

VEN 03-23-2006 11:14

Yes, just replace #Cannot_Carry_Anymore with #Game_teammate_attack and i believe that would work.

capndurk 03-23-2006 12:31

Quote:

Originally Posted by VEN
Yes, just replace #Cannot_Carry_Anymore with #Game_teammate_attack and i believe that would work.

I'll try that VEN... Nothing else seems to be working ;)

capndurk 03-23-2006 16:17

Thanks for the help, VEN and v3x, it worked. Just curious... how did you guys find that information out?

v3x 03-23-2006 18:31

Through this handy little tool: http://forums.alliedmods.net/showthread.php?p=65983

capndurk 03-23-2006 18:34

Quote:

Originally Posted by v3x

Thanks :)


All times are GMT -4. The time now is 16:37.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.