View Single Post
JocAnis
Veteran Member
Join Date: Jun 2010
Old 02-03-2011 , 17:31   Re: [STOCK] Director Hud Message
Reply With Quote #3

oh i wanted yesterday to ask how to get 'hudmessage' like on HLTV, and here is the answer. Really nice Arkshine.

1. question:
Are changing color bugged? First was your color '0 ~50 0' and i changed to blue, and now i m trying to change the color to ~orange but its still previously color (blue)...

code:
PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_clcmd"say /test""ClientCommand_Test" );
}

public 
ClientCommand_Testclient )
{
    
sendHudMessage
    

        .
index       client
        .
message     "Welcome to our server,^nWE ARE TESTINGQWEQWRQ",//no matter
        
.red         255,
        .
green       120,
        .
blue        0,
        .
x           0.05,
        .
y           0.2,
        .
effect      2,
        .
fxTime      17.0,
        .
holdTime    15.0,
        .
fadeInTime  0.1,
        .
fadeOutTime 3.0
    
);
}

sendHudMessage( const index, const message[], const red=255, const green=120, const blue=0
        const 
Float:x, const Float:y, const effect, const Float:fxTime
        const 
Float:holdTime, const Float:fadeInTime, const Float:fadeOutTime)//also and here i changed
{
    
#define pack_color(%0,%1,%2) ( %0 + ( %1 << 8 ) + ( %2 << 16 ) )
    #define write_float(%0)      ( write_byte( ( _:%0 & 0xFF ) ),       \
    
write_byte( ( _:%>>  ) & 0xFF ), \
    
write_byte( ( _:%>> 16 ) & 0xFF ), \
    
write_byte( ( _:%>> 24 ) & 0xFF ) )
    
    
message_beginMSG_ONESVC_DIRECTOR, .player index );
    {
        
write_bytestrlenmessage ) + 31 ); // size of write_*
        
write_byteDRC_CMD_MESSAGE );
        
write_byteeffect );
        
write_longpack_colorredgreenblue ) );
        
write_float);
        
write_float);
        
write_floatfadeInTime  );
        
write_floatfadeOutTime  );
        
write_floatholdTime );
        
write_floatfxTime );
        
write_stringmessage );
    }
    
message_end();

2. question:
Is there any way to put client's current name in that message?

Thank you.
JocAnis is offline