#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <engine>
#include <fun>

#define Keysmenu_1 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9) //Keys: 1234567890
#define Keysmenu_2 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9) //Keys: 1234567890

#define ADMIN_ACCESS ADMIN_LEVEL_A

// Server Sort Name
new const g_Client[] = "[te$co]";

new bool:restart_event = false;
new bool:vibri_event = false;

new sprSaber;

new invisibility[33][2];
new chameleon[33][2];
new footsteps[33][2];

public plugin_init() {
	register_plugin("Admin Cheater Menu", "3.0", "te$co")
	
	register_dictionary( "adminmenu.txt");
	
	register_cvar("write_log_file","1");
	
	register_concmd("glow", "RandGlow", ADMIN_ACCESS, "All Player Random Glow.")
	
	register_concmd("adminmenu", "ShowAdminMenu", ADMIN_ACCESS, "Open Admin Menu #1")
	register_concmd("adminmenu2", "ShowAdminMenu2", ADMIN_ACCESS, "Open Admin Menu #2")

	register_menucmd(register_menuid("menu_1"), Keysmenu_1, "Pressedmenu_1")
	register_menucmd(register_menuid("menu_2"), Keysmenu_2, "Pressedmenu_2")
	
	register_logevent("RoundEnd", 2, "1=Round_End")  
}

public plugin_precache()
{
	sprSaber = precache_model("sprites/laserbeam.spr")
	
	precache_sound("admin/reset.wav")
	precache_sound("admin/event_start.wav")
	
	precache_model("models/dildo/ct_dildo.mdl")
	precache_model("models/dildo/te_dildo.mdl")
	
	return PLUGIN_CONTINUE;
}

public  client_putinserver(id)
{
	if(is_user_bot(id)) 
		return PLUGIN_HANDLED;
		
	invisibility[id][0] = 0;
	footsteps[id][0] = 0;
	chameleon[id][0] = 0;
	
	set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
	
	return PLUGIN_CONTINUE;
}

public client_disconnect(id)
{
	if(is_user_bot(id)) 
		return PLUGIN_HANDLED;

	invisibility[id][0] = 0;
	footsteps[id][0] = 0;
	chameleon[id][0] = 0;

	return PLUGIN_CONTINUE;
}

public ShowAdminMenu(id) {
	if (get_user_flags(id) & ADMIN_ACCESS)
	{
		show_menu(id, Keysmenu_1, "Admin Cheats #1^n^n1. AK47/M4a1^n2. AWP + Desert^n3. Respawn^n4. Money: $16000 ^n5. Nades^n6. HP & AP^n7. Max Level (17)^n8. Noclip^n\y9. More^n^n\r0. Exit", -1, "menu_1") // Display menu
	
		return PLUGIN_CONTINUE
	}
	else
	{
		client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"ACCES_MSG");
		
		return PLUGIN_HANDLED;
	}
	
	return PLUGIN_CONTINUE
}

