View Single Post
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 10-14-2004 , 10:49  
Reply With Quote #4

If you want to block that message, you will need to use the engine module.

Here's how I'd do it:
Code:
#include <amxmodx> #include <engine> public plugin_init() {     register_message(get_user_msgid("TextMsg"), "hook_TextMsg") // Hook TextMsg message to function } public hook_TextMsg(msgid, msgdest, msgargs) {     new message[32]     get_msg_arg_string(2, message, 31) // Get text message         // If text message = "Game will restart in X seconds" then block the message     if (equal(message, "#Game_will_restart_in")         return PLUGIN_HANDLED // Blocks message         return PLUGIN_CONTINUE // Lets other TextMsg messages go through }

register_message basically lets you hook a function to any game messages. In this case the "game will restart in" is done by the TextMsg message. And then you can block it by returning PLUGIN_HANDLED or let a message continue by returning PLUGIN_CONTINUE. In this case I only block the TextMsg when the message is about the game restarting, otherwise it will display all other text messages such as Counter-Terrorists Win.
DS is offline