#include < amxmodx >




new g_iColors[ ] = { 0, 255, 0 };




new Float:g_iPos[ ] = { 0.07, -1.0 };




new g_iMessage[ 33 ], g_iMaxPlayers;




public plugin_init( )
{
register_plugin( "Hud Message", "v1.0", "ATRAF" );

register_clcmd( "say /msg", "CmdMsg" );

register_clcmd( "say /unmsg", "CmdUnMsg" );

set_task( 20.0, "CmdAdv", _, _, _, "b" );

g_iMaxPlayers = get_maxplayers( );
}




public client_connect( client )
{
g_iMessage[ client ] = 1;
}




public CmdMsg( client )
{
if ( g_iMessage[ client ] )
{
client_print( client, print_chat, "Your messages is alredy enabled." );

return;
}

g_iMessage[ client ] = 1;

client_print( client, print_chat, "You are enabled your messages." );
}




public CmdUnMsg( client )
{
if ( ! g_iMessage[ client ] )
{
client_print( client, print_chat, "Your messages is alredy disabled." );

return;
}

g_iMessage[ client ] = 0;

client_print( client, print_chat, "You are disabled your messages." );
}




public CmdAdv( )
{
for ( new i = 0; i < g_iMaxPlayers; i++ )
{
if ( ! is_user_connected( i ) || ! g_iMessage[ i ] )
continue;

set_hudmessage( g_iColors[ 0 ], g_iColors[ 1 ], g_iColors[ 2 ], g_iPos[ 0 ], g_iPos[ 1 ], 0, 6.0 );

show_hudmessage( i, "Message Here ATRAFS" );
}
}