/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <cstrike>
#include <csx>
#include <colorchat>


new bool:ma_misje[33] = false;
new g_player_defuses[33], g_player_plants[33], g_player_headshots[33], firstblood, g_player_frags[33], g_class[64], g_class_id[33], g_mission[33], g_player_id[33], g_target[33], g_player_name[33];

public plugin_init() {
	register_plugin("COD:MW MOD Misje", "0.02beta", "MieTeK")
	
	register_event("DeathMsg", "DeathMsg", "a")
	
	register_clcmd("say /m", "menu_misje");
	register_clcmd("say /misje", "menu_misje");
	register_clcmd("say /sprawdz", "aktualna_misja");
	
	register_logevent("PoczatekRundy", 2, "1=Round_Start"); 
	
}

public client_connect(id)
{
	ma_misje[id] = false;
	g_mission[id] = 0;
	g_player_frags[id] = 0;
	g_class_id[id] = 0;
	g_player_id[id] = 0;
	g_target[id] = 0;
	g_player_headshots[id] = 0;
	g_player_plants[id] = 0;
	g_player_defuses[id] = 0;
}
	
public client_disconnect(id)
{
	ma_misje[id] = false;
	g_mission[id] = 0;
	g_player_frags[id] = 0;
	g_class_id[id] = 0;
	g_player_id[id] = 0;
	g_target[id] = 0;
	g_player_headshots[id] = 0;
	g_player_plants[id] = 0;
	g_player_defuses[id] = 0;
}

public PoczatekRundy()
{
	new info[201];
	for(new id=0;id<=32;id++)
	{
		new g_player_xp = cod_get_user_xp(id);
		if(!is_user_alive(id))
			continue;
		if(ma_misje[id])
		{
			if(3 < g_mission[id] <= 7)
			{
				format(info, 200, "[COD MISJE] Nie udalo Ci sie zapolowac na gracza, tracisz 100 XP!");
				ColorChat(id, RED, info)
				if(g_player_xp >= 100)
					cod_set_user_xp(id, g_player_xp-100);
				else
					cod_set_user_xp(id, 0)
				ma_misje[id] = false;
			}
			if(g_mission[id] == 8 && firstblood == 1)
			{
				format(info, 200, "[COD MISJE] Nie udalo Ci sie zabic jako pierwszy, tracisz 50 XP!");
				ColorChat(id, RED, info)
				if(g_player_xp >= 50)
					cod_set_user_xp(id, g_player_xp-50);
				else
					cod_set_user_xp(id, 0)
				ma_misje[id] = false;
			}
		}
		firstblood = 1;
	}
}

public bomb_planted(id)
{
	new info[201];
	if(ma_misje[id])
	{
		if( 12 < g_mission[id] <= 15)
		{
			g_player_plants[id]++;
			format(info, 200, "[COD MISJE] Podlozyles pake juz %i razy.", g_player_plants[id]);
			ColorChat(id, RED, info);
			SprawdzMisje(id);
		}
	}
}
	
	
public bomb_defused(id)
{
	new info[201];		
	if(ma_misje[id])
	{
		if( 15 < g_mission[id] <= 18)
		{
			g_player_defuses[id]++;
			format(info, 200, "[COD MISJE] Rozbroiles pake juz %i razy.", g_player_defuses[id]);
			ColorChat(id, RED, info);
			SprawdzMisje(id);
		}
	}
	return PLUGIN_CONTINUE;
}
	
public aktualna_misja(id)
{
	new info[201];
	if(!ma_misje[id])
	{
		format(info, 200, "[COD MISJE] Nie posiadasz aktualnie zadnej misji!");
		ColorChat(id, YELLOW, info);
	}
	else
	{
		if(0 < g_mission[id] <= 3)
		{
			format(info, 200, "[COD MISJE] Musisz zabic klase %s", g_class);
			ColorChat(id, BLUE, info);
		}
		if(3 < g_mission[id] <= 7)
		{
			format(info, 200, "[COD MISJE] Musisz upolowac gracza %s", g_player_name);
			ColorChat(id, BLUE, info);
		}
		if(g_mission[id] == 8)
		{
			format(info, 200, "[COD MISJE] Musisz zabic jako pierwszy");
			ColorChat(id, BLUE, info);
		}
		if(8 < g_mission[id]<= 12)
		{
			format(info, 200, "[COD MISJE] Musisz zabic headshootem");
			ColorChat(id, BLUE, info);
		}
		if(12 < g_mission[id]<= 15)
		{
			format(info, 200, "[COD MISJE] Musisz podkladac bomby");
			ColorChat(id, BLUE, info);
		}
		if(15 < g_mission[id] <= 18)
		{
			format(info, 200, "[COD MISJE] Musisz rozbrajac bomby");
			ColorChat(id, BLUE, info);
		}
	}
}
	
