block menu
{
	es wcsgroup get build_points wcs_tmp1 server_var(wcs_userid)
	if (server_var(wcs_tmp1) >= 5) do
	{
		es_xset wcs_tmp2 0
		es_xformatv wcs_tmp2 "Wood Working Menu | Userid: %1" wcs_userid
		es popup easymenu server_var(wcs_tmp2) _popup_choice wcs/addons/bob_the_builder/bob_menu
		es popup addoption server_var(wcs_tmp2) "physics|props/de_tides/Vending_turtle.mdl|5" "Turtle [5]"
		es popup addoption server_var(wcs_tmp2) "dynamic|props/cs_militia/toilet.mdl|5" "Toilet [5]"
		if (server_var(wcs_tmp) > 1) do
		{
			es popup addoption server_var(wcs_tmp2) "dynamic|props/de_nuke/cinderblock_stack.mdl|5" "Cinder Block [5]"
			es popup addoption server_var(wcs_tmp2) "physics|props/cs_office/file_cabinet3.mdl|5" "File Cabinet [5]"
		}
		if (server_var(wcs_tmp) > 2) do
		{
			es popup addoption server_var(wcs_tmp2) "dynamic|props/cs_office/vending_machine.mdl|10" "Vending Machine [10]"
			es popup addoption server_var(wcs_tmp2) "physics|props_c17/furnitureStove001a.mdl|10" "Stove [10]"
		}
		if (server_var(wcs_tmp) > 3) do
		{
			es popup addoption server_var(wcs_tmp2) "dynamic|props/cs_havana/gazebo.mdl|15" "Gazebo [15]"
			es popup addoption server_var(wcs_tmp2) "dynamic|props_lab/blastdoor001b.mdl|15" "Blast Door [15]"
		}
		es_tell server_var(wcs_userid) #multi #greenWood Working#lightgreen:#default You have server_var(wcs_tmp1) build points to spend on building.
		es popup send server_var(wcs_tmp2) server_var(wcs_userid)
	}
	else do
	{
		es_tell server_var(wcs_userid) #multi #greenWood Working#lightgreen:#default You dont have enough wood points to build anything.
	}
}

block bob_menu
{
	es playerget isdead wcs_dead server_var(_popup_userid)
	if (server_var(wcs_dead) = 0) do
	{
		es_token wcs_tmp1 server_var(_popup_choice) 3 |
		es wcsgroup get build_points wcs_tmp server_var(_popup_userid)
		if (server_var(wcs_tmp) >= server_var(wcs_tmp1)) do
		{
			es_math wcs_tmp - server_var(wcs_tmp1)
			es wcsgroup set build_points server_var(_popup_userid) server_var(wcs_tmp)
			es_tell server_var(_popup_userid) #multi #greenWood Working#lightgreen:#default You have server_var(wcs_tmp) build points left.
			es_token wcs_tmp server_var(_popup_choice) 1 |
			es_token wcs_tmp1 server_var(_popup_choice) 2 |
			es_xformatv wcs_tmp "es_prop_%1_create %2 %3" wcs_tmp _popup_userid wcs_tmp1
			es_xcommandv wcs_tmp
			es_playsound server_var(_popup_userid) ambient/machines/steam_release_1.wav 1.0
			es_xformatv wcs_tmp1 "Wood Working Menu | Userid: %1" _popup_userid
			es popup send server_var(wcs_tmp1) server_var(_popup_userid)
		}
		else do
		{
			es_tell server_var(_popup_userid) #multi #greenWood Working#lightgreen:#default You dont have enough points to create that.
		}
	}
	else do
	{
		es_tell server_var(_popup_userid) #multi #greenWood Working#lightgreen:#default You have to be alive to use the wood working menu.
	}
}
 