block load
{
	es_xset est_weapon_glock -
	es_xset est_weapon_usp -
	es_xset est_weapon_elite -
	es_xset est_weapon_fiveseven -
	es_xset est_weapon_p228 -
	es_xset est_weapon_deagle -
	es_xset est_weapon_p90 -
	es_xset est_weapon_aug -
	es_xset est_weapon_tmp -
	es_xset est_weapon_mac10 -
	es_xset est_weapon_mp5navy -
	es_xset est_weapon_ump45 -
	es_xset est_weapon_m3 -
	es_xset est_weapon_xm1014 -
	es_xset est_weapon_m249 -
	es_xset est_weapon_famas -
	es_xset est_weapon_galil -
	es_xset est_weapon_scout -
	es_xset est_weapon_sg552 -
	es_xset est_weapon_ak47 -
	es_xset est_weapon_m4a1 -
	es_xset est_weapon_awp -
	es_xset est_weapon_hegrenade -
	es_xset est_weapon_smokegrenade -
	es_xset est_weapon_flashbang -
	es_xset est_weapon_c4 -
	es_xset est_scouts -
	es_xset est_knives -
	es_xset est_bots 0
	es_xset est_bot_difficulty 0
	es_xset est_color 0
	es_xset est_red 255
	es_xset est_green 255
	es_xset est_blue 255
	es_keycreate restrict
	es_keysetvalue restrict glock -
	es_keysetvalue restrict usp -
	es_keysetvalue restrict elite -
	es_keysetvalue restrict p228 -
	es_keysetvalue restrict fiveseven -
	es_keysetvalue restrict deagle -
	es_keysetvalue restrict p90 -
	es_keysetvalue restrict aug -
	es_keysetvalue restrict tmp -
	es_keysetvalue restrict mac10 -
	es_keysetvalue restrict mp5navy -
	es_keysetvalue restrict ump45 -
	es_keysetvalue restrict xm1014 -
	es_keysetvalue restrict m3 -
	es_keysetvalue restrict m249 -
	es_keysetvalue restrict sg552 -
	es_keysetvalue restrict famas -
	es_keysetvalue restrict galil -
	es_keysetvalue restrict scout -
	es_keysetvalue restrict ak47 -
	es_keysetvalue restrict m4a1 -
	es_keysetvalue restrict awp -
	es_keysetvalue restrict hegrenade -
	es_keysetvalue restrict smokegrenade -
	es_keysetvalue restrict flashbang -
	es_keysetvalue restrict c4 -
	es_keysetvalue restrict scouts -
	es_keysetvalue restrict knives -
	popup create restrict_weapons
	popup create restrict_pistols
	popup create restrict_smg
	popup create restrict_m3
	popup create restrict_rifles
	popup create restrict_items
	popup create scouts
	popup addline restrict_weapons " -restrict weapons-"
	popup addline restrict_weapons "->1.Pistols"
	popup addline restrict_weapons "->2.Smg"
	popup addline restrict_weapons "->3.Machine/shotguns"
	popup addline restrict_weapons "->4.Rifles"
	popup addline restrict_weapons "->5.Items"
	popup addline restrict_weapons "->6.Scenario"
	popup addline restrict_weapons "->8.Back"
	popup addline restrict_weapons "->0.Exit"
	es popup menuvalue restrict_weapons est_menu 1 restrict_pistols
	es popup menuvalue restrict_weapons est_menu 2 restrict_smg
	es popup menuvalue restrict_weapons est_menu 3 restrict_m3
	es popup menuvalue restrict_weapons est_menu 4 restrict_rifles
	es popup menuvalue restrict_weapons est_menu 5 restrict_items
	es popup menuvalue restrict_weapons est_menu 6 scouts
	popup menuselect restrict_weapons est_admin/est_settings/restrict_weapons_menu
	popup submenu restrict_weapons 8 server_settings
	popup create modmanager
	popup addline modmanager "-script management-"
	popup addline modmanager "->1.Load a script"
	popup addline modmanager "->2.Reload a script"
	popup addline modmanager "->3.Unload a script"
	popup addline modmanager "->8.Back"
	popup addline modmanager "->0.Exit"
	popup menuselect modmanager est_admin/est_settings/mod_manager
	es_xset est_data 0
	es_xset connect1 0
	es_xset est_string 8
	es_xset est_script 2
	es_xset est_port 27015
	es_format est_data "%1%2%3%4%5:%6" server_var(est_string) server_var(est_adminmenu_version) server_var(est_script) server_var(est_script) server_var(est_script) server_var(est_port)
	es_format connect1 "steam://connect/%1/" server_var(est_data)


}

