Raised This Month: $51 Target: $400
 12% 

dhudmessage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
thebest24
Member
Join Date: Sep 2018
Location: Georgia
Old 01-05-2022 , 07:39   dhudmessage
Reply With Quote #1

hi, i make base builder mod and i use dhudmessage for huds
but this dhud sometimes dissapear and sometimes appear and i wonder
is it possible to make it always visible?

dhudmessage.inc
PHP Code:
#if defined _dhudmessage_included
    #endinput
#endif

#define _dhudmessage_included

#include <amxmodx>

stock __dhud_color;
stock __dhud_x;
stock __dhud_y;
stock __dhud_effect;
stock __dhud_fxtime;
stock __dhud_holdtime;
stock __dhud_fadeintime;
stock __dhud_fadeouttime;
stock __dhud_reliable;

stock set_dhudmessagered 0green 160blue 0Float:= -1.0Float:0.65effects 2Float:fxtime 6.0Float:holdtime 3.0Float:fadeintime 0.1Float:fadeouttime 1.5bool:reliable false )
{
    
#define clamp_byte(%1)       ( clamp( %1, 0, 255 ) )
    #define pack_color(%1,%2,%3) ( %3 + ( %2 << 8 ) + ( %1 << 16 ) )

    
__dhud_color       pack_colorclamp_bytered ), clamp_bytegreen ), clamp_byteblue ) );
    
__dhud_x           _:x;
    
__dhud_y           _:y;
    
__dhud_effect      effects;
    
__dhud_fxtime      _:fxtime;
    
__dhud_holdtime    _:holdtime;
    
__dhud_fadeintime  _:fadeintime;
    
__dhud_fadeouttime _:fadeouttime;
    
__dhud_reliable    _:reliable;

    return 
1;
}

stock show_dhudmessageindex, const message[], any:... )
{
    new 
buffer128 ];
    new 
numArguments numargs();

    if( 
numArguments == )
    {
        
send_dhudMessageindexmessage );
    }
    else if( 
index || numArguments == )
    {
        
vformatbuffercharsmaxbuffer ), message);
        
send_dhudMessageindexbuffer );
    }
    else
    {
        new 
playersList32 ], numPlayers;
        
get_playersplayersListnumPlayers"ch" );

        if( !
numPlayers )
        {
            return 
0;
        }

        new Array:
handleArrayML ArrayCreate();

        for( new 
2jnumArgumentsi++ )
        {
            if( 
getarg) == LANG_PLAYER )
            {
                while( ( 
buffer] = getarg1j++ ) ) ) {}
                
0;

                if( 
GetLangTransKeybuffer ) != TransKey_Bad )
                {
                    
ArrayPushCellhandleArrayMLi++ );
                }
            }
        }

        new 
size ArraySizehandleArrayML );

        if( !
size )
        {
            
vformatbuffercharsmaxbuffer ), message);
            
send_dhudMessageindexbuffer );
        }
        else
        {
            for( new 
0jnumPlayersi++ )
            {
                
index playersList];

                for( 
0sizej++ )
                {
                    
setargArrayGetCellhandleArrayML), 0index );
                }

                
vformatbuffercharsmaxbuffer ), message);
                
send_dhudMessageindexbuffer );
            }
        }

        
ArrayDestroyhandleArrayML );
    }

    return 
1;
}

stock send_dhudMessage( const index, const message[] )
{
    
message_begin__dhud_reliable ? ( index MSG_ONE MSG_ALL ) : ( index MSG_ONE_UNRELIABLE MSG_BROADCAST ), SVC_DIRECTOR_index );
    {
        
write_bytestrlenmessage ) + 31 );
        
write_byteDRC_CMD_MESSAGE );
        
write_byte__dhud_effect );
        
write_long__dhud_color );
        
write_long__dhud_x );
        
write_long__dhud_y );
        
write_long__dhud_fadeintime );
        
write_long__dhud_fadeouttime );
        
write_long__dhud_holdtime );
        
write_long__dhud_fxtime );
        
write_stringmessage );
    }
    
message_end();

__________________
Hello!
thebest24 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-05-2022 , 08:09   Re: dhudmessage
Reply With Quote #2

The messages on your screen depend on other plugins in your server.
There's a maximum limit of messsage you can have at a time, surpassing this will make them flicker.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
thebest24
Member
Join Date: Sep 2018
Location: Georgia
Old 01-05-2022 , 08:12   Re: dhudmessage
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
The messages on your screen depend on other plugins in your server.
There's a maximum limit of messsage you can have at a time, surpassing this will make them flicker.
i just use 4 dhud timer hud level hud health hud and money hud
__________________
Hello!
thebest24 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-05-2022 , 09:14   Re: dhudmessage
Reply With Quote #4

"Just 4" is a huge number.
The maximum is 8.
I'm sure that those 4 are overlapping at the same time which exceeds the maximum of 8.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Uzviseni Bog
Senior Member
Join Date: Jun 2020
Old 01-05-2022 , 09:18   Re: dhudmessage
Reply With Quote #5

Max 4 hud message, if there is more than that then it bugs
Uzviseni Bog is offline
thebest24
Member
Join Date: Sep 2018
Location: Georgia
Old 01-05-2022 , 10:19   Re: dhudmessage
Reply With Quote #6

Quote:
Originally Posted by Uzviseni Bog View Post
Max 4 hud message, if there is more than that then it bugs
nah even if its 1 it still flicks
__________________
Hello!
thebest24 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-05-2022 , 10:52   Re: dhudmessage
Reply With Quote #7

That depends on how well the code is made.
If it's made to show the message 1000 times per second, of course it will flick.
__________________

Last edited by OciXCrom; 01-05-2022 at 10:52.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 06:28.


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