AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   TextMsg remplace ! (https://forums.alliedmods.net/showthread.php?t=276901)

abdobiskra 12-30-2015 03:11

TextMsg remplace !
 
Hello I want replacement TextMsg with Hud_Message !
but ignorant of the way so any one can help me ?
PHP Code:

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_message(get_user_msgid("TextMsg"),    "msgTextMsg");
}

public 
msgTextMsg(id)
{
    static 
textmsg[22];
    
get_msg_arg_string(2textmsg21);
    
    if(
equal(textmsg"#Vote"))
    {
            
set_hudmessage(25525500.480.1200.1 10.00.04)
             
show_hudmessage(0"Test Message!")
   
    }
    
    return 
PLUGIN_HANDLED



addons_zz 12-30-2015 09:26

Re: TextMsg remplace !
 
Try this:
Code:
#include <amxmodx> #define PLUGIN "TextMsg Replacer" #define VERSION "1.0" #define AUTHOR "abdobiskra" public plugin_init() {     register_plugin( PLUGIN, VERSION, AUTHOR )     register_message( get_user_msgid( "TextMsg" ), "msgTextMsg" ) } public msgTextMsg( msgid, dest, id ) {     static text_msg[ 64 ];     get_msg_arg_string( 2, text_msg, charsmax(text_msg) );     set_hudmessage( 255, 255, 0, 0.48, 0.12, 0, 0.1, 10.0, 0.04 )     show_hudmessage( id, "%s", text_msg )         return PLUGIN_HANDLED }

See also: TextMsg arguments?, Block MSG and https://www.google.com.br/search?q=TextMsg site:forums.alliedmods.net.

abdobiskra 12-30-2015 16:33

Re: TextMsg remplace !
 
addons_zz
Thx !

but another print work !
ex:
Unknown command !

addons_zz 12-30-2015 19:06

Re: TextMsg remplace !
 
Quote:

Originally Posted by abdobiskra (Post 2378209)
but another print work !
ex:
Unknown command !

Sorry, I do not understand what do you mean.

abdobiskra 12-31-2015 00:40

Re: TextMsg remplace !
 
http://aghl.ru/forum/download/file.p...3620&mode=view

addons_zz 12-31-2015 03:37

Re: TextMsg remplace !
 
Quote:

Originally Posted by abdobiskra (Post 2378335)

Do you want that the message Unknown command, do not appear upper and appear as a HUD?

Or is it appearing at the top and at the HUD at the same time, and you want that it do not appear as HUD?

abdobiskra 12-31-2015 06:22

Re: TextMsg remplace !
 
i want block Unknown command

addons_zz 12-31-2015 07:20

Re: TextMsg remplace !
 
Quote:

Originally Posted by abdobiskra (Post 2378393)
i want block Unknown command

How to do an Unknown command be showed?

Code:
#include <amxmodx> #define PLUGIN "TextMsg Replacer" #define VERSION "1.0" #define AUTHOR "abdobiskra" public plugin_init() {     register_plugin( PLUGIN, VERSION, AUTHOR )     register_message( get_user_msgid( "TextMsg" ), "msgTextMsg" ) } public msgTextMsg( msgid, dest, id ) {     static text_msg[ 64 ];     get_msg_arg_string( 2, text_msg, charsmax(text_msg) );     if( !equal( text_msg ,"#Game_unknown_command" ) )     {         set_hudmessage( 255, 255, 0, 0.48, 0.12, 0, 0.1, 10.0, 0.04 )         show_hudmessage( id, "%s", text_msg )         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }

abdobiskra 12-31-2015 08:33

Re: TextMsg remplace !
 
I tried it in advance but did not work

addons_zz 12-31-2015 09:33

Re: TextMsg remplace !
 
Quote:

Originally Posted by addons_zz (Post 2378411)
How to do an Unknown command be showed?

Answer my question, if you still want my help.

Quote:

Originally Posted by abdobiskra (Post 2378421)
I tried it in advance but did not work

But for now, try this:
Code:
#include <amxmodx> #define PLUGIN "TextMsg Replacer" #define VERSION "1.0" #define AUTHOR "abdobiskra" public plugin_init() {     register_plugin( PLUGIN, VERSION, AUTHOR )     register_message( get_user_msgid( "TextMsg" ), "msgTextMsg" ) } public msgTextMsg( msgid, dest, id ) {     static text_msg[ 64 ];     get_msg_arg_string( 2, text_msg, charsmax(text_msg) );     if( !equali( text_msg, "Unknown command", 13 ) )     {         set_hudmessage( 255, 255, 0, 0.48, 0.12, 0, 0.1, 10.0, 0.04 )         show_hudmessage( id, "%s", text_msg )     }     return PLUGIN_HANDLED }


All times are GMT -4. The time now is 09:28.

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