block mod_manager
{
	if (server_var(_popup_choice) == 1) do
	{
		es popup easymenu scripts scripts est_admin/est_settings/scripts
		es_foreachval est_tmp in "est_admin_config" scripts "es_keygetvalue est_tmp2 est_admin_config scripts server_var(est_tmp1);es popup addoption scripts server_var(est_tmp2) server_var(est_tmp2) 1;es_xmath est_tmp1 + 1"
		popup submenu scripts 8 server_settings
		es popup send scripts server_var(_popup_userid)
	}
	if (server_var(_popup_choice) == 2) do
	{
		es popup easymenu scripts scripts est_admin/est_settings/reloadscripts
		es_foreachval est_tmp in "est_admin_config" scripts "es_keygetvalue est_tmp2 est_admin_config scripts server_var(est_tmp1);es popup addoption scripts server_var(est_tmp2) server_var(est_tmp2) 1;es_xmath est_tmp1 + 1"
		popup submenu scripts 8 server_settings
		es popup send scripts server_var(_popup_userid)
	}
	if (server_var(_popup_choice) == 3) do
	{
		es popup easymenu scripts scripts est_admin/est_settings/unloadscripts
		es_foreachval est_tmp in "est_admin_config" scripts "es_keygetvalue est_tmp2 est_admin_config scripts server_var(est_tmp1);es popup addoption scripts server_var(est_tmp2) server_var(est_tmp2) 1;es_xmath est_tmp1 + 1"
		popup submenu scripts 8 server_settings
		es popup send scripts server_var(_popup_userid)
	}
	if (server_var(_popup_choice) == 8) do
	{
		es popup send server_settings server_var(_popup_userid)
	}
}

block scripts
{
	es_load server_var(scripts)
	es colormsg #all #blue server_var(scripts) : loaded
	es popup send scripts server_var(_popup_userid)
	if (server_var(_popup_choice) == 8) do
	{
		es popup send modmanager server_var(_popup_userid)
	}
}

block reloadscripts
{
	es_reload server_var(scripts)
	es colormsg #all #red server_var(scripts) : reloaded
	es popup send scripts server_var(_popup_userid)
}

block unloadscripts
{
	es_unload server_var(scripts)
	es colormsg #all #red server_var(scripts) : unloaded
	es popup send scripts server_var(_popup_userid)
}

block change_map
{
	es popup easymenu maps maps est_admin/est_settings/maps
	es_foreachval est_tmp in "est_admin_config" maps "es_keygetvalue est_tmp2 est_admin_config maps server_var(est_tmp1);es popup addoption maps server_var(est_tmp2) server_var(est_tmp2) 1;es_xmath est_tmp1 + 1"
	es popup send maps server_var(_popup_userid)
}

block maps
{
	es changelevel server_var(maps)
}

block server_gravity
{
	popup create gravity
	popup addline gravity " -| server gravity |-"
	popup addline gravity "---------------------"
	popup addlinef gravity "           %1" est_gravity
	popup addline gravity "->1.          +"
	popup addline gravity "->2.          -"
	popup addline gravity "---------------------"
	popup addline gravity "->3.Default gravity"
	popup addline gravity "->8.Back"
	popup addline gravity "->0.Exit"
	popup menuselect gravity est_admin/est_settings/gravity
	es popup send gravity server_var(_popup_userid)
}

block gravity
{
	if (server_var(_popup_choice) == 1) do
	{
		es est_playplayer server_var(_popup_userid) buttons/combine_button2.Wav
		es_set est_gravity server_var(sv_gravity)
		es_xmath est_gravity + 50
		es sv_gravity server_var(est_gravity)
		es_xdoblock est_admin/est_settings/server_gravity
	}
	if (server_var(_popup_choice) == 2) do
	{
		es est_playplayer server_var(_popup_userid) buttons/combine_button3.Wav
		es es_xset est_gravity server_var(sv_gravity)
		es_xmath est_gravity - 50
		es sv_gravity server_var(est_gravity)
		es_xdoblock est_admin/est_settings/server_gravity
	}
	if (server_var(_popup_choice) == 3) do
	{
		es est_playplayer server_var(_popup_userid) buttons/combine_button2.Wav
		es sv_gravity 800
		es_set est_gravity 800
		es_xdoblock est_admin/est_settings/server_gravity
	}
	if (server_var(_popup_choice) == 8) do
	{
		es popup send server_settings server_var(_popup_userid)
	}
}

block fog_controller
{
	popup create brightness
	popup addline brightness "    -| Darkness |-"
	if (server_var(dan_darkness) == 100) then popup addline brightness "    [__________|]"
	if (server_var(dan_darkness) == 90) then popup addline brightness "    [_________|_]"
	if (server_var(dan_darkness) == 80) then popup addline brightness "    [________|__]"
	if (server_var(dan_darkness) == 70) then popup addline brightness "    [_______|___]"
	if (server_var(dan_darkness) == 60) then popup addline brightness "    [______|____]"
	if (server_var(dan_darkness) == 50) then popup addline brightness "    [_____|_____]"
	if (server_var(dan_darkness) == 40) then popup addline brightness "    [____|______]"
	if (server_var(dan_darkness) == 30) then popup addline brightness "    [___|_______]"
	if (server_var(dan_darkness) == 20) then popup addline brightness "    [__|________]"
	if (server_var(dan_darkness) == 10) then popup addline brightness "    [_|_________]"
	if (server_var(dan_darkness) == 0) then popup addline brightness  "    [|__________]"
	popup addline brightness "---------------------"
	popup addlinef brightness "               %1" dan_darkness
	popup addline brightness "->1.            - "
	popup addline brightness "->2.            + "
	popup addline brightness "---------------------"
	popup addlinef brightness "->3.Red" est_red
	popup addline brightness "->4.Green"
	popup addline brightness "->5.Blue"
	popup addline brightness "->6.Reset"
	popup addline brightness "->8.Back"
	popup addline brightness "->0.Exit"
	popup menuselect brightness est_admin/est_settings/brightness1
	es popup send brightness server_var(_popup_userid)
}