public Pressedmenu_1(id, key) {

	new team[32], User[32];
	get_user_team(id,team,32);
	get_user_name(id,User,32);
	
	switch (key) {
		case 0: { // 1
		
			if(is_user_alive(id))
			{
				strip_user_weapons(id) // No more weapons
				
				if(equal(team,"T", 1))
				{
					give_item(id,"weapon_ak47")
					give_item(id,"ammo_762nato")
					give_item(id,"ammo_762nato")
					give_item(id,"ammo_762nato")
					give_item(id,"ammo_762nato")
					
					client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"WEAPONS_TE")
					
					if(get_cvar_num("write_log_file") == 1)
						log_amx("%s use a Admin Cheats: Weapon(AK47)", User)
				}
				else
				{
					give_item(id,"weapon_m4a1")
					give_item(id,"ammo_556nato")
					give_item(id,"ammo_556nato")
					give_item(id,"ammo_556nato")
					
					client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"WEAPONS_CT")
					
					if(get_cvar_num("write_log_file") == 1)
						log_amx("%s use a Admin Cheats: Weapon(M4a1)", User)
				}
				
				give_item(id,"weapon_deagle")
				give_item(id,"ammo_50ae")
				give_item(id,"ammo_50ae")
				give_item(id,"ammo_50ae")
				give_item(id,"ammo_50ae")
				give_item(id,"ammo_50ae")
				give_item(id,"ammo_50ae")
				give_item(id,"ammo_50ae")
				give_item(id,"weapon_hegrenade")
				give_item(id,"weapon_flashbang")
				give_item(id,"weapon_flashbang")
				give_item(id,"weapon_smokegrenade")
				
				set_user_armor(id, 100)
			}
			else
			{
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"DIED_MSG")
				return PLUGIN_HANDLED;
			}
			
			client_cmd(id, "adminmenu")
		}
		case 1: { // 2
		
			if(is_user_alive(id))
			{
				strip_user_weapons(id) // No more weapons
				give_item(id,"weapon_awp")
				give_item(id,"ammo_338magnum")
				give_item(id,"ammo_338magnum")
				give_item(id,"ammo_338magnum")
				give_item(id,"weapon_deagle")
				give_item(id,"ammo_50ae")
				give_item(id,"ammo_50ae")
				give_item(id,"ammo_50ae")
				give_item(id,"ammo_50ae")
				give_item(id,"ammo_50ae")
				give_item(id,"ammo_50ae")
				give_item(id,"ammo_50ae")
				give_item(id,"weapon_hegrenade")
				give_item(id,"weapon_flashbang")
				give_item(id,"weapon_flashbang")
				give_item(id,"weapon_smokegrenade")
				
				set_user_armor(id, 100)
				
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"AWP_MSG")
				
				if(get_cvar_num("write_log_file") == 1)
					log_amx("%s use a Admin Cheats: Weapon(AWP)", User)
			}
			else
			{
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"DIED_MSG")
				return PLUGIN_HANDLED;
			}
			
			client_cmd(id, "adminmenu")
		}
		case 2: { // 3
			
			ExecuteHam(Ham_CS_RoundRespawn, id);
				
			set_user_armor(id, 100)
			set_user_godmode(id, 1)
			set_user_rendering(id, kRenderFxGlowShell, 0, 200, 0, kRenderNormal,30)
			
			set_task(5.0,"respawn", id)
			
			client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"RESPAWN_MSG")
			
			if(get_cvar_num("write_log_file") == 1)
				log_amx("%s use a Admin Cheats: Revive", User);
			
			client_cmd(id, "adminmenu")
		}
		case 3: { // 4
			
			new money = cs_get_user_money(id);
			
			if(money < 16000)
			{
				cs_set_user_money(id, 16000);
				
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"MONEY_MSG")
				
				if(get_cvar_num("write_log_file") == 1)
					log_amx("%s use a Admin Cheats: $16000", User)
			}
			else
			{
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"ALREADY_MONEY")
				return PLUGIN_HANDLED;
			}
			
			client_cmd(id, "adminmenu")
		}
		case 4: { // 5
		
			if(is_user_alive(id))
			{
				give_item(id, "weapon_hegrenade")
				give_item(id, "weapon_flashbang")
				give_item(id, "weapon_flashbang")
				give_item(id, "weapon_smokegrenade")
				
				set_user_armor(id, 100)
			
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"NADE_MSG")
				
				if(get_cvar_num("write_log_file") == 1)
					log_amx("%s use a Admin Cheats: Nades", User);
			}
			else
			{
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"DIED_MSG")
				return PLUGIN_HANDLED;
			}
			
			client_cmd(id, "adminmenu")
		}
		case 5: { // 6
		
			if(is_user_alive(id))
			{
				set_user_armor(id, 255)
				set_user_health(id, 255)
				
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"HPAP_MSG")
				
				if(get_cvar_num("write_log_file") == 1)
					log_amx("%s use a Admin Cheats: Health & Armor", User)
			}
			else
			{
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"DIED_MSG")
				return PLUGIN_HANDLED;
			}
			
			client_cmd(id, "adminmenu")
		}
		case 6: { // 7
			
			new war3ft = get_cvar_num("wc3_save_xp");
			
			if(war3ft == 1)
			{
				server_cmd("amx_givexp ^"%s^" %d", User, 51200) // Max LvL: 51200 XP
				
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"WC3_LVL_MSG")
				
				if(get_cvar_num("write_log_file") == 1)
					log_amx("%s use a Admin Cheats: Max Level (17)", User);
			}
			else
			{
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"WC3_NOT_RUN_MSG")
				return PLUGIN_HANDLED;
			}
			
			client_cmd(id, "adminmenu")
		}
		case 7: { // 8
			
			if(is_user_alive(id))
			{
				new ghost = get_user_noclip(id);
				
				if( ghost == 0 ) {
					client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"GHOST_ON_MSG")
					set_user_noclip(id, 1);
				}else {
					client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"GHOST_OFF_MSG")
					set_user_noclip(id, 0);
				}
				
				if(get_cvar_num("write_log_file") == 1)
					log_amx("%s use a Admin Cheats: Noclip", User)
			}
			else
			{
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"DIED_MSG")
				return PLUGIN_HANDLED;
			}
			
			client_cmd(id, "adminmenu")
		}
		case 8: { // 9
			client_cmd(id, "adminmenu2")
		}
		case 9: { // 0
			return PLUGIN_HANDLED;
		}
	}
	return PLUGIN_HANDLED
}

