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_Test( client )
{
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( ( _:%0 >> 8 ) & 0xFF ), \
write_byte( ( _:%0 >> 16 ) & 0xFF ), \
write_byte( ( _:%0 >> 24 ) & 0xFF ) )
message_begin( MSG_ONE, SVC_DIRECTOR, .player = index );
{
write_byte( strlen( message ) + 31 ); // size of write_*
write_byte( DRC_CMD_MESSAGE );
write_byte( effect );
write_long( pack_color( red, green, blue ) );
write_float( x );
write_float( y );
write_float( fadeInTime );
write_float( fadeOutTime );
write_float( holdTime );
write_float( fxTime );
write_string( message );
}
message_end();
}
2. question:
Is there any way to put client's current name in that message?
Thank you.