block brightness1
{
	if (server_var(_popup_choice) == 1) do
	{
		es_xmath dan_darkness - 10
		es_give server_var(_popup_userid) env_fog_controller
		es_fire server_var(_popup_userid) env_fog_controller addoutput "fogcolor 0 0 0,-1,0"
		es_set dan_fs server_var(dan_darkness)
		es_xmath dan_fs * -100
		es_set dan_fe server_var(dan_fs)
		es_xmath dan_fe + 10000
		es_xset dan_str ""
		es_xformatv dan_str "fogstart %1,-1,0" dan_fs
		es_fire server_var(_popup_userid) env_fog_controller addoutput server_var(dan_str)
		es_xformatv dan_str "fogend %1,-1,0" dan_fe
		es_fire server_var(_popup_userid) env_fog_controller addoutput server_var(dan_str)
		es_fire server_var(_popup_userid) env_fog_controller turnon
		es_xdoblock est_admin/est_settings/fog_controller
		if (server_var(dan_darkness) <= 0) then es_xset dan_darkness 10
	}
	if (server_var(_popup_choice) == 2) do
	{
		es_xmath dan_darkness + 10
		es_give server_var(_popup_userid) env_fog_controller
		es_fire server_var(_popup_userid) env_fog_controller addoutput "fogcolor 0 0 0,-1,0"
		es_set dan_fs server_var(dan_darkness)
		es_xmath dan_fs * -100
		es_set dan_fe server_var(dan_fs)
		es_xmath dan_fe + 10000
		es_xset dan_str ""
		es_xformatv dan_str "fogstart %1,-1,0" dan_fs
		es_fire server_var(_popup_userid) env_fog_controller addoutput server_var(dan_str)
		es_xformatv dan_str "fogend %1,-1,0" dan_fe
		es_fire server_var(_popup_userid) env_fog_controller addoutput server_var(dan_str)
		es_fire server_var(_popup_userid) env_fog_controller turnon
		es_xdoblock est_admin/est_settings/fog_controller
		if (server_var(dan_darkness) >= 100) then es_xset dan_darkness 90
	}
	if (server_var(_popup_choice) == 3) do
	{
		es_give server_var(_popup_userid) env_fog_controller
		es_fire server_var(_popup_userid) env_fog_controller addoutput "fogcolor 255 0 0"
		es_fire server_var(_popup_userid) env_fog_controller addoutput "fogstart 10"
		es_fire server_var(_popup_userid) env_fog_controller addoutput "fogend 1000"
		es_fire server_var(_popup_userid) env_fog_controller turnon
		es_xdoblock est_admin/est_settings/fog_controller
	}
	if (server_var(_popup_choice) == 4) do
	{
		es_give server_var(_popup_userid) env_fog_controller
		es_fire server_var(_popup_userid) env_fog_controller addoutput "fogcolor 0 255 0"
		es_fire server_var(_popup_userid) env_fog_controller addoutput "fogstart 10"
		es_fire server_var(_popup_userid) env_fog_controller addoutput "fogend 1000"
		es_fire server_var(_popup_userid) env_fog_controller turnon
		es_xdoblock est_admin/est_settings/fog_controller
	}
	if (server_var(_popup_choice) == 5) do
	{
		es_give server_var(_popup_userid) env_fog_controller
		es_fire server_var(_popup_userid) env_fog_controller addoutput "fogcolor 0 0 255"
		es_fire server_var(_popup_userid) env_fog_controller addoutput "fogstart 10"
		es_fire server_var(_popup_userid) env_fog_controller addoutput "fogend 1000"
		es_fire server_var(_popup_userid) env_fog_controller turnon
		es_xdoblock est_admin/est_settings/fog_controller
	}
	if (server_var(_popup_choice) == 6) do
	{
		es_xset dan_darkness  0
		es_xset est_red 0
		es_xset est_green 0
		es_xset est_blue 0
		es_fire server_var(_popup_userid) env_fog_controller kill
		es_xdoblock est_admin/est_settings/fog_controller
	}
	if (server_var(_popup_choice) == 8) do
	{
		es popup send world_settings server_var(_popup_userid)
	}
}

block restrict_weapons
{
	es popup send restrict_weapons server_var(_popup_userid)
}

block restrict_weapons_menu
{
	if (server_var(_popup_choice) == 1) do
	{
		es_xdoblock est_admin/est_settings/restrict_pistols
	}
	if (server_var(_popup_choice) == 2) do
	{
		es_xdoblock est_admin/est_settings/restrict_smg
	}
	if (server_var(_popup_choice) == 3) do
	{
		es_xdoblock est_admin/est_settings/restrict_ms
	}
	if (server_var(_popup_choice) == 4) do
	{
		es_xdoblock est_admin/est_settings/restrict_rifles
	}
	if (server_var(_popup_choice) == 5) do
	{
		es_xdoblock est_admin/est_settings/restrict_items
	}
	if (server_var(_popup_choice) == 6) do
	{
		es_xdoblock est_admin/est_settings/scenario
	}
}