public ShowAdminMenu2(id) {
	if (get_user_flags(id) & ADMIN_ACCESS)
	{
		show_menu(id, Keysmenu_2, "Admin Cheats #2^n^n1. C4/Defusekit^n2. Chameleon^n3. Bandage(+1HP/s)^n4. Lightsaber^n5. Invisibility^n6. Dildo Event^n7. Footsteps (On/Off)^n8. Random ShopItems^n9. Round Restart(60sec)^n^n\r0. Back", -1, "menu_2") // Display menu
	
		return PLUGIN_CONTINUE
	}
	else
	{
		client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"ACCES_MSG")
		
		return PLUGIN_HANDLED;
	}
	
	return PLUGIN_CONTINUE
}

public Pressedmenu_2(id, key) {
	
	new team[32], User[32];
	get_user_team(id,team,32);
	get_user_name(id,User,32);

	switch (key) {
		case 0: { // 1
			
			if(is_user_alive(id))
			{
				if(equal(team,"T", 1))
				{
					give_item(id,"weapon_c4")
	
					client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"C4_MSG")
					
					if(get_cvar_num("write_log_file") == 1)
						log_amx("%s use a Admin Cheats: Weapon(C4)", User)
				}
				else
				{
					cs_set_user_defuse(id)
					
					client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"DEFUSEKIT_MSG")
					
					if(get_cvar_num("write_log_file") == 1)
						log_amx("%s use a Admin Cheats: Weapon(Defusekit)", User)
				}
			}
			else
			{
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"DIED_MSG")
				return PLUGIN_HANDLED;
			}
			
			client_cmd(id, "adminmenu2")
		}
		case 1: { // 2

			if(is_user_alive(id))
			{
				if(chameleon[id][0] == 0)
				{
					if(equal(team,"T", 1))
					{
						cs_set_user_model(id, "gign")
		
						client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"CHAMELEON_MSG")
						
						if(get_cvar_num("write_log_file") == 1)
							log_amx("%s use a Admin Cheats: Chameleon(CT)", User)
					}
					else
					{
						cs_set_user_model(id, "leet")
						
						client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"CHAMELEON_MSG")
						
						if(get_cvar_num("write_log_file") == 1)
							log_amx("%s use a Admin Cheats: Chameleon(TE)", User)
					}
					
					chameleon[id][0] = 1;
				}
				else
				{
					cs_reset_user_model(id);
					client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"RESET_CHAMELEON_MSG")
					chameleon[id][0] = 0;
				}
			}
			else
			{
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"DIED_MSG")
				return PLUGIN_HANDLED;
			}
			
			client_cmd(id, "adminmenu2")
		}
		case 2: { // 3
			
			if(is_user_alive(id))
			{
				new hp = get_user_health(id);
				
				if(hp < 100)
				{
					set_task(1.0,"gyogyitas", id)
				
					client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"HP_REGEN_MSG")
					
					if(get_cvar_num("write_log_file") == 1)
						log_amx("%s use a Admin Cheats: +1HP/s", User)
				}
				else
				{
					client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"HP_FULL_MSG", hp)
					return PLUGIN_HANDLED;
				}
			}
			else
			{
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"DIED_MSG")
				return PLUGIN_HANDLED;
			}
						
			client_cmd(id, "adminmenu2")
		}
		case 3: { // 4
			
			if(is_user_alive(id))
			{
				new tid[2];
				tid[0] = id;
	
				tid[1] = 1;
				set_task(0.1,"lightsaber",0,tid,2,"a",300);
				
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"LIGHTSABER_MSG")
				
				if(get_cvar_num("write_log_file") == 1)
					log_amx("%s use a Admin Cheats: Lightsaber", User)
			}
			else
			{
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"DIED_MSG")
				return PLUGIN_HANDLED;
			}

			client_cmd(id, "adminmenu2")
		}
		case 4: { // 5
		
			if(is_user_alive(id))
			{
				if(invisibility[id][0] == 0)
				{
					set_user_rendering(id,kRenderFxNone, 0,0,0, kRenderTransAdd,3);
					client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"FULL_INVISIBILITY_MSG")
					invisibility[id][0] = 1;
				}
				else if(invisibility[id][0] == 1)
				{
					set_user_rendering(id,kRenderFxNone, 0,0,0, kRenderTransAdd,50);
					client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"INVISIBILITY_MSG")
					invisibility[id][0] = 2;
				}
				else if(invisibility[id][0] == 2)
				{
					set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
					client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"INVISIBILITY_OFF_MSG")
					invisibility[id][0] = 0;
				}
				
				if(get_cvar_num("write_log_file") == 1)
					log_amx("%s use a Admin Cheats: Invisibility", User)
			}
			else
			{
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"DIED_MSG")
				return PLUGIN_HANDLED;
			}
			
			client_cmd(id, "adminmenu2")
		}
		case 5: { // 6
			
			if(vibri_event == false)
			{
				vibri_event = true;
				set_task(0.1, "vibrator", 0);
				
				client_cmd(0, "spk admin/event_start.wav"); // Play Sound

				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"VIB_MSG")
				
				if(get_cvar_num("write_log_file") == 1)
					log_amx("%s use a Admin Cheats: Dildo Event", User)
			}
			else
			{
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"VIB_ALREADY_RUN_MSG")
				return PLUGIN_HANDLED;
			}
			
			client_cmd(id, "adminmenu2")
		}
		case 6: { // 7
			
			if(is_user_alive(id))
			{
				if(footsteps[id][0] == 0)
				{
					set_user_footsteps(id, 1);
					client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"FOOTSTEPS_ON_MSG")
					footsteps[id][0] = 1;
				}
				else
				{
					set_user_footsteps(id, 0);
					client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"FOOTSTEPS_OFF_MSG")
					footsteps[id][0] = 0;
				}
				
				if(get_cvar_num("write_log_file") == 1)
					log_amx("%s use a Admin Cheats: Footsteps (On/Off)", User)
			}
			else
			{
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"DIED_MSG")
				return PLUGIN_HANDLED;
			}
			
			client_cmd(id, "adminmenu2")
		}
		case 7: { // 8
			
			new war3ft = get_cvar_num("wc3_save_xp");
			
			if(war3ft == 1)
			{
				set_task(0.1, "shopmenu");
			
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"SHOPMENU_MSG")
				
				if(get_cvar_num("write_log_file") == 1)
					log_amx("%s use a Admin Cheats: Shopmenu Items", User)
			}
			else
			{
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"WC3_NOT_RUN_MSG")
				return PLUGIN_HANDLED;
			}
			
			client_cmd(id, "adminmenu2")
		}
		case 8: { // 9
			
			if(restart_event == false)
			{
				restart_event = true;
				
				set_task(0.1, "restart", 60);
			
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"RESTART_MSG")
				
				if(get_cvar_num("write_log_file") == 1)
					log_amx("%s use a Admin Cheats: Round Restart", User)
			}
			else
			{
				client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"ALREADY_RUN_RESTART_MSG")
				return PLUGIN_HANDLED;
			}
			
			client_cmd(id, "adminmenu2")
		}
		case 9: { // 0
			client_cmd(id, "adminmenu")
		}
	}
	return PLUGIN_HANDLED;
}

