Help with Blocking Joining Spectator Team Message
Hi all, Im trying to figure out how to block the Player joined Spectator text message. I know to use the following:
Code:
register_event("TextMsg", "my_func", "a", "1=3", 2=#game_jointeam", "4=Spectators")Code:
set_user_msg(get_usr_msgid("TextMsg"), BLOCK_ONCE)Cheers! |
erm, what strange native are you using there?
Code:
/* Sets/Gets what engine messages are blocked. */ |
Hehehe...yeah I was doing it at work and forgot to look. Happens...but the situation is still the same as you well know.
Cheers! |
By the time my_func gets called, the TextMsg will have already been sent, you won't be able to block it. Take a look throug engine.inc at the register_message functions. You can use these to actually intercept the message and stop it from being sent.
|
@XxAvalanchexX
Yeah I was looking at that one. register_message(get_user_msgid("TextMsg"), "my_func") public my_func(msgid, msgdest, msgentity) { new msg[2][32] get_msg_arg_string(2, msg[0], 31) get_msg_arg_string(3, msg[1], 31) if(equal(msg[0], "joined team") && equal(msg[1], "Spectators") && get_user_flags(msgentity)&ADMIN_LEVEL_A) { set_msg_block(get_user_msgid("TextMsg"), BLOCK_ONCE) set_msg_block(get_user_msgid("DeathMsg"), BLOCK_ONCE) } } Now what I was having problems with in that one was that when I used it, it was blocking all join teams for admins and all the deaths...so I'll have to test it a bit further latter. Cheers! |
| All times are GMT -4. The time now is 16:46. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.