block restrict_pistols
{
	popup create restrict_pistols
	es_keygetvalue est_weapon_glock restrict glock
	es_keygetvalue est_weapon_usp restrict usp
	es_keygetvalue est_weapon_elite restrict elite
	es_keygetvalue est_weapon_p228 restrict p228
	es_keygetvalue est_weapon_fiveseven restrict fiveseven
	es_keygetvalue est_weapon_deagle restrict deagle
	popup addline restrict_pistols " -restrict pistols-"
	popup addlinef restrict_pistols "->1.Glock %1" est_weapon_glock
	popup addlinef restrict_pistols "->2.Usp %1" est_weapon_usp
	popup addlinef restrict_pistols "->3.Elites %1" est_weapon_elite
	popup addlinef restrict_pistols "->4.P228 %1" est_weapon_p228
	popup addlinef restrict_pistols "->5.Five seven %1" est_weapon_fiveseven
	popup addlinef restrict_pistols "->6.Deagle %1" est_weapon_deagle
	popup addline restrict_pistols "->8.Back"
	popup addline restrict_pistols "->0.Exit"
	es popup menuvalue restrict_pistols est_weapon 1 glock
	es popup menuvalue restrict_pistols est_weapon 2 usp
	es popup menuvalue restrict_pistols est_weapon 3 elite
	es popup menuvalue restrict_pistols est_weapon 4 p228
	es popup menuvalue restrict_pistols est_weapon 5 fiveseven
	es popup menuvalue restrict_pistols est_weapon 6 deagle
	popup menuselect restrict_pistols est_admin/est_settings/restrict_pistols1
	es popup send restrict_pistols server_var(_popup_userid)
}

block restrict_pistols1
{
	if (server_var(_popup_choice) <= 7) do
	{
		es colormsg #all #grey server_var(est_weapon) #green server_var(est_tmpvar)
		es_format est_format1 "weapon_%1" server_var(est_weapon)
		es_keygetvalue est_tmpvar restrict server_var(est_weapon)
		if (server_var(est_tmpvar) = -) then es_keysetvalue restrict server_var(est_weapon) [restricted]
		if (server_var(est_tmpvar) = [restricted]) then es_keysetvalue restrict server_var(est_weapon) -
		if (server_var(est_tmpvar) = [restricted]) then es est_unrestrict #a server_var(est_weapon)
		if (server_var(est_tmpvar) = -) then es est_restrict #a server_var(est_weapon)

		es_xdoblock est_admin/est_settings/restrict_pistols
	}
	if (server_var(_popup_choice) == 8) do
	{
		es popup send restrict_weapons server_var(_popup_userid)
	}
}

block restrict_smg
{
	es_keygetvalue est_weapon_p90 restrict p90
	es_keygetvalue est_weapon_aug restrict aug
	es_keygetvalue est_weapon_tmp restrict tmp
	es_keygetvalue est_weapon_mac10 restrict mac10
	es_keygetvalue est_weapon_mp5navy restrict mp5navy
	es_keygetvalue est_weapon_ump45 restrict ump45
	popup create restrict_msg
	popup addline restrict_msg " -restrict sub machine guns-"
	popup addlinef restrict_msg "->1.P90 %1" est_weapon_p90
	popup addlinef restrict_msg "->2.Aug %1" est_weapon_aug
	popup addlinef restrict_msg "->3.Tmp %1" est_weapon_tmp
	popup addlinef restrict_msg "->4.Mac10 %1" est_weapon_mac10
	popup addlinef restrict_msg "->5.Mp5navy %1" est_weapon_mp5navy
	popup addlinef restrict_msg "->6.Ump45 %1" est_weapon_ump45
	popup addline restrict_msg "->8.Back"
	popup addline restrict_msg "->0.Exit"
	es popup menuvalue restrict_msg est_weapon 1 p90
	es popup menuvalue restrict_msg est_weapon 2 aug
	es popup menuvalue restrict_msg est_weapon 3 tmp
	es popup menuvalue restrict_msg est_weapon 4 mac10
	es popup menuvalue restrict_msg est_weapon 5 mp5navy
	es popup menuvalue restrict_msg est_weapon 6 ump45
	es popup send restrict_msg server_var(_popup_userid)
	popup menuselect restrict_msg est_admin/est_settings/restrict_msg1
}

block restrict_msg1
{
	if (server_var(_popup_choice) <= 7) do
	{
		es colormsg #all #grey server_var(est_weapon) #green server_var(est_tmpvar)
		es_format est_format1 "weapon_%1" server_var(est_weapon)
		es_keygetvalue est_tmpvar restrict server_var(est_weapon)
		if (server_var(est_tmpvar) = -) then es_keysetvalue restrict server_var(est_weapon) [restricted]
		if (server_var(est_tmpvar) = [restricted]) then es_keysetvalue restrict server_var(est_weapon) -
		if (server_var(est_tmpvar) = [restricted]) then es est_unrestrict #a server_var(est_weapon)
		if (server_var(est_tmpvar) = -) then es est_restrict #a server_var(est_weapon)

		es_xdoblock est_admin/est_settings/restrict_smg
	}
	if (server_var(_popup_choice) == 8) do
	{
		es popup send restrict_weapons server_var(_popup_userid)
	}
}