/*----------------------------------------------!!!Függvények!!!----------------------------------------------*/
public respawn(id) {
	
	set_user_godmode(id, 0);
	set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);

	return PLUGIN_CONTINUE;
}

public gyogyitas(id) {
	
	new hp = get_user_health(id);
	
	if(hp < 100)
	{
		set_user_health(id, hp + 1);
		set_task(1.0,"gyogyitas", id);
	}
	else
	{
		client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"HP_END_MSG", hp)
		return PLUGIN_HANDLED;
	}
	
	return PLUGIN_CONTINUE;
}

/*----------------------------------------------LÉZERKARD----------------------------------------------*/
public sqrt(num)
{
	new div = num;
	new result = 1;
	
	while (div > result)			// end when div == result, or just below 
	{
		div = (div + result) / 2;	// take mean value as new divisor 
		result = num / div;
	}
	
	return div;
}

public lightsaber(id[])
{			
	new vec[3];
	new aimvec[3];
	new lseffvec[3];
	new length;
	new speed = 65;
	get_user_origin(id[0],vec,1);
	get_user_origin(id[0],aimvec,2);
	lseffvec[0]=aimvec[0]-vec[0];
	lseffvec[1]=aimvec[1]-vec[1];
	lseffvec[2]=aimvec[2]-vec[2];
	length=sqrt(lseffvec[0]*lseffvec[0]+lseffvec[1]*lseffvec[1]+lseffvec[2]*lseffvec[2]);
	lseffvec[0]=lseffvec[0]*speed/length;
	lseffvec[1]=lseffvec[1]*speed/length;
	lseffvec[2]=lseffvec[2]*speed/length;

	new vorigin[3];
	new maxpl = get_maxplayers() +1;
	new teama[32],teamv[32];
	get_user_team(id[0],teama,31);
	
	for(new a = 1; a < maxpl; a++)
	{			
		if(is_user_alive(a) != 0)
		{
			get_user_origin(a,vorigin);
			if (get_distance(vec,vorigin)<100)
			{				
				if(a != id[0])
				{
					get_user_team(a,teamv,31);
					if(!equal(teama,teamv,2))
					{
						if(id[1] != 0)
						{
							user_kill(a,id[0]);
							new frag = get_user_frags(id[0]);
							set_user_frags(id[0], frag + 1);
							
							client_print(id[0], print_chat, "%s %L",g_Client, LANG_PLAYER,"JEDY_MSG")
						}
					}
					else if(id[1] == 2)
					{
						user_kill(a,id[0]);
						new frag = get_user_frags(id[0]);
						set_user_frags(id[0], frag + 1);
												
						client_print(id[0], print_chat, "%s %L",g_Client, LANG_PLAYER,"JEDY_MSG")
					}						
				}						
			}
		}
	}

	// beam effect between point and entity
	message_begin( MSG_BROADCAST,SVC_TEMPENTITY);
	write_byte ( 1 );     			//TE_BEAMENTPOINT 1  
	write_short (id[0]);     		// ent 
	write_coord (lseffvec[0]+vec[0]);	//end position 
	write_coord (lseffvec[1]+vec[1]);
	write_coord (lseffvec[2]+vec[2]+10);
	write_short (sprSaber);  		// sprite 
	write_byte (0);       			// start frame 
	write_byte (15);      			// frame rate in 0.1's 
	write_byte (1);     			// byte (life in 0.1's 
	write_byte (20);      			// line width in 0.1's
	write_byte (5);      			// noise amplitude in 0.01's 
	write_byte (0);       			// RGB color
	write_byte (200);
	write_byte (0);
	write_byte (255);     			// brightness
	write_byte (10);      			// scroll speed in 0.1's
	message_end();
	
	return PLUGIN_CONTINUE;
}
/*----------------------------------------------LÉZERKARD-END------------------------------------------*/