public DeathMsg()
{
	new info[201];
	new g_killer = read_data(1);
	new g_victim = read_data(2);
	new g_headshot = read_data(3);
	
	new g_player_xp = cod_get_user_xp(g_killer)
	new g_player_xp2 = cod_get_user_xp(g_victim)
	
	if(get_user_team(g_killer) != get_user_team(g_victim))
	{
		if(ma_misje[g_killer])
		{
			if(0 < g_mission[g_killer] <= 3 && cod_get_user_class(g_victim) == g_class_id[g_killer])
			{
				g_player_frags[g_killer]++;
				format(info, 200, "[COD MISJE] Zabiles juz %i razy %s", g_player_frags[g_killer], g_class);
				ColorChat(g_killer, RED, info)
			}
			if(3 < g_mission[g_killer] <= 7 && get_user_index(g_player_name) == g_target[g_killer])
			{
				if(g_mission[g_killer] == 4)
				{
					format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 50 EXP!");
					ColorChat(g_killer, GREEN, info)
					cod_set_user_xp(g_killer, g_player_xp+50);
				}
				if(g_mission[g_killer] == 5)
				{
					format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 100 EXP!");
					ColorChat(g_killer, GREEN, info)
					cod_set_user_xp(g_killer, g_player_xp+100);
				}
				if(g_mission[g_killer] == 6)
				{
					format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 200 EXP!");
					ColorChat(g_killer, GREEN, info)
					cod_set_user_xp(g_killer, g_player_xp+200);
				}
				if(g_mission[g_killer] == 7)
				{
					format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 500 EXP!");
					ColorChat(g_killer, GREEN, info)
					cod_set_user_xp(g_killer, g_player_xp+500);
				}
				ma_misje[g_killer] = false;
			}
			if(g_mission[g_killer] == 8 && firstblood == 1 && g_killer!=g_victim)
			{
				format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 200 EXP!");
				ColorChat(g_killer, GREEN, info)
				cod_set_user_xp(g_killer, g_player_xp+200);
				ma_misje[g_killer] = false;
				firstblood = 0;
			}
			if(8 < g_mission[g_killer] <= 12 && g_headshot)
			{
				g_player_headshots[g_killer]++;
				format(info, 200, "[COD MISJE] Zabiles juz %i razy headshootem", g_player_headshots[g_killer]);
				ColorChat(g_killer, RED, info)
			}
					
		}
	}
	if(ma_misje[g_victim])
	{
		if(3 < g_mission[g_victim] <= 7)
		{
			format(info, 200, "[COD MISJE] Nie udalo Ci sie zapolowac na gracza, tracisz 200 XP!");
			ColorChat(g_victim, RED, info)
			if(g_player_xp2 >= 100)
					cod_set_user_xp(g_victim, g_player_xp2-100);
				else
					cod_set_user_xp(g_victim, 0)
			ma_misje[g_victim] = false;
		}
	}
	SprawdzMisje(g_killer);

}