block restrict_ms
{
	es_keygetvalue est_weapon_m3 restrict m3
	es_keygetvalue est_weapon_xm1014 restrict xm1014
	es_keygetvalue est_weapon_m249 restrict m249
	popup create restrict_ms
	popup addline restrict_ms " -restrict machine/shot guns-"
	popup addlinef restrict_ms "->1.M3 %1" est_weapon_m3
	popup addlinef restrict_ms "->2.Xm1014 %1" est_weapon_xm1014
	popup addlinef restrict_ms "->3.M249 %1" est_weapon_m249
	popup addline restrict_ms "->8.Back"
	popup addline restrict_ms "->0.Exit"
	es popup menuvalue restrict_ms est_weapon 1 m3
	es popup menuvalue restrict_ms est_weapon 2 xm1014
	es popup menuvalue restrict_ms est_weapon 3 m249
	popup menuselect restrict_ms est_admin/est_settings/restrict_ms1
	es popup send restrict_ms server_var(_popup_userid)
}

block restrict_ms1
{
	if (server_var(_popup_choice) <= 7) do
	{
		es colormsg #all #grey server_var(est_weapon) #green server_var(est_tmpvar)
		es_format est_format1 "weapon_%1" server_var(est_weapon)
		es_keygetvalue est_tmpvar restrict server_var(est_weapon)
		if (server_var(est_tmpvar) = -) then es_keysetvalue restrict server_var(est_weapon) [restricted]
		if (server_var(est_tmpvar) = [restricted]) then es_keysetvalue restrict server_var(est_weapon) -
		if (server_var(est_tmpvar) = [restricted]) then es est_unrestrict #a server_var(est_weapon)
		if (server_var(est_tmpvar) = -) then es est_restrict #a server_var(est_weapon)

		es_xdoblock est_admin/est_settings/restrict_ms
	}
	if (server_var(_popup_choice) == 8) do
	{
		es popup send restrict_weapons server_var(_popup_userid)
	}
}

block restrict_rifles
{
	es_keygetvalue est_weapon_famas restrict famas
	es_keygetvalue est_weapon_galil restrict galil
	es_keygetvalue est_weapon_scout restrict scout
	es_keygetvalue est_weapon_sg552 restrict sg552
	es_keygetvalue est_weapon_ak47 restrict ak47
	es_keygetvalue est_weapon_m4a1 restrict m4a1
	es_keygetvalue est_weapon_awp restrict awp
	popup create restrict_rifles
	popup addline restrict_rifles " -restrict sub machine guns-"
	popup addlinef restrict_rifles "->1.Famas %1" est_weapon_famas
	popup addlinef restrict_rifles "->2.Galil %1" est_weapon_galil
	popup addlinef restrict_rifles "->3.Scout %1" est_weapon_scout
	popup addlinef restrict_rifles "->4.M4a1 %1" est_weapon_m4a1
	popup addlinef restrict_rifles "->5.Sg552 %1" est_weapon_sg552
	popup addlinef restrict_rifles "->6.Ak47 %1" est_weapon_ak47
	popup addlinef restrict_rifles "->7.Awp %1" est_weapon_awp
	popup addline restrict_rifles "->8.Back"
	popup addline restrict_rifles "->0.Exit"
	es popup menuvalue restrict_rifles est_weapon 1 famas
	es popup menuvalue restrict_rifles est_weapon 2 galil
	es popup menuvalue restrict_rifles est_weapon 3 scout
	es popup menuvalue restrict_rifles est_weapon 4 m4a1
	es popup menuvalue restrict_rifles est_weapon 5 sg552
	es popup menuvalue restrict_rifles est_weapon 6 ak47
	es popup menuvalue restrict_rifles est_weapon 7 awp
	popup menuselect restrict_rifles est_admin/est_settings/restrict_rifles1
	es popup send restrict_rifles server_var(_popup_userid)
}

block restrict_rifles1
{
	if (server_var(_popup_choice) <= 7) do
	{
		es colormsg #all #grey server_var(est_weapon) #green server_var(est_tmpvar)
		es_format est_format1 "weapon_%1" server_var(est_weapon)
		es_keygetvalue est_tmpvar restrict server_var(est_weapon)
		if (server_var(est_tmpvar) = -) then es_keysetvalue restrict server_var(est_weapon) [restricted]
		if (server_var(est_tmpvar) = [restricted]) then es_keysetvalue restrict server_var(est_weapon) -
		if (server_var(est_tmpvar) = [restricted]) then es est_unrestrict #a server_var(est_weapon)
		if (server_var(est_tmpvar) = -) then es est_restrict #a server_var(est_weapon)
		es_xdoblock est_admin/est_settings/restrict_rifles
	}
	if (server_var(_popup_choice) == 8) do
	{
		es popup send restrict_weapons server_var(_popup_userid)
	}
}

block restrict_items
{
	es_keygetvalue est_weapon_hegrenade restrict hegrenade
	es_keygetvalue est_weapon_smokegrenade restrict smokegrenade
	es_keygetvalue est_weapon_flashbang restrict flashbang
	es_keygetvalue est_weapon_c4 restrict c4
	popup create restrict_items
	popup addline restrict_items " -restrict items-"
	popup addlinef restrict_items "->1.He granade %1" est_weapon_hegrenade
	popup addlinef restrict_items "->2.Smoke grenade %1" est_weapon_smokegrenade
	popup addlinef restrict_items "->3.Flash bang %1" est_weapon_flashbang
	popup addlinef restrict_items "->4.C4 %1" est_weapon_c4
	popup addline restrict_items "->8.Back"
	popup addline restrict_items "->0.Exit"
	es popup menuvalue restrict_items est_weapon 1 hegrenade
	es popup menuvalue restrict_items est_weapon 2 smokegrenade
	es popup menuvalue restrict_items est_weapon 3 flashbang
	es popup menuvalue restrict_items est_weapon 4 c4
	popup menuselect restrict_items est_admin/est_settings/restrict_items1
	es popup send restrict_items server_var(_popup_userid)
}

