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

#define PLUGIN "[Jail] Wojna Bogow"
#define VERSION "1.0.7"
#define AUTHOR "Vesper1996 edit Alelluja"

new id_bog;

public plugin_init() {
	
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	
	id_bog = jail_register_game("Dzien Bogow");
	
	register_event("CurWeapon", "GOD5", "be", "1=1");
	
	
}

public OnDayStartPre(day, szInfo[256], szInfo2[512], setting[10], gTimeRound)
{
	
	static szTime[12];
	
	if(day == id_bog)
		
	{
		
		
		static szTimes[12];
		
		
		
		format_time(szTimes, 11, "%M:%S", gTimeRound-60);
		
		formatex(szInfo2, 511, "Zasady:^n%s - Wiezniowie Wybieraja Boga Z Menu^n%s - Walka Wiezniow Miedzy Soba^n% ^nOstatni Wiezien Ma Zyczenie^n", szTime, szTimes);
		
		szInfo = "Dzisiaj jest Dzien Bogow";
		
		
		
		jail_set_prisoners_micro(true, true);
		
		jail_set_ct_hit_tt(true);
		
		jail_set_god_ct(true);
		
		
		
		setting[0] = 1;
		
		setting[1] = 1;
		
		setting[2] = 1;
		
		setting[4] = 1;
		
		setting[6] = 0;
		
		setting[7] = 1;
		
		
		
	}
	
}

public OnDayStartPost(day)
{
	if(day == id_bog)
	{
		jail_open_cele();
		jail_set_game_hud(35, "Rozpoczecie zabawy za");
	}
}

public OnGameHudTick(day, count)
{
	if(count != 10 || day != id_bog)
		return;
	
	for(new i=1; i<=MAX; i++)
	{
		if(is_user_alive(i) && get_user_team(i) == 1)
			god_menu(i);
	}
	
}

public OnGameHudEnd(day)
{
	
	if(day == id_bog)
		
	{
		
		
		
		set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0);
		
		show_hudmessage(0, "== TT vs TT ==");
		
		
		
		jail_set_prisoners_fight(true, false, false);
		
		
		
		
		
		
		
	}
	
}

public god_menu(id)
{
	
	{
		
		if(get_user_team(id) == 1) {
			
			new godmenu = menu_create("\rWybierz Boga !!!:", "sub_godday_menu")
			
			
			
			menu_additem(godmenu, "\wHerakles \r[300HP + Wszystkie Granaty+Deagle+Awp]", "1", 0);
			
			menu_additem(godmenu, "\wGod Of War \r[100HP + Deagle+Mp5+M249+Awp]", "2", 0);
			
			menu_additem(godmenu, "\wJupiter \r[m4a1+ 200HP + Noz]", "3", 0);
			
			menu_additem(godmenu, "\wLove God \r[500HP + Noz + UsP]", "4", 0);
			
			menu_additem(godmenu, "\wZeus (ViP \r[700HP + AK47 + M4A1]", "5", ADMIN_LEVEL_G, 0);
			
			menu_setprop(godmenu, MPROP_EXIT, MEXIT_ALL);
			
			menu_display(id, godmenu, 0);
			
			
			
		}
		
	}
	
}

public sub_godday_menu(id, godmenu, item)
{
	
	if (item == MENU_EXIT)
	
	{
		
		menu_destroy(godmenu);
		
		return PLUGIN_HANDLED;
		
	}
	
	
	
	new data[6], szName[64];
	
	new access, callback;
	
	
	
	menu_item_getinfo(godmenu, item, access, data,charsmax(data), szName,charsmax(szName), callback);
	
	
	
	new Key = str_to_num(data);
	
	
	
	switch (Key)
	
	{
		
		case 1:
			
		{
			
			GOD1(id)
			
		}
		
		case 2:
			
		{
			
			GOD2(id)
			
		}
		
		case 3:
			
		{
			
			GOD3(id)
			
		}
		
		case 4:
			
		{
			
			GOD4(id)
			
		}
		
		case 5:
			
		{
			
			GOD5(id)
			
		}
		
	}
	
	menu_destroy(godmenu);
	
	return PLUGIN_HANDLED;
	
}

public GOD1(id)
{
	
	set_user_health(id, 300)
	
	give_item(id, "weapon_flashbang")
	
	give_item(id, "weapon_hegrenade")
	
	give_item(id, "weapon_smokegrenade")
	
	give_item(id, "weapon_deagle")
	
	give_item(id, "weapon_awp")
	
	
	
	cs_set_user_bpammo(id, CSW_FLASHBANG, 5)
	
	cs_set_user_bpammo(id, CSW_HEGRENADE, 5)
	
	cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 5)
	
	cs_set_user_bpammo(id, CSW_DEAGLE, 9999)
	
	cs_set_user_bpammo(id, CSW_AWP, 9999)
	
}

public GOD2(id)
{
	
	strip_user_weapons(id)
	
	set_user_health(id, 100)
	
	give_item(id,"weapon_deagle")
	
	give_item(id,"weapon_mp5navy")
	
	give_item(id,"weapon_awp")
	
	give_item(id,"weapon_m249")
	
	
	
	cs_set_user_bpammo(id, CSW_DEAGLE, 9999)
	
	cs_set_user_bpammo(id, CSW_MP5NAVY, 9999)
	
	cs_set_user_bpammo(id, CSW_AWP, 9999)
	
	cs_set_user_bpammo(id, CSW_M249, 9999)
	
}

public GOD3(id)
{
	
	strip_user_weapons(id)
	
	set_user_health(id, 200)
	
	give_item(id, "weapon_m4a1")
	
	give_item(id, "weapon_knife")
	
	
	
	cs_set_user_bpammo(id, CSW_M4A1, 9999)
	
}

public GOD4(id)
{
	
	set_user_health(id, 500)
	
	give_item(id, "weapon_usp")
	
	give_item(id, "weapon_knife")
	
	cs_set_user_bpammo(id, CSW_GLOCK18, 9999)
	
}

public GOD5(id)
{
	
	if(!(get_user_flags(id) & ADMIN_LEVEL_H))
	{
		client_print(id, print_chat, "[DzienBogow] Ta klasa jest tylko dla Vip'a")
		return PLUGIN_HANDLED;
	}
	
	set_user_health(id, 800);
	
	give_item(id, "weapon_m4a1")
	
	give_item(id, "weapon_ak47")
	
	give_item(id, "weapon_knife")
	
	cs_set_user_bpammo(id, CSW_M4A1, 9999)
	
	cs_set_user_bpammo(id, CSW_AK47, 9999)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/