public SprawdzMisje(id)
{
	new info[201];
	new g_player_xp = cod_get_user_xp(id)
	/*if(ma_misje[id])
	{
		g_player_frags[id] = 0;
		g_player_headshots[id] = 0;
		return PLUGIN_CONTINUE;
	}*/
		
	if(g_mission[id] == 1 && g_player_frags[id] == 2)
	{
		format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 50 EXP!");
		ColorChat(id, GREEN, info)
		ma_misje[id] = false;
		g_player_frags[id] = 0;
		cod_set_user_xp(id, g_player_xp+50);
	}
	if(g_mission[id] == 2 && g_player_frags[id] == 4)
	{
		format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 100 EXP!");
		ColorChat(id, GREEN, info)
		ma_misje[id] = false;
		g_player_frags[id] = 0;
		cod_set_user_xp(id, g_player_xp+100);
	}
	if(g_mission[id] == 3 && g_player_frags[id] == 6)
	{
		format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 200 EXP!");
		ColorChat(id, GREEN, info)
		ma_misje[id] = false;
		g_player_frags[id] = 0;
		cod_set_user_xp(id, g_player_xp+200);
	}
	if(g_mission[id] == 9 && g_player_headshots[id] == 2)
	{
		format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 50 EXP!");
		ColorChat(id, GREEN, info)
		ma_misje[id] = false;
		g_player_headshots[id] = 0;
		cod_set_user_xp(id, g_player_xp+50);
	}
	if(g_mission[id] == 10 && g_player_headshots[id] == 4)
	{
		format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 100 EXP!");
		ColorChat(id, GREEN, info)
		ma_misje[id] = false;
		g_player_headshots[id] = 0;
		cod_set_user_xp(id, g_player_xp+100);
	}
	if(g_mission[id] == 11 && g_player_headshots[id] == 6)
	{
		format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 200 EXP!");
		ColorChat(id, GREEN, info)
		ma_misje[id] = false;
		g_player_headshots[id] = 0;
		cod_set_user_xp(id, g_player_xp+200);
	}
	if(g_mission[id] == 12 && g_player_headshots[id] == 8)
	{
		format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 500 EXP!");
		ColorChat(id, GREEN, info)
		ma_misje[id] = false;
		g_player_headshots[id] = 0;
		cod_set_user_xp(id, g_player_xp+500);
	}
	if(g_mission[id] == 13 && g_player_plants[id] == 2)
	{
		format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 50 EXP!");
		ColorChat(id, GREEN, info)
		cod_set_user_xp(id, g_player_xp+50);
		g_player_plants[id] = 0;
		ma_misje[id] = false;
	}
	if(g_mission[id] == 14 && g_player_plants[id] == 4)
	{
		format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 150 EXP!");
		ColorChat(id, GREEN, info)
		cod_set_user_xp(id, g_player_xp+150);
		g_player_plants[id] = 0;
		ma_misje[id] = false;
	}
	if(g_mission[id] == 15 && g_player_plants[id] == 8)
	{
		format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 450 EXP!");
		ColorChat(id, GREEN, info)
		cod_set_user_xp(id, g_player_xp+300);
		g_player_plants[id] = 0;
		ma_misje[id] = false;
	}
	if(g_mission[id] == 16 && g_player_defuses[id] == 2)
	{
		format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 50 EXP!");
		ColorChat(id, GREEN, info)
		cod_set_user_xp(id, g_player_xp+50);
		g_player_defuses[id] = 0;
		ma_misje[id] = false;
	}
	if(g_mission[id] == 17 && g_player_defuses[id] == 4)
	{
		format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 150 EXP!");
		ColorChat(id, GREEN, info)
		cod_set_user_xp(id, g_player_xp+150);
		g_player_defuses[id] = 0;
		ma_misje[id] = false;
	}
	if(g_mission[id] == 18 && g_player_defuses[id] == 8)
	{
		format(info, 200, "[COD MISJE] Gratulacje! Ukonczyles misje i dostajesz 450 EXP!");
		ColorChat(id, GREEN, info)
		cod_set_user_xp(id, g_player_xp+300);
		g_player_defuses[id] = 0;
		ma_misje[id] = false;
	}
	return PLUGIN_CONTINUE;
}
	

public menu_misje(id)
{
	if(!ma_misje[id])
	{
		new menu = menu_create("Menu misji \rby MieTeK", "misje_handler");
		
		menu_additem(menu, "Zabij klase");
		menu_additem(menu, "Zapoluj na gracza");
		menu_additem(menu, "Zabij jako pierwszy \r[200 EXP]");
		menu_additem(menu, "Zabij headshootem");
		menu_additem(menu, "Podloz pake");
		menu_additem(menu, "Rozbroj pake");
		
		menu_setprop(menu, MPROP_EXITNAME, "Wyjscie");
		menu_setprop(menu, MPROP_NEXTNAME, "Nastepna strona");
		menu_setprop(menu, MPROP_BACKNAME, "Poprzednia strona");
		
		menu_display(id, menu);
	}
	else
		menu_ma_misje(id)
}