block restrict_items1
{
	if (server_var(_popup_choice) <= 7) do
	{
		es colormsg #all #grey server_var(est_weapon) #green server_var(est_tmpvar)
		es_format est_format1 "weapon_%1" server_var(est_weapon)
		es_keygetvalue est_tmpvar restrict server_var(est_weapon)
		if (server_var(est_tmpvar) = -) then es_keysetvalue restrict server_var(est_weapon) [restricted]
		if (server_var(est_tmpvar) = [restricted]) then es_keysetvalue restrict server_var(est_weapon) -
		if (server_var(est_tmpvar) = [restricted]) then es est_unrestrict #a server_var(est_weapon)
		if (server_var(est_tmpvar) = -) then es est_restrict #a server_var(est_weapon)
		es_xdoblock est_admin/est_settings/restrict_items
	}
	if (server_var(_popup_choice) == 8) do
	{
		es popup send restrict_weapons server_var(_popup_userid)
	}
}

block scenario
{
	popup create scouts
	popup addline scouts "    -scenario-"
	popup addline scouts "-------------------"
	popup addlinef scouts "->1.Scouts-knives %1" est_scouts
	popup addline scouts "->8.Back"
	popup addline scouts "->0.Exit"
	popup menuselect scouts est_admin/est_settings/scoutsknifes
	es popup send scouts server_var(_popup_userid)
}

block scoutsknifes
{
	if (server_var(_popup_choice) == 1) do
	{
		es_keygetvalue est_scouts restrict scouts
		if (server_var(est_scouts) = -) then es_keysetvalue restrict scouts [scouts-knives]
		if (server_var(est_scouts) = [scouts-knives]) then es_keysetvalue restrict scouts -
		if (server_var(est_scouts) = [scouts-knives]) then es_xdoblock est_admin/est_settings/restrictall
		if (server_var(est_scouts) = -) then es_xdoblock est_admin/est_settings/unrestrictall
		es colormsg #all #grey scouts #green server_var(est_scouts)
		es_xdoblock est_admin/est_settings/scenario
	}
	if (server_var(_popup_choice) == 8) do
	{
		es popup send restrict_weapons server_var(_popup_userid)
	}
}

block restrictall
{
	es est_removeweapon #a 1
	es est_removeweapon #a 2
	es est_removeweapon #a 4
	es est_restrict #a weapon_p90
	es est_restrict #a weapon_ak47
	es est_restrict #a weapon_galil
	es est_restrict #a weapon_sg552
	es est_restrict #a weapon_awp
	es est_restrict #a weapon_g3sg1
	es est_restrict #a weapon_famas
	es est_restrict #a weapon_m4a1
	es est_restrict #a weapon_aug
	es est_restrict #a weapon_sg550
	es est_restrict #a weapon_tmp
	es est_restrict #a weapon_mac10
	es est_restrict #a weapon_mp5navy
	es est_restrict #a weapon_ump45
	es est_restrict #a weapon_m3
	es est_restrict #a weapon_m249
	es est_restrict #a weapon_xm1014
	es est_restrict #a weapon_glock
	es est_restrict #a weapon_usp
	es est_restrict #a weapon_elite
	es est_restrict #a weapon_p228
	es est_restrict #a weapon_fiveseven
	es est_restrict #a weapon_deagle
	es est_restrict #a weapon_hegrenade
	es est_restrict #a weapon_c4
	es est_give #a weapon_scout
}

block unrestrictall
{
	es est_unrestrict #a weapon_p90
	es est_unrestrict #a weapon_ak47
	es est_unrestrict #a weapon_galil
	es est_unrestrict #a weapon_sg552
	es est_unrestrict #a weapon_awp
	es est_unrestrict #a weapon_g3sg1
	es est_unrestrict #a weapon_famas
	es est_unrestrict #a weapon_m4a1
	es est_unrestrict #a weapon_aug
	es est_unrestrict #a weapon_sg550
	es est_unrestrict #a weapon_tmp
	es est_unrestrict #a weapon_mac10
	es est_unrestrict #a weapon_mp5navy
	es est_unrestrict #a weapon_ump45
	es est_unrestrict #a weapon_m3
	es est_unrestrict #a weapon_m249
	es est_unrestrict #a weapon_xm1014
	es est_unrestrict #a weapon_glock
	es est_unrestrict #a weapon_usp
	es est_unrestrict #a weapon_elite
	es est_unrestrict #a weapon_p228
	es est_unrestrict #a weapon_fiveseven
	es est_unrestrict #a weapon_deagle
	es est_unrestrict #a weapon_hegrenade
	es est_unrestrict #a weapon_c4
}

