Code:
#include <amxmodx>
#include <amxmisc>
new const PLUGIN[] = "Connect adv"
new const VERSION[] = "1.3"
new const AUTHOR[] = "none"
new hudmessage1, HudOn, ChatOn, HudColor
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
hudmessage1 = CreateHudSyncObj()
ChatOn = register_cvar("conn_chat", "1")
HudOn = register_cvar("conn_hud", "1")
HudColor = register_cvar("conn_hud_color", "000 255 000" );
register_dictionary("connrekl.txt")
}
public client_putinserver(id)
{
if(!is_user_bot(id))
{
set_task(20.0, "ShowMsg", id)
}
}
public ShowMsg(id)
{
if(get_pcvar_num(ChatOn))
{
client_print(id, print_chat, "%L", id, "REKLAMA_CHAT")
}
if(get_pcvar_num(HudOn))
{
static Colors[ 12 ], RealColors[ 9 ]; // instead of [ 3 ][ 3 ], let's make it 3 * 3
get_pcvar_string( HudColor, Colors, charsmax( Colors ) );
parse( Colors, RealColors[ 0 ], charsmax( RealColors ), RealColors[ 1 ], charsmax( RealColors ), RealColors[ 2 ], charsmax( RealColors ) );
set_hudmessage(str_to_num( RealColors[ 0 ] ), str_to_num( RealColors[ 2 ] ), str_to_num( RealColors[ 3 ] ), 0.02, 0.27, 1, 0.5, 10.0)
ShowSyncHudMsg(id, hudmessage1, "%L", id, "REKLAMA_HUD")
}
}
public client_disconnect(id)
{
remove_task(id)
}