#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <cstrike>
#include <fakemeta>
#include <fakemeta_util>
#include <fun>
#include <engine>
#include <hamsandwich>
#include <jailbreak>

#define PLUGIN "[JB] Sklep & Ruletka & Bonusy"
#define VERSION "v4.1"
#define AUTHOR "Skull"

#define SVIP ADMIN_LEVEL_B
#define VIP ADMIN_LEVEL_A
#define CZAS 240

new speed[33];
new ilosc_skokow_gracza[33];
new odliczanie[33];
new nicki[32][64];
new sync;

new bool:uzyl[33];
new bool:moc[33];
new bool:skok[33];
new bool:bieg[33];
new bool:autobh[33];

public plugin_init() 
{
	register_clcmd("say /shop", "Sklep");
	register_clcmd("say /sklep", "Sklep");
	register_clcmd("say /ruletka", "ruletka");
	register_clcmd("say /ruleta", "ruletka");

	register_clcmd("say_team /shop", "Sklep");
	register_clcmd("say_team /sklep", "Sklep");
	register_clcmd("say_team /ruletka", "ruletka");
	register_clcmd("say_team /ruleta", "ruletka");

	RegisterHam(Ham_TakeDamage, "player", "Fw_HamPlayerTakeDamage", 0)
	register_event("CurWeapon", "CurWeapon", "be", "1=1");
	register_forward(FM_CmdStart, "CmdStart");
	register_forward(FM_Touch, "fwd_touch")
	register_event("DeathMsg", "DeathMsg", "a")
	register_logevent("Koniec_Rundy", 2, "1=Round_End");

	sync = CreateHudSyncObj()
}

public plugin_precache()
{
	precache_model("models/jb_skull/jb_Bonusy_v1.mdl");
	precache_sound("jb_skull/jb_pierd.mp3");
}

public Sklep(id)
{
	new menuu, formats[64];
	formatex(formats, charsmax(formats), "Twoje Dolary: \r%i^n\wSklep \wza \yDolary:", cs_get_user_money(id))
	menuu = menu_create(formats, "Sklep_Handler");

	menu_additem(menuu, "\ySklep \r[Wieznia]");
	menu_additem(menuu, "\ySklep \r[Klawisza]");

	menu_setprop(menuu, MPROP_EXIT, MEXIT_ALL)
	menu_setprop(menuu, MPROP_EXITNAME, "Wyjscie")
	menu_setprop(menuu, MPROP_NEXTNAME, "Dalej")
	menu_setprop(menuu, MPROP_BACKNAME, "Wroc")
	menu_display(id, menuu, 0)
	return PLUGIN_HANDLED
}

public Sklep_Handler(id, menuu, item)
{
	switch(item)
	{
		case 0: Sklep_Wieznia(id)
		case 1: Sklep_Klawisza(id)
	}
	return PLUGIN_CONTINUE;
}

public Sklep_Wieznia(id)
{
	new menu, formats[64];
	formatex(formats, charsmax(formats), "Twoje Dolary: \r%i^n\wSklep \rWieznia \wza \yDolary:", cs_get_user_money(id))
	menu = menu_create(formats, "Sklep_Wieznia_Handler");

	menu_additem(menu, "\yDlon Boga \w[+50 HP]\r[5000 $$]");			// 1 - 0
	menu_additem(menu, "\yNiemilosierny Skok \w[AutoBH]\r[4000 $$]");		// 2 - 1
	menu_additem(menu, "\yKapcie Cygana \w[Wieksza Predkosc]\r[14000 $$]");	        // 3 - 2
	menu_additem(menu, "\yNieziemska Moc \w[Mniejsza Grawitacja]\r[7000 $$]");	// 4 - 3
	menu_additem(menu, "\yWyskokowe Klapki \w[Potrojny Skok]\r[7000 $$]");		// 5 - 4
	menu_additem(menu, "\yPower Punch \w[Podwojne Obrazenia]\r[9000 $$]");		// 6 - 5
	menu_additem(menu, "\yPalestynskie Cichobiegi \w[Ciche Chodzenie]\r[2500 $$]");	// 7 - 6
	menu_additem(menu, "\yOdlamek Wojenny \w[Granat HE]\r[6000 $$]");		// 8 - 7
	menu_additem(menu, "\yPomoc Dymna \w[Granat SMOKE]\r[3000 $$]");	        // 9 - 8
	menu_additem(menu, "\yKrowie Mleko \w[Granat FLASH]\r[4000 $$]^n");	// 10 - 9
	menu_additem(menu, "\yDeagle \w[Los Ammo od 1 do 5] \r[14000 $$]");		// 11 - 10
	menu_additem(menu, "\yUSP \w[Los Ammo od 1 do 6] \r[14000 $$]");		// 12 - 11
	menu_additem(menu, "\yScout \w[Los Ammo od 1 do 5] \r[14000 $$]");		// 13 - 12
	menu_additem(menu, "\yAWP \w[Los Ammo od 1 do 4] \r[14000 $$]");		// 14 - 13

	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
	menu_setprop(menu, MPROP_EXITNAME, "Wyjscie")
	menu_setprop(menu, MPROP_NEXTNAME, "Dalej")
	menu_setprop(menu, MPROP_BACKNAME, "Wroc")
	menu_display(id, menu, 0)
	return PLUGIN_HANDLED
}

