AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   remplace print messag to Hud ? (https://forums.alliedmods.net/showthread.php?t=277150)

abdobiskra 01-03-2016 13:51

remplace print messag to Hud ?
 
can i replaces print message to hud message using register_message ?

abdobiskra 01-04-2016 06:23

Re: remplace print messag to Hud ?
 
Up !

redivcram 01-04-2016 06:54

Re: remplace print messag to Hud ?
 
Don't bump

siriusmd99 01-04-2016 07:28

Re: remplace print messag to Hud ?
 
Yes,just return null value on simple message and then set hudmessage.
But first, try to return PLUGIN_HANDLED on that message,i'm not sure if this method works but it's better to use.

abdobiskra 01-04-2016 08:07

Re: remplace print messag to Hud ?
 
siriusmd99
i try
PHP Code:

register_message(get_user_msgid("TextMsg"),    "msgTextMsg"); 

But it did not succeed
and message larger 512 bytes

PHP Code:

static textmsg[512

Could you give me an example?

siriusmd99 01-04-2016 10:34

Re: remplace print messag to Hud ?
 
Yes, then add this:

PHP Code:

public msgTextMsg()
{
    static 
textmsg[512];
    
get_msg_arg_string(2textmsg511);

    
//and here add hudmessage
    
set_hudmessage(blablabla)
    
show_hudmessage(0,textmsg)
    
// if it wont work then try to set task for hudmsg

    
return PLUGIN_HANDLED;
    



abdobiskra 01-04-2016 11:10

Re: remplace print messag to Hud ?
 
1 Attachment(s)
siriusmd99

Yes I tried it before but it does not work?

http://i64.tinypic.com/2hwzdid.jpg

PHP Code:

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_message(get_user_msgid("TextMsg"),    "msgTextMsg"); 
    
set_task(5.0"test")
    
// Add your code here...
}
public 
test()
{
    
client_print(0print_chat"[AMXX] Hello World !")
}


public 
msgTextMsg()
{
    static 
textmsg[512];
    
get_msg_arg_string(2textmsg511);

    
//and here add hudmessage
    
set_hudmessage___0.00.8800.110.00.04 )
    
show_hudmessage(0"%s",textmsg)
    
// if it wont work then try to set task for hudmsg

    
return PLUGIN_HANDLED;
    



HamletEagle 01-04-2016 11:41

Re: remplace print messag to Hud ?
 
PHP Code:

set_msg_arg_string(2""

before returning PLUGIN_HANDLED.

siriusmd99 01-04-2016 11:46

Re: remplace print messag to Hud ?
 
Ok, but if you set,msg,arg then why return handled is needed?

abdobiskra 01-05-2016 01:07

Re: remplace print messag to Hud ?
 
Quote:

Originally Posted by HamletEagle (Post 2379899)
PHP Code:

set_msg_arg_string(2""

before returning PLUGIN_HANDLED.

i try
nothing has changed


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

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