#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
#include <fakemeta_util>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR ">>Maniek<<(Maniek974)"



new nick[32]

new bool:losowaniee = false

new bool:kolorek[33];

public plugin_init(){
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd("say /losowanie", "losowanie", 0);
	register_event("TextMsg","res","a","2&#Game_C")
}
public res() 
	if(losowaniee) 
	losowaniee = false;

public losowanie(id)
{
	
	if(is_user_connected(id) && is_user_alive(id) &&  cs_get_user_team(id) == CS_TEAM_CT && !losowaniee)
	{
		
		new players[32], num
		get_players(players, num);
		new rand = random_num(1,num)
		if(cs_get_user_team(rand) == CS_TEAM_T && is_user_alive(rand))
		{
			losowaniee = true;
			get_user_name(rand, nick, sizeof nick - 1)
			fm_set_user_rendering(rand,kRenderFxGlowShell,0,255,0,kRenderNormal,8)
			set_task(10.0, "kolor", rand);
			kolorek[rand] = true
			set_hudmessage(255, 255, 255, 0.03, 0.60, 0, 6.0, 5.0, _, _, 21)
			show_hudmessage(0, "Wylosowany zostal: %s", nick)
			
		}
		
	}
	return PLUGIN_HANDLED
}

public kolor(rand)
{
	fm_set_user_rendering(rand,kRenderFxGlowShell,0,0,0,kRenderNormal,8)
	kolorek[rand] = false
	losowaniee = false;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/