/*----------------------------------------------VIBRATOR-START-----------------------------------------*/
public vibrator(first) {
	
	if(vibri_event == true)
	{
		new players[32], team[32], num, player, clip, ammo, wpnid;
		
		get_players(players, num, "ah")
	
		for(new i = 0; i < num; i++)
		{
			player = players[i];
			wpnid = get_user_weapon(player,clip,ammo);
			
			if((is_user_alive(player)) && (wpnid != CSW_KNIFE))
			{
				get_user_team(player,team,32);
				strip_user_weapons(player);
				give_item(player, "weapon_knife");
				set_task(0.1, "RandGlow"); // Glow
								
				if(first == 0)
				{
					set_user_health(player, 200)
					set_user_armor(player, 200)
				}
				
				if(equal(team,"T", 1))
					entity_set_string(player, EV_SZ_viewmodel, "models/dildo/te_dildo.mdl");
				else
					entity_set_string(player, EV_SZ_viewmodel, "models/dildo/ct_dildo.mdl");
			}
		}
		
		set_task(0.1, "vibrator", 1); // Knife Check
	}
	else
	{
				client_print(0, print_chat, "%s %L",g_Client, LANG_PLAYER,"EVENT_END_MSG")
				return PLUGIN_HANDLED;
	}
	
	return PLUGIN_CONTINUE;
}
/*----------------------------------------------VIBRATOR-END------------------------------------------*/