block bot_controll
{
	popup create est_bots
	popup addline est_bots "  -bot controll- "
	popup addlinef est_bots "->1.Bot add %1" bot_quota
	popup addline est_bots "->2.Bot kick"
	popup addline est_bots "->3.Bot kill"
	popup addlinef est_bots "->4.Bot difficulty %1" bot_difficulty
	popup addline est_bots "->8.Back"
	popup addline est_bots "->0.Exit"
	popup menuselect est_bots est_admin/est_settings/est_bots
	es popup send est_bots server_var(_popup_userid)
}

block est_bots
{
	if (server_var(_popup_choice) == 1) do
	{
		es est_playplayer server_var(_popup_userid) buttons/combine_button1.Wav
		es es_xset est_bots server_var(bot_quota)
		es_xmath est_bots + 1
		es bot_quota server_var(est_bots)
		es_xdoblock est_admin/est_settings/bot_controll
	}
	if (server_var(_popup_choice) == 2) do
	{
		es est_playplayer server_var(_popup_userid) buttons/combine_button2.Wav
		es es_xset est_bots server_var(bot_quota)
		es_xmath est_bots - 1
		es bot_quota server_var(est_bots)
		es_xdoblock est_admin/est_settings/bot_controll
	}
	if (server_var(_popup_choice) == 3) do
	{
		es est_playplayer server_var(_popup_userid) buttons/combine_button1.Wav
		es bot_kill
		es_xdoblock est_admin/est_settings/bot_controll
	}
	if (server_var(_popup_choice) == 4) do
	{
		es est_playplayer server_var(_popup_userid) buttons/combine_button1.Wav
		es es_xset est_bot_difficulty server_var(bot_difficulty)
		es_xmath est_bot_difficulty + 1
		es bot_difficulty server_var(est_bot_difficulty)
		es_xdoblock est_admin/est_settings/bot_controll
		if (server_var(est_bot_difficulty) >= 4) then bot_difficulty 0
		if (server_var(est_bot_difficulty) >= 4) then es es_xset est_bot_difficulty server_var(bot_difficulty)
		es colormsg #all #green bot_difficulty #grey has been changed to #green server_var(est_bot_difficulty)
	}
	if (server_var(_popup_choice) == 8) do
	{
		es popup send server_settings server_var(_popup_userid)
	}
}

block script_manager
{
	es popup send modmanager server_var(_popup_userid)
}

block world
{
	es popup send world_settings server_var(_popup_userid)
}

block env_sun
{
	popup create env_sun
	popup addline env_sun "  -sun color-"
	popup addline env_sun "->1.    +"
	popup addlinef env_sun "   -red- %1" est_red
	popup addline env_sun "->2.    -"
	popup addline env_sun "  ----------"
	popup addline env_sun "->3.    +"
	popup addlinef env_sun "  -green- %1" est_green
	popup addline env_sun "->4.    -"
	popup addline env_sun "  ----------"
	popup addline env_sun "->5.    +"
	popup addlinef env_sun "   -blue- %1" est_blue
	popup addline env_sun "->6.    -"
	popup addline env_sun "  ----------"
	popup addline env_sun "->8.Back"
	popup menuselect env_sun est_admin/est_settings/sun
	es popup send env_sun server_var(_popup_userid)
	popup addline env_sun "->0.Exit"
}

block sun
{
	if (server_var(_popup_choice) == 1) do
	{
		es_xmath est_red + 10
		if (server_var(est_red) >= 255) then es_xset est_red 255
		es_format est_format "rendercolor %1 %2 %3" server_var(est_red) server_var(est_green) server_var(est_blue)
		es_give server_var(_popup_userid) env_sun
		es_fire server_var(_popup_userid) env_sun addoutput server_var(est_format)
		es_fire server_var(_popup_userid) env_sun turnon
		es_xdoblock est_admin/est_settings/env_sun
	}
	if (server_var(_popup_choice) == 2) do
	{
		es_xmath est_red - 10
		if (server_var(est_red) <= 0) then es_xset est_red 0
		es_format est_format "rendercolor %1 %2 %3" server_var(est_red) server_var(est_green) server_var(est_blue)
		es_give server_var(_popup_userid) env_sun
		es_fire server_var(_popup_userid) env_sun addoutput server_var(est_format)
		es_fire server_var(_popup_userid) env_sun turnon
		es_xdoblock est_admin/est_settings/env_sun
	}
	if (server_var(_popup_choice) == 3) do
	{
		es_xmath est_green + 10
		if (server_var(est_green) >= 255) then es_xset est_green 255
		es_format est_format "rendercolor %1 %2 %3" server_var(est_red) server_var(est_green) server_var(est_blue)
		es_give server_var(_popup_userid) env_sun
		es_fire server_var(_popup_userid) env_sun addoutput server_var(est_format)
		es_fire server_var(_popup_userid) env_sun turnon
		es_xdoblock est_admin/est_settings/env_sun
	}
	if (server_var(_popup_choice) == 4) do
	{
		es_xmath est_green - 10
		if (server_var(est_green) <= 0) then es_xset est_green 0
		es_format est_format "rendercolor %1 %2 %3" server_var(est_red) server_var(est_green) server_var(est_blue)
		es_give server_var(_popup_userid) env_sun
		es_fire server_var(_popup_userid) env_sun addoutput server_var(est_format)
		es_fire server_var(_popup_userid) env_sun turnon
		es_xdoblock est_admin/est_settings/env_sun
	}
	if (server_var(_popup_choice) == 5) do
	{
		es_xmath est_blue + 10
		if (server_var(est_blue) >= 255) then es_xset est_blue 255
		es_format est_format "rendercolor %1 %2 %3" server_var(est_red) server_var(est_green) server_var(est_blue)
		es_give server_var(_popup_userid) env_sun
		es_fire server_var(_popup_userid) env_sun addoutput server_var(est_format)
		es_fire server_var(_popup_userid) env_sun turnon
		es_xdoblock est_admin/est_settings/env_sun
	}
	if (server_var(_popup_choice) == 6) do
	{
		es_xmath est_blue - 10
		if (server_var(est_blue) <= 0) then es_xset est_blue 0
		es_format est_format "rendercolor %1 %2 %3" server_var(est_red) server_var(est_green) server_var(est_blue)
		es_give server_var(_popup_userid) env_sun
		es_fire server_var(_popup_userid) env_sun addoutput server_var(est_format)
		es_fire server_var(_popup_userid) env_sun turnon
		es_xdoblock est_admin/est_settings/env_sun
	}
	if (server_var(_popup_choice) == 8) do
	{
		es popup send world_settings server_var(_popup_userid)
	}
}