public Sklep_Wieznia_Handler(id, menu, item)
{
	new day = jail_get_play_game_id();
	if(day == 1 || day == 2 || day == 3 || day == 4 || day == 6)
	{
		if(!is_user_alive(id))
		{
			ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Przepraszamy.. ^x04 Aby uzyc sklepu musisz byc zywy!");
			return PLUGIN_CONTINUE
		}
		if(!(get_user_team(id) == 1))
		{
			ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Przepraszamy.. ^x03 Ten sklep jest tylko dla^x04 WIEZNIOW!");
			return PLUGIN_CONTINUE;
		}	
		switch(item)
		{
			case 0:
			{
				if(cs_get_user_money(id) < 5000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz tylu pieniedzy!");
					return PLUGIN_CONTINUE;
				}
				cs_set_user_money(id, cs_get_user_money(id) -5000);
				if(get_user_health(id) > 150)
				{
					set_user_health(id, 200);
				}
				else
				{
					set_user_health(id, get_user_health(id) +50);
				}
				ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x04 Dlon Boga!");
			}
			case 1:
			{
				if(cs_get_user_money(id) < 4000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz tylu pieniedzy!");
					return PLUGIN_CONTINUE;
				}
				if(get_user_flags(id) & SVIP)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Przepraszamy.. ^x04Jako SuperVIP posiadasz juz Niemilosierny Skok!");
					return PLUGIN_CONTINUE;
				}
				else
				{
					cs_set_user_money(id, cs_get_user_money(id) -4000);
					autobh[id] = true;
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x4 Niemilosierny Skok!");
				}
			}
			case 2:
			{
				if(cs_get_user_money(id) < 16000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz tylu pieniedzy!");
					return PLUGIN_CONTINUE;
				}
				cs_set_user_money(id, cs_get_user_money(id) -16000);
				bieg[id] = true;
				ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x4 Kapcie Cygana!");
			}
			case 3:
			{
				if(cs_get_user_money(id) < 7000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz tylu pieniedzy!");
					return PLUGIN_CONTINUE;
				}
				cs_set_user_money(id, cs_get_user_money(id) -7000);
				set_user_gravity(id, 0.5);
				ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x4 Nieziemska Noc!");
			}
			case 4:
			{
				if(cs_get_user_money(id) < 7000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz tylu pieniedzy!");
					return PLUGIN_CONTINUE;
				}
				if(get_user_flags(id) & SVIP && get_user_flags(id) & VIP)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Przepraszamy.. ^x04Jako VIP & SuperVIP posiadasz juz Nieziemska Noc");
					return PLUGIN_CONTINUE;
				}
				else
				{
					cs_set_user_money(id, cs_get_user_money(id) -7000);
					ilosc_skokow_gracza[id] = 2;
					skok[id] = true;
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x4 Wyskokowe Klapki!");
				}
			}
			case 5:
			{
				if(cs_get_user_money(id) < 9000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz tylu pieniedzy!");
					return PLUGIN_CONTINUE;
				}
				cs_set_user_money(id, cs_get_user_money(id) -9000);
				moc[id] = true;
				ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x4 Power Punch!");
			}
			case 6:
			{
				if(cs_get_user_money(id) < 2500)
				{
					ColorChat(id, RED, "** Sklep JB ** ^x01Nie masz tylu pieniedzy!");
					return PLUGIN_CONTINUE;
				}
				if(get_user_flags(id) & SVIP)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Przepraszamy.. ^x04Jako SuperVIP posiadasz juz Palestynskie Cichobiegi");
					return PLUGIN_CONTINUE;
				}
				else
				{
					cs_set_user_money(id, cs_get_user_money(id) -2500);
					set_user_footsteps(id, 1);
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x04 Palestynskie Cichobiegi!");
				}
			}
			case 7:
			{
				if(cs_get_user_money(id) < 6000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz tylu pieniedzy.");
					return PLUGIN_CONTINUE;
				}
				cs_set_user_money(id, cs_get_user_money(id) -6000);
				give_item(id, "weapon_hegrenade");
				ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x4 Odlamek wojenny!");
			}
			case 8:
			{
				if(cs_get_user_money(id) < 3000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz tylu pieniedzy.");
					return PLUGIN_CONTINUE;
				}
				cs_set_user_money(id, cs_get_user_money(id) -3000);
				give_item(id, "weapon_smokegrenade");
				ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x4 Pomoc Dymna!");
			}
			case 9:
			{
				if(cs_get_user_money(id) < 4000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz tylu pieniedzy.");
					return PLUGIN_CONTINUE;
				}
				cs_set_user_money(id, cs_get_user_money(id) -4000);
				give_item(id, "weapon_flashbang");
				ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x4 Krowie mleko!");
			}
			case 10:
			{
				if(cs_get_user_money(id) < 14000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz tylu pieniedzy.");
					return PLUGIN_CONTINUE;
				}
				cs_set_user_money(id, cs_get_user_money(id) -14000);
				new los_ammo = random_num(1,3)
				fm_give_item(id, "weapon_deagle");
				new weapon_id = find_ent_by_owner(-1, "weapon_deagle", id)
				if(weapon_id, los_ammo)
				cs_set_weapon_ammo(weapon_id, los_ammo)
				ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x04 Deagle z^x03 %d ^x04 Ammo !!", los_ammo);
			}
			case 11:
			{
				if(cs_get_user_money(id) < 14000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz Tyle Dolarow !!");
					return PLUGIN_CONTINUE;
				}
				cs_set_user_money(id, cs_get_user_money(id) -14000);
				new los_ammo = random_num(1,4)
				fm_give_item(id, "weapon_usp");
				new weapon_id = find_ent_by_owner(-1, "weapon_usp", id)
				if(weapon_id, los_ammo)
				cs_set_weapon_ammo(weapon_id, los_ammo)
				ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x04 USP z^x03 %d ^x04 Ammo !!", los_ammo);
			}
			case 12:
			{
				if(cs_get_user_money(id) < 14000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz Tyle Dolarow !!");
					return PLUGIN_CONTINUE;
				}
				cs_set_user_money(id, cs_get_user_money(id) -14000);
				new los_ammo = random_num(1,3)
				fm_give_item(id, "weapon_scout");
				new weapon_id = find_ent_by_owner(-1, "weapon_scout", id)
				if(weapon_id, los_ammo)
				cs_set_weapon_ammo(weapon_id, los_ammo)
				ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x01 Scout'a z^x03 %d ^x4 Ammo !!", los_ammo);
			}
			case 13:
			{
				if(cs_get_user_money(id) < 14000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz Tyle Dolarow !!");
					return PLUGIN_CONTINUE;
				}
				cs_set_user_money(id, cs_get_user_money(id) -14000);
				new los_ammo = random_num(1,2)
				fm_give_item(id, "weapon_awp");
				new weapon_id = find_ent_by_owner(-1, "weapon_awp", id)
				if(weapon_id, los_ammo)
				cs_set_weapon_ammo(weapon_id, los_ammo)
				ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x04 AWP z^x03 %d ^x04 Ammo !!", los_ammo);
			}
		}
	}
	else
		ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Przepraszamy.. ^x04 Na zabawach nie mozna uzywac sklepu.");

	return PLUGIN_CONTINUE;
}