public misje_handler(id, menu, item)
{
	new info[201];
	if(!is_user_alive(id) || !is_user_connected(id))
		return PLUGIN_CONTINUE;
		
	if(item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_CONTINUE;
	}
	
	switch(item)
	{
		case 0: class(id);
		case 1: polowanie(id);
		case 2:
		{
			ma_misje[id] = true;
			g_mission[id] = 8;
			format(info, 200, "[COD MISJE] Wybrales misje. Zabij jako pierwszy w rundzie. Nagroda 200 EXP");
			ColorChat(id, BLUE, info)
		}
		case 3: headshoot(id);
		case 4: bomberman(id);
		case 5: defuser(id);
	}
	return PLUGIN_CONTINUE;
}

public menu_ma_misje(id)
{
	new menu = menu_create("Menu misji \rby MieTeK", "menu_ma_misje_handler");

	menu_additem(menu, "Sprawdz aktualna misje");
	menu_additem(menu, "Anuluj misje\r[Koszt 50XP]")
		
	menu_setprop(menu, MPROP_EXITNAME, "Wyjscie");
		
	menu_display(id, menu);
}

public menu_ma_misje_handler(id, menu, item)
{
	new info[201];
	if(!is_user_alive(id) || !is_user_connected(id))
		return PLUGIN_CONTINUE;
		
	if(item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_CONTINUE;
	}
	
	switch(item)
	{
		case 0: aktualna_misja(id);
		case 1:
		{
			if(!ma_misje[id])
			{
				format(info, 200, "[COD MISJE] Nie posiadasz aktualnie zadnej misji!");
				ColorChat(id, YELLOW, info)
				return PLUGIN_CONTINUE;
			}
			format(info, 200, "[COD MISJE] Wlasnie anulowales swoja misje");
			ColorChat(id, RED, info)
			if(cod_get_user_xp(id) >= 100)
					cod_set_user_xp(id, cod_get_user_xp(id)-100);
				else
					cod_set_user_xp(id, 0)
			ma_misje[id] = false;
		}
	}
	return PLUGIN_CONTINUE;
}

public class(id)
{
	new menu = menu_create("Wybierz klase do zabicia:", "class_handler");
	new info[201];
	if(ma_misje[id])
	{
		format(info, 200, "[COD MISJE] Aktualnie masz juz misje!");
		ColorChat(id, GREEN, info)
		return PLUGIN_CONTINUE;
	}
	
	for(new i=1; i<=cod_get_classes_num(); i++)
	{
		new g_class_name[64];
		cod_get_class_name(i, g_class_name, 63);
		menu_additem(menu, g_class_name);
	}
	
	menu_setprop(menu, MPROP_EXITNAME, "Wyjscie");
	menu_setprop(menu, MPROP_NEXTNAME, "Nastepna strona");
	menu_setprop(menu, MPROP_BACKNAME, "Poprzednia strona");
	
	menu_display(id, menu);
	
	return PLUGIN_CONTINUE;
}

public class_handler(id, menu, item)
{
	if(!is_user_alive(id) || !is_user_connected(id))
		return PLUGIN_CONTINUE;
		
	if(item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_CONTINUE;
	}
	
	item++;
	
	cod_get_class_name(item, g_class, 63);
	g_class_id[id] = item;
	
	ilosc(id);
	
	return PLUGIN_CONTINUE;
}
public ilosc(id)
{
	new info[64]
	format(info, 63, "Wybrales klase %s", g_class)
	new menu = menu_create("Wybierz ilosc:", "ilosc_handler");
	
	menu_additem(menu, "Zabij 2\r[50 EXP]");
	menu_additem(menu, "Zabij 4\r[100 EXP]");
	menu_additem(menu, "Zabij 6\r[200 EXP]");
	menu_addblank(menu)
	menu_additem(menu, info);
	
	menu_setprop(menu, MPROP_EXITNAME, "Wyjscie");
	menu_setprop(menu, MPROP_NEXTNAME, "Nastepna strona");
	menu_setprop(menu, MPROP_BACKNAME, "Poprzednia strona");
	
	menu_display(id, menu);
}

