Raised This Month: $ Target: $400
 0% 

Blocking a message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
capndurk
Senior Member
Join Date: Feb 2006
Old 03-22-2006 , 16:33   Blocking a message
Reply With Quote #1

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?
capndurk is offline
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 03-22-2006 , 17:07  
Reply With Quote #2

Code:
register_event( "Damage", "msgDamage" ); //... public msgDamage( ) {          return PLUGIN_HANDLED; // now the msg will be blocked forever XD }
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-22-2006 , 17:32  
Reply With Quote #3

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; }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 03-23-2006 , 11:14  
Reply With Quote #4

Yes, just replace #Cannot_Carry_Anymore with #Game_teammate_attack and i believe that would work.
VEN is offline
capndurk
Senior Member
Join Date: Feb 2006
Old 03-23-2006 , 12:31  
Reply With Quote #5

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 is offline
capndurk
Senior Member
Join Date: Feb 2006
Old 03-23-2006 , 16:17  
Reply With Quote #6

Thanks for the help, VEN and v3x, it worked. Just curious... how did you guys find that information out?
capndurk is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-23-2006 , 18:31  
Reply With Quote #7

Through this handy little tool: http://forums.alliedmods.net/showthread.php?p=65983
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
capndurk
Senior Member
Join Date: Feb 2006
Old 03-23-2006 , 18:34  
Reply With Quote #8

Quote:
Originally Posted by v3x
Thanks
capndurk is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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