public Sklep_Klawisza(id)
{
	new menu, formats[64];
	formatex(formats, charsmax(formats), "Twoje Dolary: \r%i^n\wSklep \rKlawisza \wza \yDolary:", cs_get_user_money(id))
	menu = menu_create(formats, "Sklep_Klawisza_Handler");

	menu_additem(menu, "\yDlon Boga \w[+50 HP]\r[4000 $$]");			// 1 - 0
	menu_additem(menu, "\yNiemilosierny Skok \w[AutoBH]\r[4000 $$]");		// 2 - 1
	menu_additem(menu, "\yKapcie Cygana \w[Wieksza Predkosc]\r[12000 $$]");	// 3 - 2
	menu_additem(menu, "\yNieziemska Moc \w[Mniejsza Grawitacja]\r[6000 $$]");	// 4 - 3
	menu_additem(menu, "\yWyskokowe Klapki \w[Potrojny Skok]\r[7000 $$]");		// 5 - 4
	menu_additem(menu, "\yPower Punch \w[Podwojne Obrazenia]\r[9000 $$]");		// 6 - 5
	menu_additem(menu, "\yPalestynskie Cichobiegi \w[Ciche Chodzenie]\r[1500 $$]");		// 7 - 6

	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
	menu_setprop(menu, MPROP_EXITNAME, "Wyjscie")
	menu_setprop(menu, MPROP_NEXTNAME, "Dalej")
	menu_setprop(menu, MPROP_BACKNAME, "Wroc")
	menu_display(id, menu, 0)
	return PLUGIN_HANDLED
}

public Sklep_Klawisza_Handler(id, menu, item)
{
	new day = jail_get_play_game_id();
	if(day == 1 || day == 2 || day == 3 || day == 4 || day == 6)
	{
		if(!is_user_alive(id))
		{
			ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Przepraszamy.. ^x04 Aby uzyc sklepu musisz byc zywy!");
			return PLUGIN_CONTINUE
		}
		if(!(get_user_team(id) == 2))
		{
			ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Przepraszamy.. ^x03 Ten sklep jest tylko dla^x04 KLAWISZY!");
			return PLUGIN_CONTINUE;
		}
		switch(item)
		{
			case 0:
			{
				if(cs_get_user_money(id) < 4000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz tylu pieniedzy!");
					return PLUGIN_CONTINUE;
				}
				cs_set_user_money(id, cs_get_user_money(id) -4000);
				if(get_user_health(id) > 150)
				{
					set_user_health(id, 250)
				}
				else
				{
					set_user_health(id, get_user_health(id) +50)
				}
				ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles ^x04Dlon Boga!");
			}
			case 1:
			{
				if(cs_get_user_money(id) < 4000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz tylu pieniedzy!");
					return PLUGIN_CONTINUE;
				}
				if(get_user_flags(id) & VIP)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Przepraszamy.. ^x04Jako SuperVIP posiadasz juz Niemilosierny skok!");
					return PLUGIN_CONTINUE;
				}
				else
				{
					cs_set_user_money(id, cs_get_user_money(id) -4000);
					autobh[id] = true;
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x4 Niemilosierny skok!");
				}
			}
			case 2:
			{
				if(cs_get_user_money(id) < 12000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz tylu pieniedzy!");
					return PLUGIN_CONTINUE;
				}
				cs_set_user_money(id, cs_get_user_money(id) -12000);
				jail_set_user_speed(id, fm_get_user_maxspeed(id) +500.0);
				//bieg[id] = true;
				ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x4 Kapcie Cygana!");
			}
			case 3:
			{
				if(cs_get_user_money(id) < 9000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz tylu pieniedzy!");
					return PLUGIN_CONTINUE;
				}
				cs_set_user_money(id, cs_get_user_money(id) -9000);
				set_user_gravity(id, 0.5);
				ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x4 Nieziemska Moc!");
			}
			case 4:
			{
				if(cs_get_user_money(id) < 7000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz tylu pieniedzy!");
					return PLUGIN_CONTINUE;
				}
				if(get_user_flags(id) & SVIP && get_user_flags(id) & VIP)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Przepraszamy.. ^x04Jako VIP & SuperVIP posiadasz juz Wyskokowe Klapki!");
					return PLUGIN_CONTINUE;
				}
				else
				{
					cs_set_user_money(id, cs_get_user_money(id) -7000);
					ilosc_skokow_gracza[id] = 2;
					skok[id] = true;
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x4 Wyskokowe Klapki!");
				}
			}
			case 5:
			{
				if(cs_get_user_money(id) < 9000)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Nie masz tylu dolarow!");
					return PLUGIN_CONTINUE;
				}
				cs_set_user_money(id, cs_get_user_money(id) -9000);
				moc[id] = true;
				ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x4 Power Punch!");
			}
			case 6:
			{
				if(cs_get_user_money(id) < 1500)
				{
					ColorChat(id, RED, "** Sklep JB ** ^x01Nie masz tylu pieniedzy!");
					return PLUGIN_CONTINUE;
				}
				if(get_user_flags(id) & SVIP)
				{
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Przepraszamy.. ^x04Jako SuperVIP posiadasz juz Palestynskie Cichobiegi!");
					return PLUGIN_CONTINUE;
				}
				else
				{
					cs_set_user_money(id, cs_get_user_money(id) -1500);
					set_user_footsteps(id, 1);
					ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Kupiles^x04 Palestynskie Cichobiegi!");
				}
			}
		}
	}
	else
		ColorChat(id, RED, "** Sklep-JailBreak ** ^x01Przepraszamy.. ^x04 Na zabawach nie mozna uzywac sklepu!");

	return PLUGIN_CONTINUE;
}