public ilosc_handler(id, menu, item)
{
	new info[201];
	if(!is_user_alive(id) || !is_user_connected(id))
		return PLUGIN_CONTINUE;
		
	if(item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_CONTINUE;
	}
	
	switch(item)
	{
		case 0:
		{
			ma_misje[id] = true;
			format(info, 200, "[COD MISJE] Wybrales misje. Zabij 2 %s. Nagroda 50 EXP.", g_class);
			ColorChat(id, BLUE, info)
			g_mission[id] = 1;
			g_player_frags[id] = 0;
		}
		case 1:
		{
			ma_misje[id] = true;
			format(info, 200, "[COD MISJE] Wybrales misje. Zabij 4 %s. Nagroda 100 EXP.", g_class);
			ColorChat(id, BLUE, info)
			g_mission[id] = 2;
			g_player_frags[id] = 0;
		}
		case 2:
		{
			ma_misje[id] = true;
			format(info, 200, "[COD MISJE] Wybrales misje. Zabij 4 %s. Nagroda 200 EXP.", g_class);
			ColorChat(id, BLUE, info)
			g_mission[id] = 3;
			g_player_frags[id] = 0;
		}
	}
	return PLUGIN_CONTINUE;
}

public polowanie(id)
{
	new info[201];
	if(ma_misje[id])
	{
		format(info, 200, "[COD MISJE] Aktualnie masz juz misje!");
		ColorChat(id, GREEN, info)
		return PLUGIN_CONTINUE;
	}
	
	new menu = menu_create("Wybierz gracza:", "polowanie_handler");
	new callback = menu_makecallback("polowanie_callback");
	
	for(new i=0, n=0; i<=32; i++)
	{
		if(!is_user_connected(i))
			continue;
		g_player_id[n++] = i;
		new nazwa_gracza[64];
		get_user_name(i, nazwa_gracza, 63)
		menu_additem(menu, nazwa_gracza, "0", 0, callback);
	}
	
	menu_setprop(menu, MPROP_EXITNAME, "Wyjscie");
	menu_setprop(menu, MPROP_NEXTNAME, "Nastepna strona");
	menu_setprop(menu, MPROP_BACKNAME, "Poprzednia strona");
	
	menu_display(id, menu);
	
	return PLUGIN_CONTINUE;
}

public polowanie_handler(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_CONTINUE;
	}
	
	g_target[id] = g_player_id[item];
	get_user_name(g_target[id], g_player_name, 32);
	
	
	stawka(id);
	
	return PLUGIN_CONTINUE;
}

public polowanie_callback(id, menu, item)
{
	if(g_player_id[item]  == get_user_userid(id) /*|| get_user_team(item) == get_user_team(id)*/)
		return ITEM_DISABLED;
		
	return ITEM_ENABLED;
}

public stawka(id)
{
	new menu = menu_create("Wybierz stawke:", "stawka_handler");
	
	new info[64]
	format(info, 63, "Twoim celem jest %s ", g_player_name)
	
	menu_additem(menu, "[50 XP]");
	menu_additem(menu, "[100 XP]");
	menu_additem(menu, "[200 XP]");
	menu_additem(menu, "[500 XP]");
	menu_addblank(menu);
	menu_additem(menu, info);
	
	menu_setprop(menu, MPROP_EXITNAME, "Wyjscie");
	menu_display(id, menu);
}

public stawka_handler(id, menu, item)
{
	new info[201];
	if(item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_CONTINUE;
	}
	
	switch(item)
	{
		case 0:
		{
			ma_misje[id] = true;
			format(info, 200, "[COD MISJE] Wybrales misje. Zabij %s. Nagroda 50 EXP.", g_player_name);
			ColorChat(id, BLUE, info)
			g_mission[id] = 4;
		}
		case 1:
		{
			ma_misje[id] = true;
			format(info, 200, "[COD MISJE] Wybrales misje. Zabij %s. Nagroda 100 EXP.", g_player_name);
			ColorChat(id, BLUE, info)
			g_mission[id] = 5;
		}
		case 2:
		{
			ma_misje[id] = true;
			format(info, 200, "[COD MISJE] Wybrales misje. Zabij %s. Nagroda 200 EXP.", g_player_name);
			ColorChat(id, BLUE, info)
			g_mission[id] = 6;
		}
		case 3:
		{
			ma_misje[id] = true;
			format(info, 200, "[COD MISJE] Wybrales misje. Zabij %s. Nagroda 500 EXP.", g_player_name);
			ColorChat(id, BLUE, info)
			g_mission[id] = 7;
		}
	}
	return PLUGIN_CONTINUE;
}

