AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   SayText hook (https://forums.alliedmods.net/showthread.php?t=26535)

GHW_Chronic 04-04-2006 04:14

SayText hook
 
ok, I finished writing this and i just noticed that I'm pretty sure that register_event doesn't get called if you block the event.

Code:
public plugin_init() {     set_msg_block(get_user_msgid("SayText"),BLOCK_SET)     register_event("SayText","event_SayText","a") } public event_SayText() {     if(get_msg_block(get_user_msgid("SayText"))==BLOCK_NOT)     {         set_msg_block(get_user_msgid("SayText"),BLOCK_SET)     }     new said[200]     read_data(4,said,199)     if(containi(said,"changed name to")!=-1)     {         new string1[200], string2[200], string3[200]         read_data(2,string1,199)         read_data(3,string2,199)         read_data(4,string3,199)         set_msg_block(get_user_msgid("SayText"),BLOCK_NOT)         message_begin(MSG_ONE,get_user_msgid("SayText"),{0,0,0},0)         write_byte(read_data(1))         write_string(string1)         write_string(string2)         write_string(string3)         message_end()     } }

So, question is, how would I block only the "%s changed name to %s" message?

BAILOPAN 04-04-2006 04:15

use register_message from engine

GHW_Chronic 04-04-2006 04:17

gratzi BAIL.

v3x 04-04-2006 04:32

Check out my Grenade Sack plugin ;)


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

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