public ruletka(id)
{
	new day = jail_get_play_game_id();
	if(day == 1 || day == 2 || day == 3 || day == 4 || day == 6)
	{
		if(!is_user_alive(id))
		{
			ColorChat(id, RED,"** Ruletka-JailBreak ** ^x01Przepraszamy..^x04 Aby uzyc ruletki musisz byc zywy!");
			return PLUGIN_CONTINUE
		}
		if(uzyl[id])
		{
			new odczekanie = CZAS - odliczanie[id];
			ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Ruletka bedzie dostepna za:^x04 %d ^x01sekund, Czekasz juz:^x04 %d ^x01sekund", CZAS, odczekanie);
			return PLUGIN_CONTINUE
		}
		if(get_user_team(id) == 1)
		{
			switch(random_num(1, 20))
			{
				case 1:	ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Niestety nic nie wylosowales ^x04 :(");
				case 2:
				{
					fm_set_user_health(id, 255);
					ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales ^x04 255 HP^x01 !!");
				}
				case 3:
				{
					new los_ammo = random_num(0,5)
					fm_give_item(id, "weapon_usp");
					new weapon_id = find_ent_by_owner(-1, "weapon_usp", id)
					if(weapon_id)
					cs_set_weapon_ammo(weapon_id, los_ammo)
					ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales USP z ^x04 %d ^x01 Ammo !!", los_ammo);
				}
				case 4:
				{
					new los_ammo = random_num(0,3)
					fm_give_item(id, "weapon_deagle");
					new weapon_id = find_ent_by_owner(-1, "weapon_deagle", id)
					if(weapon_id)
					cs_set_weapon_ammo(weapon_id, los_ammo)
					ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales Deagle z ^x04 %d ^x01 Ammo !!", los_ammo);
				}
				case 5:
				{
					new los_ammo = random_num(0,3)
					fm_give_item(id, "weapon_scout");
					new weapon_id = find_ent_by_owner(-1, "weapon_scout", id)
					if(weapon_id)
					cs_set_weapon_ammo(weapon_id, los_ammo)
					ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales Scout'a z ^x04 %d ^x01 Ammo !!", los_ammo);
				}
				case 6:
				{
					new los_ammo = random_num(0,2)
					fm_give_item(id, "weapon_awp");
					new weapon_id = find_ent_by_owner(-1, "weapon_awp", id)
					if(weapon_id)
					cs_set_weapon_ammo(weapon_id, los_ammo)
					ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales AWP z ^x04 %d ^x01 Ammo !!", los_ammo);
				}
				case 7:
				{
					new los_granaty = random_num(-0,3)
					new henum=(user_has_weapon(id, CSW_HEGRENADE)?cs_get_user_bpammo(id, CSW_HEGRENADE):0);
					give_item(id, "weapon_hegrenade");
					++henum;
					cs_set_user_bpammo(id, CSW_HEGRENADE, los_granaty);
					ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales^x04 %d ^x01Granatow HE !!", los_granaty);
				}
				case 8:
				{
					new los_granaty = random_num(-0,4)
					new fbnum=(user_has_weapon(id, CSW_FLASHBANG)?cs_get_user_bpammo(id, CSW_FLASHBANG):0);
					give_item(id, "weapon_flashbang");
					++fbnum;
					cs_set_user_bpammo(id, CSW_FLASHBANG, los_granaty);
					ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales^x04 %d ^x01Granatow FLASH !!", los_granaty);
				}
				case 9:
				{
					new los_granaty = random_num(-0,2)
					new sgnum=(user_has_weapon(id, CSW_SMOKEGRENADE)?cs_get_user_bpammo(id, CSW_SMOKEGRENADE):0);
					give_item(id, "weapon_smokegrenade");
					++sgnum;
					cs_set_user_bpammo(id, CSW_SMOKEGRENADE, los_granaty);
					ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales^x04 %d ^x01Granatow SMOKE !!", los_granaty);
				}
				case 10:
				{
					bieg[id] = true;
					ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales ^x04Szybkosc (^x01Speed'a!^x04) ^x01!!");
				}
				case 11:
				{
					set_user_gravity(id, 0.5);
					ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales ^x04Zmniejszona Grawitacje ^x01!!");
				}
				case 12:
				{
					if(get_user_flags(id) & SVIP || get_user_flags(id) & VIP)
					{
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Masz szczescie ze jestes VIP'em lub SuperVIP'em! ^x04Zostales uratowany przed losowym HP od smierci do 99 HP !!");
						return PLUGIN_CONTINUE;
					}
					else
					{
						new los_hp1 = random_num(-1,99)
						fm_set_user_health(id, los_hp1);
						ColorChat(id, RED,"** Ruletka-JailBreak ** ^x01Wylosowales^x04 %d ^x01HP :(", los_hp1);
					}
				}
				case 13:
				{
					if(get_user_flags(id) & SVIP || get_user_flags(id) & VIP)
					{
						moc[id] = true;
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales 3 skoki ktore VIP lub SuperVIP juz posiada, ^x04 Nagroda zostala zamieniona na Podwojne Obrazenia!");
						return PLUGIN_CONTINUE;
					}
					else
					{
						ilosc_skokow_gracza[id] = 2;
						skok[id] = true;
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales^x04 3 ^x01skoki !!");
					}
				}
				case 14:
				{
					if(get_user_flags(id) & SVIP)
					{
						fm_set_user_health(id, 255)
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales AutoBH ktore SuperVIP juz posiada. ^x04 Nagroda zostala zamieniona na 255 HP :)");
						return PLUGIN_CONTINUE;
					}
					else
					{
						autobh[id] = true;
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales ^x04AutoBH^x01 !!");
					}
				}
				case 15:
				{
					moc[id] = true;
					ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales ^x04Podwojne Obrazenia^x01 !!");
				}
				case 16:
				{
					if(get_user_flags(id) & SVIP || get_user_flags(id) & VIP)
					{
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Masz szczescie ze jestes VIP'em lub SuperVIP'em! ^x04Zostales uratowany przed 1 HP!");
						return PLUGIN_CONTINUE;
					}
					else
					{
						fm_set_user_health(id, 1);
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales^x04 1 ^x01HP :(");
					}
				}
				case 17:
				{
					if(get_user_flags(id) & SVIP || get_user_flags(id) & VIP)
					{
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Masz szczescie ze jestes VIP'em lub SuperVIP'em! ^x04Zostales uratowany przed smiercia !!");
						return PLUGIN_CONTINUE;
					}
					else
					{
						fm_user_kill(id);
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales ^x04Smierc^x01 :(");
					}
				}
				case 18:
				{
					fm_give_item(id, "weapon_hegrenade");
					fm_give_item(id, "weapon_flashbang");
					fm_give_item(id, "weapon_flashbang");
					fm_give_item(id, "weapon_smokegrenade");
					ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales ^x04Zestaw Granatow^x01 !!");
				}
				case 19:
				{
					if(get_user_flags(id) & SVIP || get_user_flags(id) & VIP)
					{
						fm_give_item(id, "weapon_hegrenade");
						fm_give_item(id, "weapon_flashbang");
						fm_give_item(id, "weapon_flashbang");
						fm_give_item(id, "weapon_smokegrenade");
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales Kamizelke ktora VIP lub SuperVIP juz posiada, ^x04Nagroda zostala zamieniona na Zestaw Grnatow !! :)");
						return PLUGIN_CONTINUE;
					}
					else
					{
						fm_give_item(id, "item_kevlar");
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales ^x04KEVLAR (Kamizelke)^x01 !!");
					}
				}
				case 20:
				{
					get_user_name(id, nicki[id], 63);
					client_cmd(0, "mp3 play sound/jb_skull/jb_pierd.mp3");
					ColorChat(id, RED, "** Ruletka-JailBreak **^x01 Wylosowales ^x04Pierdniecie");
					set_hudmessage(0, 255, 0, -1.0, 0.3, 0, 4.0, 12.0)
					ShowSyncHudMsg(0, sync, "%s - ma gazy!", nicki[id])	
				}
			}
		}
		if(get_user_team(id) == 2)
		{
			switch(random_num(1, 12))
			{
				case 1:	ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Niestety nic nie wylosowales ^x04 :(");
				case 2:
				{
					fm_set_user_health(id, 255);
					ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales ^x04 255 HP^x01 !!");
				}
				case 3:
				{
					bieg[id] = true;
					ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales ^x04Szybkosc (^x01Speed'a!^x04) ^x01!!")
				}
				case 4:
				{
					set_user_gravity(id, 0.5);
					ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales ^x04Zmniejszona Grawitacje ^x01!!");
				}
				case 5:
				{
					if(get_user_flags(id) & SVIP || get_user_flags(id) & VIP)
					{
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Masz szczescie ze jestes VIP'em lub SuperVIP'em! ^x04Zostales uratowany przed losowym HP od śmierci do 100 HP !!");
						return PLUGIN_CONTINUE;
					}
					else
					{
						new los_hp1 = random_num(-1,100)
						fm_set_user_health(id, los_hp1);
						ColorChat(id, RED,"** Ruletka-JailBreak ** ^x01Wylosowales^x04 %d ^x01HP :(", los_hp1);
					}
				}
				case 6:
				{
					if(get_user_flags(id) & SVIP || get_user_flags(id) & VIP)
					{
						moc[id] = true;
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales 3 skoki ktore VIP lub SuperVIP juz posiada, ^x04 Nagroda zostala zamieniona na Podwojne Obrazenia !! :)");
						return PLUGIN_CONTINUE;
					}
					else
					{
						ilosc_skokow_gracza[id] = 2;
						skok[id] = true;
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales^x04 3 ^x01skoki !!");
					}
				}
				case 7:
				{
					if(get_user_flags(id) & SVIP)
					{
						fm_set_user_health(id, 355);
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales AutoBH ktore SuperVIP juz posiada, ^x04 Nagroda zostala zamieniona na 355 HP !! :)");
						return PLUGIN_CONTINUE;
					}
					else
					{
						autobh[id] = true
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales^x04 AutoBH !!");
					}
				}
				case 8:
				{
					moc[id] = true;
					ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales ^x04Podwojne Obrazenia^x01 !!");
				}
				case 9:
				{
					if(get_user_flags(id) & SVIP || get_user_flags(id) & VIP)
					{
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Masz szczescie ze jestes VIP'em lub SuperVIP'em! ^x04Zostales uratowany przed 1 HP !!");
						return PLUGIN_CONTINUE;
					}
					else
					{
						fm_set_user_health(id, 1);
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales^x04 1 ^x01HP :(");
					}
				}
				case 10:
				{
					if(get_user_flags(id) & SVIP || get_user_flags(id) & VIP)
					{
						bieg[id] = true;
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales Kamizelke ktora VIP lub SuperVIP juz posiada, ^x04Nagroda zostala zamieniona na Speed'a !! :)");
						return PLUGIN_CONTINUE;
					}
					else
					{
						fm_give_item(id, "item_kevlar");
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales ^x04KEVLAR (Kamizelke)^x01 !!");
					}
				}
				case 11:
				{
					if(get_user_flags(id) & SVIP || get_user_flags(id) & VIP)
					{
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Masz szczescie ze jestes VIP'em SuperVIP'em! ^x04Zostales uratowany przed 'Posiadasz tylko palke' ! :)");
						return PLUGIN_CONTINUE;
					}
					else
					{
						fm_strip_user_weapons(id);
						fm_give_item(id, "weapon_knife");
						ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Wylosowales ^x04ze posiadasz tylko Palke !! :(");
					}
				}
				case 12:
				{
					get_user_name(id, nicki[id], 63);
					client_cmd(0, "mp3 play sound/jb_skull/jb_pierd.mp3");
					ColorChat(id, RED, "** Ruletka-JailBreak **^x01 Wylosowales ^x04Pierdniecie");
					set_hudmessage(0, 255, 0, -1.0, 0.3, 0, 4.0, 12.0)
					ShowSyncHudMsg(0, sync, "%s - ma gazy!", nicki[id])	
				}
			}
		}
		uzyl[id] = true;
		odliczanie[id] = CZAS;
		set_task(1.0, "zakoncz", id);
	}
	else
		ColorChat(id, RED, "** Ruletka-JailBreak ** ^x01Przepraszamy.. ^x04 Na zabawach nie mozna uzywac ruletki!");

	return PLUGIN_CONTINUE;
}

public zakoncz(id)
{
	if(odliczanie[id] > 0)
	{
		odliczanie[id]--;
		set_task(1.0, "zakoncz", id);
	}
	else
	{
		uzyl[id] = false;
		remove_task(id)	;
	}
}

public DeathMsg()
{
	new day = jail_get_play_game_id();
	if(day == 1 || day == 2 || day == 3 || day == 4 || day == 6)
	{
		new kid = read_data(1)
		new vid = read_data(2)
	
		if(kid == vid)
			return PLUGIN_CONTINUE;

		if(is_user_connected(kid) || is_user_connected(vid))
			create_itm(vid, 0)
	}
	return PLUGIN_CONTINUE;
}

public create_itm(id, id_item)
{
	new Float:origins[3]
	pev(id,pev_origin,origins);
	new entit=create_entity("info_target")
	
	origins[0]+=50.0
	origins[2]-=32.0
	
	set_pev(entit,pev_origin,origins)
	entity_set_model(entit, "models/jb_skull/jb_Bonusy_v1.mdl");
	set_pev(entit,pev_classname,"paczka");
	
	dllfunc(DLLFunc_Spawn, entit); 
	set_pev(entit,pev_solid,SOLID_BBOX); 
	set_pev(entit,pev_movetype,MOVETYPE_FLY);
	
	engfunc(EngFunc_SetSize,entit,{-1.1, -1.1, -1.1},{1.1, 1.1, 1.1});
	engfunc(EngFunc_DropToFloor,entit);
	
	set_pev(entit, pev_iuser1, id_item)
}

public fwd_touch(ent,id)
{
	if(!is_user_alive(id))
		return FMRES_IGNORED;

	if(!pev_valid(ent))
		return FMRES_IGNORED;
	
	static classname[32];
	pev(ent, pev_classname, classname, 31); 
	
	if(!equali(classname, "paczka"))
		return FMRES_IGNORED;
	
	if(pev(id, pev_button))
	{
		WybierzTeam(id)
		engfunc(EngFunc_RemoveEntity, ent);
	}
	return FMRES_IGNORED; 
}

public WybierzTeam(id)
{
	new day = jail_get_play_game_id();
	if(day == 1 || day == 2 || day == 3 || day == 4 || day == 6)
	{
		if(!is_user_connected(id) || !is_user_alive(id))
			return PLUGIN_HANDLED;

		if(get_user_team(id) == 1)
		{
			switch(random_num(1, 20))
			{
				case 1:
				{
					get_user_name(id, nicki[id], 63);
					client_cmd(0, "mp3 play sound/jb_skull/jb_pierd.mp3");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Pierdniecie");
					set_hudmessage(0, 255, 0, -1.0, 0.3, 0, 4.0, 12.0)
					ShowSyncHudMsg(0, sync, "%s sie zesral.", nicki[id])	
				}
				case 2:
				{
					fm_give_item(id, "weapon_flashbang");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Granat FLASH");
				}
				case 3: ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04NIC !^x01 :D");	
				case 4:
				{
					get_user_name(id, nicki[id], 63);
					client_cmd(0, "mp3 play sound/jb_skull/jb_pierd.mp3");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Pierdniecie");
					set_hudmessage(0, 255, 0, -1.0, 0.3, 0, 4.0, 12.0)
					ShowSyncHudMsg(0, sync, "%s - sie zesral!", nicki[id])	
				}
				case 5:
				{
					fm_give_item(id, "weapon_hegrenade");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Granat HE");
				}
				case 6:
				{
					fm_give_item(id, "weapon_hegrenade");
					fm_give_item(id, "weapon_flashbang");
					fm_give_item(id, "weapon_flashbang");
					fm_give_item(id, "weapon_smokegrenade");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Zestaw Granatow !^x01 :)");
				}
				case 7:
				{
					get_user_name(id, nicki[id], 63);
					client_cmd(0, "mp3 play sound/jb_skull/jb_pierd.mp3");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Pierdniecie");
					set_hudmessage(0, 255, 0, -1.0, 0.3, 0, 4.0, 12.0)
					ShowSyncHudMsg(0, sync, "%s - sie zesral!", nicki[id])	
				}
				case 8:
				{
					fm_give_item(id, "weapon_smokegrenade");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04SMOKE");
				}
				case 9:
				{
					fm_user_kill(id);
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Smierc!^x01 :(");
				}
				case 10:
				{
					new los_hpminus = random_num(1,100)
					fm_set_user_health(id, los_hpminus);
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales^x04 %d HP !^x01 :(", los_hpminus);
				}
				case 11:
				{
					get_user_name(id, nicki[id], 63);
					client_cmd(0, "mp3 play sound/jb_skull/jb_pierd.mp3");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Pierdniecie");
					set_hudmessage(0, 255, 0, -1.0, 0.3, 0, 4.0, 12.0)
					ShowSyncHudMsg(0, sync, "%s - sie zesral!", nicki[id])	
				}
				case 12:
				{
					fm_set_user_health(id, 255);
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales^x04 255 HP !^x01 :O");
				}
				case 13:
				{
					set_user_gravity(id, 0.5);
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales^x04 Gravitacje!");
				}
				case 14:
				{
					moc[id] = true;
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales^x04 Podwojne Obrazenia!");
				}
				case 15:
				{
					new los_ammo = random_num(0,3)
					fm_give_item(id, "weapon_scout");
					new weapon_id = find_ent_by_owner(-1, "weapon_scout", id)
					if(weapon_id)
					cs_set_weapon_ammo(weapon_id, los_ammo)
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales^x04 Scout'a z ^x03 %d ^x01 Ammo !!", los_ammo);
				}
				case 16:
				{
					new los_ammo = random_num(0,2)
					fm_give_item(id, "weapon_awp");
					new weapon_id = find_ent_by_owner(-1, "weapon_awp", id)
					if(weapon_id)
					cs_set_weapon_ammo(weapon_id, los_ammo)
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales^x04 AWP z ^x03 %d ^x01 Ammo !!", los_ammo);
				}
				case 17:
				{
					new los_joint = random_num(500, 600)
					cs_set_user_money(id, cs_get_user_money(id) +los_joint);
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales^x04 %d ^x01Dolarow !!", los_joint);
				}
				case 18:
				{
					new los_joint = random_num(400, 600)
					cs_set_user_money(id, cs_get_user_money(id) +los_joint);
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales^x04 %d ^x01Dolarow !!", los_joint);
				}
				case 19:
				{
					get_user_name(id, nicki[id], 63);
					client_cmd(0, "mp3 play sound/jb_skull/jb_pierd.mp3");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Pierdniecie");
					set_hudmessage(0, 255, 0, -1.0, 0.3, 0, 4.0, 12.0)
					ShowSyncHudMsg(0, sync, "%s - sie zesral!", nicki[id])	
				}
				case 20:
				{
					bieg[id] = true;
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales^x04 Szybkosc!");
				}
			}
		}
		if(get_user_team(id) == 2)
		{
			switch(random_num(1, 18))
			{
				case 1:
				{
					get_user_name(id, nicki[id], 63);
					client_cmd(0, "mp3 play sound/jb_skull/jb_pierd.mp3");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Pierdniecie");
					set_hudmessage(0, 255, 0, -1.0, 0.3, 0, 4.0, 12.0)
					ShowSyncHudMsg(0, sync, "%s - sie zesral!", nicki[id])
				}
				case 2:
				{
					fm_give_item(id, "weapon_hegrenade");
					fm_give_item(id, "weapon_flashbang");
					fm_give_item(id, "weapon_flashbang");
					fm_give_item(id, "weapon_smokegrenade");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Zestaw Granatow !^x01 :)");	
				}
				case 3: ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04NIC !^x01 :D");	
				case 4:
				{
					get_user_name(id, nicki[id], 63);
					client_cmd(0, "mp3 play sound/jb_skull/jb_pierd.mp3");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Pierdniecie");
					set_hudmessage(0, 255, 0, -1.0, 0.3, 0, 4.0, 12.0)
					ShowSyncHudMsg(0, sync, "%s - sie zesral!", nicki[id])	
				}
				case 5:
				{
					fm_strip_user_weapons(id);
					fm_give_item(id, "weapon_knife");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Ze masz tylko noz !^x01 :(");
				}
				case 6:
				{
					fm_give_item(id, "weapon_hegrenade");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Granat HE");
				}
				case 7:
				{
					get_user_name(id, nicki[id], 63);
					client_cmd(0, "mp3 play sound/jb_skull/jb_pierd.mp3");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Pierdniecie");
					set_hudmessage(0, 255, 0, -1.0, 0.3, 0, 4.0, 12.0)
					ShowSyncHudMsg(0, sync, "%s - sie zesral!", nicki[id])	
				}
				case 8:
				{
					fm_give_item(id, "weapon_flashbang");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Granat FLASH");
				}
				case 9:
				{
					fm_give_item(id, "weapon_smokegrenade");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04SMOKE");
				}
				case 10:
				{
					new los_hpminus = random_num(1,100)
					fm_set_user_health(id, los_hpminus);
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales^x04 %d HP !^x01 :(", los_hpminus);
				}
				case 11:
				{
					get_user_name(id, nicki[id], 63);
					client_cmd(0, "mp3 play sound/jb_skull/jb_pierd.mp3");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Pierdniecie");
					set_hudmessage(0, 255, 0, -1.0, 0.3, 0, 4.0, 12.0)
					ShowSyncHudMsg(0, sync, "%s - sie zesral!", nicki[id])	
				}
				case 12:
				{
					fm_set_user_health(id, 355);
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales^x04 255 HP !^x01 :O");
				}
				case 13:
				{
					set_user_gravity(id, 0.5);
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales^x04 Gravitacje!");
				}
				case 14:
				{
					moc[id] = true;
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales^x04 Podwojne Obrazenia!");
				}
				case 15:
				{
					new los_joint = random_num(500, 600)
					cs_set_user_money(id, cs_get_user_money(id) +los_joint);
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales^x04 %d ^x01Dolarow !!", los_joint);
				}
				case 16:
				{
					new los_joint = random_num(400, 600)
					cs_set_user_money(id, cs_get_user_money(id) +los_joint);
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales^x04 %d ^x01Dolarow !!", los_joint);
				}
				case 17:
				{
					get_user_name(id, nicki[id], 63);
					client_cmd(0, "mp3 play sound/jb_skull/jb_pierd.mp3");
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales ^x04Pierdniecie")
					set_hudmessage(0, 255, 0, -1.0, 0.3, 0, 4.0, 12.0)
					ShowSyncHudMsg(0, sync, "%s - sie zesral!", nicki[id])	
				}
				case 18:
				{
					bieg[id] = true;
					ColorChat(id, RED, "**Bonusy-JailBreak**^x01 Zebrales^x04 Szybkosc!");
				}
			}
		}
	}
	return PLUGIN_HANDLED;
}

public kill_all_entity(classname[])
{
	new iEnt = find_ent_by_class(-1, classname)
	while(iEnt > 0)
	{
		remove_entity(iEnt)
		iEnt = find_ent_by_class(iEnt, classname)		
	}
}

public CurWeapon(id)
{
	if(bieg[id] == true)
	//fm_set_user_maxspeed(id, fm_get_user_maxspeed(id) +500.0);
	{
		jail_set_user_speed(id, fm_get_user_maxspeed(id) +500.0);
	}
}

public Fw_HamPlayerTakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
	if(!is_user_connected(this) || !is_user_connected(idattacker) || !moc[idattacker])
		return 1
	
	if(idattacker != 0 && is_user_alive(idattacker) && moc[idattacker])
		SetHamParamFloat(4, damage * 2.0)

	return 1
}

public CmdStart(id, uc_handle)
{
	if(!is_user_alive(id) || !skok[id])
		return FMRES_IGNORED;

	new flags = pev(id, pev_flags);
	if((get_uc(uc_handle, UC_Buttons) & IN_JUMP) && !(flags & FL_ONGROUND) && !(pev(id, pev_oldbuttons) & IN_JUMP) && ilosc_skokow_gracza[id] && skok[id])
	{
  		--ilosc_skokow_gracza[id];
  		new Float:velocity[3];
  		pev(id, pev_velocity, velocity);
  		velocity[2] = random_float(265.0,285.0);
  		set_pev(id, pev_velocity, velocity);
	}
	else if(flags & FL_ONGROUND && skok[id])
		ilosc_skokow_gracza[id] = 2;

	return FMRES_IGNORED;
}

public client_PreThink(id)
{
	if(autobh[id] == true)
	{
		entity_set_float(id, EV_FL_fuser2, 0.0)	

		if(entity_get_int(id, EV_INT_button) & 2)
		{
			new flags = entity_get_int(id, EV_INT_flags)
			
			if(flags & FL_WATERJUMP)
				return PLUGIN_CONTINUE

			if(entity_get_int(id, EV_INT_waterlevel) >= 2)
				return PLUGIN_CONTINUE

			if(!(flags & FL_ONGROUND))
				return PLUGIN_CONTINUE
			
			new Float:velocity[3]
			entity_get_vector(id, EV_VEC_velocity, velocity)
			velocity[2] += 250.0
			entity_set_vector(id, EV_VEC_velocity, velocity)
			entity_set_int(id, EV_INT_gaitsequence, 6)	
		}
	}
	return PLUGIN_CONTINUE	
}

public Koniec_Rundy()
{
	kill_all_entity("paczka")

	for(new i=1; i<=get_maxplayers(); i++)
	{
		if(is_user_connected(i))
		{
			speed[i] = false;
			autobh[i] = false;
			bieg[i] = false;
			ilosc_skokow_gracza[i] = false;
  			moc[i] = false;
			skok[i] = false;
			set_user_gravity(i, 1.0);
			set_user_footsteps(i, 0);

		}
	}
}