public RoundEnd() {
	// MAx Player numb
	new maxplayers = get_maxplayers()+1;
	
	for(new id = 1; id < maxplayers; id++)
	{	
		if(chameleon[id][0] == 1)
		{
			cs_reset_user_model(id); // Ruha Reset
			chameleon[id][0] = 0;
			
			client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"RESET_CHAMELEON_MSG")
		}
		
		if(invisibility[id][0] >= 1)
		{
			set_user_rendering(id,kRenderFxNone,255,255,255, kRenderNormal,16);
			invisibility[id][0] = 0;
			
			client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"INVISIBILITY_OFF_MSG")
		}
		
		if(footsteps[id][0] == 1)
		{
			set_user_footsteps(id, 1); // Lepeshangok be!
			footsteps[id][0] = 0;
			
			client_print(id, print_chat, "%s %L",g_Client, LANG_PLAYER,"FOOTSTEPS_OFF_MSG")
		}
	}
	
	if(vibri_event == true)
	{
		new players[32], team[32], num, player;
		get_players(players, num, "ah")

		for(new i = 0; i < num; i++)
		{
			player = players[i];
			get_user_team(player,team,32);
		
			if(is_user_alive(player))
			{
				strip_user_weapons(player) // No more weapons
				
				if(equal(team,"T", 1))
				{
					give_item(player,"weapon_ak47")
					give_item(player,"ammo_762nato")
					give_item(player,"ammo_762nato")
					give_item(player,"ammo_762nato")
					give_item(player,"ammo_762nato")
				}
				else
				{
					give_item(player,"weapon_m4a1")
					give_item(player,"ammo_556nato")
					give_item(player,"ammo_556nato")
					give_item(player,"ammo_556nato")
				}
			
				set_user_health(player, 100);
				set_user_armor(player, 100);
				
				give_item(player,"weapon_knife")
				give_item(player,"weapon_deagle")
				give_item(player,"ammo_50ae")
				give_item(player,"ammo_50ae")
				give_item(player,"ammo_50ae")
				give_item(player,"ammo_50ae")
				give_item(player,"ammo_50ae")
				give_item(player,"ammo_50ae")
				give_item(player,"ammo_50ae")
				give_item(player,"weapon_hegrenade")
				give_item(player,"weapon_flashbang")
				give_item(player,"weapon_flashbang")
				give_item(player,"weapon_smokegrenade")
				
			}
			
			set_user_rendering(player,kRenderFxNone,255,255,255, kRenderNormal,16);
		}
		
		vibri_event = false;
	}
}

public restart(count)
{
	set_hudmessage(_, _, _, -1.0, 0.85, 1)    
	show_hudmessage(0,"Round restart %d seconds left!", count)
	
	if((count <= 10) || (count % 10 == 0))
	{
		new szNum[32]
		num_to_word(count, szNum, 31)
		client_cmd(0, "spk ^"fvox/%s^"", szNum)
	}

	count--;
	
	if(count != 0)
	{
		set_task(1.0, "restart", count)  // Rekurzió
	}
	else
	{
		set_hudmessage(_, _, _, -1.0, -1.0, 1)
		show_hudmessage(0,"Round Restart now!!!")
			
		server_cmd("sv_restart 1"); // Restart
		
		restart_event = false;

		client_cmd(0, "spk admin/reset.wav"); // Reset Sound
	}
	
	return PLUGIN_CONTINUE;
}

public shopmenu() {
	
	new players[32], name[32], num, player;
	get_players(players, num, "ah")

	for(new i = 0; i < num; i++)
	{
		player = players[i];
		get_user_name(player,name,32);

		new ShopmenuItem = random_num(0, 17);
		server_cmd("wc3_giveitem ^"%s^" %d", name, ShopmenuItem);
	}
}

public RandGlow() {

	new Red = random(256);
	new Green = random(256);
	new Blue = random(256);
	
	new players[32], num, player;
			
	get_players(players, num, "ah")
	
	for(new i = 0; i < num; i++)
	{
		player = players[i];
		set_user_rendering(player, kRenderFxGlowShell, Red, Green, Blue, kRenderNormal,30)
	}
}