public headshoot(id)
{
	new menu = menu_create("Wybierz ilosc:", "headshoot_handler");
	
	menu_additem(menu, "2 [50 EXP]");
	menu_additem(menu, "4 [100 EXP]");
	menu_additem(menu, "6 [200 EXP]");
	menu_additem(menu, "8 [500 EXP]");
	
	menu_setprop(menu, MPROP_EXITNAME, "Wyjscie");
	menu_display(id, menu);
}

public headshoot_handler(id, menu, item)
{
	new info[201];
	if(item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_CONTINUE;
	}
	
	switch(item)
	{
		case 0:
		{
			ma_misje[id] = true;
			format(info, 200, "[COD MISJE] Wybrales misje. Zabij 2 headshootami. Nagroda 50 EXP.");
			ColorChat(id, BLUE, info)
			g_mission[id] = 9;
		}
		case 1:
		{
			ma_misje[id] = true;
			format(info, 200, "[COD MISJE] Wybrales misje. Zabij 4 headshootami. Nagroda 100 EXP.");
			ColorChat(id, BLUE, info)
			g_mission[id] = 10;
		}
		case 2:
		{
			ma_misje[id] = true;
			format(info, 200, "[COD MISJE] Wybrales misje. Zabij 6 headshootami. Nagroda 200 EXP.");
			ColorChat(id, BLUE, info)
			g_mission[id] = 11;
		}
		case 3:
		{
			ma_misje[id] = true;
			format(info, 200, "[COD MISJE] Wybrales misje. Zabij 8 headshootami. Nagroda 500 EXP.");
			ColorChat(id, BLUE, info)
			g_mission[id] = 12;
		}
	}
	return PLUGIN_CONTINUE;
}

public bomberman(id)
{
	new menu = menu_create("Wybierz ilosc:", "bomberman_handler");
	
	menu_additem(menu, "2 [50 EXP]");
	menu_additem(menu, "4 [150 EXP]");
	menu_additem(menu, "8 [450 EXP]");
	
	menu_setprop(menu, MPROP_EXITNAME, "Wyjscie");
	menu_display(id, menu);
}

public bomberman_handler(id, menu, item)
{
	new info[201];
	if(item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_CONTINUE;
	}
	
	switch(item)
	{
		case 0:
		{
			ma_misje[id] = true;
			format(info, 200, "[COD MISJE] Wybrales misje. Podloz 2 bomby. Nagroda 50 EXP.");
			ColorChat(id, BLUE, info)
			g_mission[id] = 13;
		}
		case 1:
		{
			ma_misje[id] = true;
			format(info, 200, "[COD MISJE] Wybrales misje. Podloz 4 bomby. Nagroda 150 EXP.");
			ColorChat(id, BLUE, info)
			g_mission[id] = 14;
		}
		case 2:
		{
			ma_misje[id] = true;
			format(info, 200, "[COD MISJE] Wybrales misje. Podloz 8 bomb. Nagroda 450 EXP.");
			ColorChat(id, BLUE, info)
			g_mission[id] = 15;
		}
	}
	return PLUGIN_CONTINUE;
}
public defuser(id)
{
	new menu = menu_create("Wybierz ilosc:", "defuser_handler");
	
	menu_additem(menu, "2 [50 EXP]");
	menu_additem(menu, "4 [150 EXP]");
	menu_additem(menu, "8 [450 EXP]");
	
	menu_setprop(menu, MPROP_EXITNAME, "Wyjscie");
	menu_display(id, menu);
}

public defuser_handler(id, menu, item)
{
	new info[201];
	if(item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_CONTINUE;
	}
	
	switch(item)
	{
		case 0:
		{
			ma_misje[id] = true;
			format(info, 200, "[COD MISJE] Wybrales misje. Rozbroj 2 bomby. Nagroda 50 EXP.");
			ColorChat(id, BLUE, info)
			g_mission[id] = 16;
		}
		case 1:
		{
			ma_misje[id] = true;
			format(info, 200, "[COD MISJE] Wybrales misje. Rozbroj 4 bomby. Nagroda 150 EXP.");
			ColorChat(id, BLUE, info)
			g_mission[id] = 17;
		}
		case 2:
		{
			ma_misje[id] = true;
			format(info, 200, "[COD MISJE] Wybrales misje. Rozbroj 8 bomb. Nagroda 450 EXP.");
			ColorChat(id, BLUE, info)
			g_mission[id] = 18;
		}
	}
	return PLUGIN_CONTINUE;
}
