Raised This Month: $ Target: $400
 0% 

remplace print messag to Hud ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 01-03-2016 , 13:51   remplace print messag to Hud ?
Reply With Quote #1

can i replaces print message to hud message using register_message ?
__________________

Last edited by abdobiskra; 01-04-2016 at 06:22.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 01-04-2016 , 06:23   Re: remplace print messag to Hud ?
Reply With Quote #2

Up !
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 01-04-2016 , 06:54   Re: remplace print messag to Hud ?
Reply With Quote #3

Don't bump
redivcram is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 01-04-2016 , 07:28   Re: remplace print messag to Hud ?
Reply With Quote #4

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.

Last edited by siriusmd99; 01-04-2016 at 07:34.
siriusmd99 is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 01-04-2016 , 08:07   Re: remplace print messag to Hud ?
Reply With Quote #5

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?
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 01-04-2016 , 10:34   Re: remplace print messag to Hud ?
Reply With Quote #6

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;
    

siriusmd99 is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 01-04-2016 , 11:10   Re: remplace print messag to Hud ?
Reply With Quote #7

siriusmd99

Yes I tried it before but it does not work?



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;
    

Attached Images
File Type: jpg Capture.JPG (14.5 KB, 117 views)
__________________

Last edited by abdobiskra; 01-04-2016 at 11:12.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-04-2016 , 11:41   Re: remplace print messag to Hud ?
Reply With Quote #8

PHP Code:
set_msg_arg_string(2""
before returning PLUGIN_HANDLED.
__________________
HamletEagle is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 01-04-2016 , 11:46   Re: remplace print messag to Hud ?
Reply With Quote #9

Ok, but if you set,msg,arg then why return handled is needed?
siriusmd99 is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 01-05-2016 , 01:07   Re: remplace print messag to Hud ?
Reply With Quote #10

Quote:
Originally Posted by HamletEagle View Post
PHP Code:
set_msg_arg_string(2""
before returning PLUGIN_HANDLED.
i try
nothing has changed
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Reply



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 09:31.


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