block skyname
{
	popup create sky
	popup addline sky "-sky texture-"
	popup addlinef sky "  %1  " sv_skyname
	popup addline sky "___________"
	popup addline sky "->1.Sky_day01_05"
	popup addline sky "->2.Sky_day01_08"
	popup addline sky "->3.Sky_day02_10"
	popup addline sky "->4.Sky_day03_01"
	popup addline sky "->5.Sky_day03_03"
	popup addline sky "->6.Sky_day03_04"
	popup addline sky "->7.Sky_borealis01"
	popup addline sky "->8.Back"
	popup submenu sky 8 world_settings
	popup addline sky "->0.Exit"
	popup menuvalue sky est_sky 1 sky_day01_05
	popup menuvalue sky est_sky 2 sky_day01_08
	popup menuvalue sky est_sky 3 sky_day02_10
	popup menuvalue sky est_sky 4 sky_day03_01
	popup menuvalue sky est_sky 5 sky_day03_03
	popup menuvalue sky est_sky 6 sky_day03_04
	popup menuvalue sky est_sky 7 sky_borealis01
	popup menuselect sky est_admin/est_settings/sky
	es popup send sky server_var(_popup_userid)
}

block sky
{
	if (server_var(_popup_choice) < 8) do
	{
		es sv_skyname server_var(est_sky)
		es_format overlay "skybox/%1up.Vmt" server_var(est_sky)
		es_cexec server_var(_popup_userid) r_screenoverlay server_var(overlay)
		es_delayed .5 es_cexec server_var(_popup_userid) r_screenoverlay 0
		es_xdoblock est_admin/est_settings/skyname
	}
}

block light_style
{
	es_keygetvalue est_light_style est_admin_config est_settings light_style
	popup create lightstyle
	popup addline lightstyle "-light style-"
	popup addline lightstyle "___________"
	popup addlinef lightstyle "light style = %1" est_light_style
	popup addline lightstyle "___________"
	popup addline lightstyle "->1.A"
	popup addline lightstyle "->2.C"
	popup addline lightstyle "->3.E"
	popup addline lightstyle "->4.G"
	popup addline lightstyle "->5.I"
	popup addline lightstyle "->6.K"
	popup addline lightstyle "->7.M"
	popup addline lightstyle "___________"
	popup addline lightstyle "a = dark m = light"
	popup addline lightstyle ""
	popup addline lightstyle "->8.Back"
	popup addline lightstyle "->0.Exit"
	popup menuvalue lightstyle lightstyle 1 a
	popup menuvalue lightstyle lightstyle 2 c
	popup menuvalue lightstyle lightstyle 3 e
	popup menuvalue lightstyle lightstyle 4 g
	popup menuvalue lightstyle lightstyle 5 i
	popup menuvalue lightstyle lightstyle 6 k
	popup menuvalue lightstyle lightstyle 7 m
	popup menuselect lightstyle est_admin/est_settings/lightstyle
	es popup send lightstyle server_var(_popup_userid)
}

block lightstyle
{
	if (server_var(_popup_choice) <= 7) do
	{
		es_format est_tmp2 "0 %1" server_var(lightstyle)
		es_keysetvalue est_admin_config est_settings light_style server_var(est_tmp2)
		es_lightstyle 0 server_var(lightstyle)
		es_xdoblock est_admin/est_settings/light_style
	}
	if (server_var(_popup_choice) == 8) do
	{
		es popup send world_settings server_var(_popup_userid)
	}
}

block connect
{
	es_xusermsg create url1 vguimenu
	es_xusermsg write string url1 "info"
	es_xusermsg write byte url1 1
	es_xusermsg write byte url1 3
	es_xusermsg write string url1 "title"
	es_xusermsg write string url1 "holliday"
	es_xusermsg write string url1 "type"
	es_xusermsg write string url1 2
	es_xusermsg write string url1 "msg"
	es_usermsg write string url1 server_var(connect1)
	es_usermsg send url1 server_var(_popup_userid) 1
	es_xusermsg delete url1
}

event player_spawn
{
	if (server_var(est_scouts) = [scouts-knives]) do
	{
		es est_give event_var(userid) weapon_scout
		es colormsg event_var(userid) #green [scouts-knives]
	}
}

