Raised This Month: $ Target: $400
 0% 

suppress the message "the game will restart in x second


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 17:15.


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