#include <amxmodx>  
#include <amxmisc>  
#include <cstrike>  
#include <hamsandwich>  
#include <fun>  

new g_msgSayText
new bool: used[33] 
new bool: used2[33]

//================================================================================
new mpd
new maxplayers
//================================================================================

#pragma tabsize 0 
const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)

public plugin_init()     
{     
    	register_plugin("Wpn_Menu_Update", "1.1 realis", "muxaz")    
	RegisterHam(Ham_Spawn, "player", "Spawn_post", 1)     
	register_clcmd("wpn_menu","clcmd_menu")    
	register_clcmd("wpn_menu2","clcmd_menu2")  
	g_msgSayText = get_user_msgid("SayText") 
//================================================================================
	mpd = register_cvar("money_per_damage","1")
	register_event("Damage","Damage","b")
	maxplayers = get_maxplayers()
//================================================================================
}     

public Spawn_post(id)     
{  
	if(is_user_alive(id) && is_user_connected(id))     
	{     
		my_wpn(id) 
		used[id] = false 
		used2[id] = false 
	}     
}

//================================================================================
public Damage(id)
{
	new weapon, hitpoint, attacker = get_user_attacker(id,weapon,hitpoint)
	if(attacker<=maxplayers && is_user_alive(attacker) && attacker!=id)
	{
		new money = read_data(2) * get_pcvar_num(mpd)
		if(hitpoint==45) money += get_pcvar_num(mpd)
		cs_set_user_money(attacker,cs_get_user_money(attacker) + money)
	}
}
//================================================================================

public clcmd_menu(id)     
{     
	if(is_user_alive(id))     
	{     
		if(!used[id]) 
		my_wpn(id)     
	}   
}     

public clcmd_menu2(id)     
{     
	if(is_user_alive(id))     
	{     
		if(!used2[id]) 
		my_wpn_menu(id)     
	}      
}  

public my_wpn(id)     
{   
	new menu = menu_create("\yChange Weapons:", "new_wpn")   
	menu_additem(menu, "\wM3 \y(1700 $)", "1", 0)   
	menu_additem(menu, "\wXM1014 \y(3000 $)", "2", 0)   
	menu_additem(menu, "\wDouble Burrel \y(2600 $) \r(new)", "3", 0)     
	menu_additem(menu, "\wM1887 \y(2800 $) \r(new)", "4", 0)     
	menu_additem(menu, "\wUSAS12 \y(3350 $) \r(new)", "5", 0)     
	menu_additem(menu, "\wSchmidt Machine Pistol \y(1250 $)", "6", 0)   
	menu_additem(menu, "\wIngram MAC-10 \y(1400 $)", "7", 0)   
	menu_additem(menu, "\wK&M MP5 Navy \y(1500 $)", "8", 0)   
	menu_additem(menu, "\wK&M UMP45 \y(1700 $)", "9", 0)   
	menu_additem(menu, "\wES C90 \y(2350 $)", "10", 0)   
	menu_additem(menu, "\wH&K MP7A1 60R \y(2500 $) \r(new)", "11", 0)     
	menu_additem(menu, "\wThompson Chicago \y(2000 $) \r(new)", "12", 0)     
	menu_additem(menu, "\wDual Kriss Super V \y(2000 $) \r(new)", "13", 0)     
	menu_additem(menu, "\wGalil \y(2000 $)", "14", 0)   
	menu_additem(menu, "\wFamas \y(2250 $)", "15", 0)   
	menu_additem(menu, "\wAK-47 \y(2500 $)", "16", 0)   
	menu_additem(menu, "\wScout \y(2750 $)", "17", 0)   
	menu_additem(menu, "\wM4A1 \y(3100 $)", "18", 0)   
	menu_additem(menu, "\wAUG \y(3500 $)", "19", 0)   
	menu_additem(menu, "\wSG-552 \y(3500 $)", "20", 0)   
	menu_additem(menu, "\wXM8 Limit \y(2450 $) \r(new)", "21", 0)     
	menu_additem(menu, "\wScar Limit \y(2450 $) \r(new)", "22", 0)     
	menu_additem(menu, "\wLeader F2000 \y(3600 $) \r(new)", "23", 0)     
	menu_additem(menu, "\wSG-550 \y(4200 $)", "24", 0) 
	menu_additem(menu, "\wAWP \y(4750 $)", "25", 0)     
	menu_additem(menu, "\wG3SG1 \y(5000 $)", "26", 0)   
	menu_additem(menu, "\wWalther WA2000 \y(4600 $) \r(new)", "27", 0)  
	menu_additem(menu, "\wM249 \y(5750 $)", "28", 0)   
	menu_additem(menu, "\wQBB95-EX \y(3200 $) \r(new)", "29", 0)     
	menu_additem(menu, "\wH&K HK23E \y(4600 $) \r(new)", "30", 0)     
	menu_additem(menu, "\wM60 E4 \y(4700 $) \r(new)", "31", 0)     
	menu_additem(menu, "\wMG36 \y(3500 $) \r(new)", "32", 0)      
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)     
	
	menu_display(id, menu, 0)   
	return PLUGIN_HANDLED    
}     

public new_wpn(id, menu, item)     
{     	
	if (item == MENU_EXIT)     
	{     
		menu_destroy(menu)     
		return PLUGIN_HANDLED     
	}     
	new data[15], iName[64]      
	new access, callback     
	menu_item_getinfo(menu, item, access, data,15, iName, 64, callback)     
	
	new key = str_to_num(data)     
	switch(key)     
	{     
		case 1:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)    
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_M3))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)    
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 1700)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)    
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-1700)
			drop_weapons(id, 1)
			give_item(id, "weapon_m3")  
			cs_set_user_bpammo (id, CSW_M3, 32)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}    
		case 2:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)     
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_XM1014))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)   
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 3000)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)       
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-3000)
			drop_weapons(id, 1)
			give_item(id, "weapon_xm1014")  
			cs_set_user_bpammo (id, CSW_XM1014, 32)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}   
		case 3:     
		{     
			client_cmd(id, "dbarrel")   
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED   
		}   
		case 4:     
		{     
			client_cmd(id, "m1887")   
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED   
		}   
		case 5:     
		{     
			client_cmd(id, "usas")   
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED   
		}   
		case 6:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
          			client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)      
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_TMP))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)   
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 1250)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)       
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-1250)
			drop_weapons(id, 1)
			give_item(id, "weapon_tmp")  
			cs_set_user_bpammo (id, CSW_TMP, 120)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}   
		case 7:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)     
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_MAC10))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)   
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 1400)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)       
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-1400)
			drop_weapons(id, 1)
			give_item(id, "weapon_mac10")  
			cs_set_user_bpammo (id, CSW_MAC10, 100)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}   
		case 8:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)     
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_MP5NAVY))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)   
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 1500)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)       
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-1500)
			drop_weapons(id, 1)
			give_item(id, "weapon_mp5navy")  
			cs_set_user_bpammo (id, CSW_MP5NAVY, 120)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}  
		case 9:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)     
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_UMP45))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)   
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 1700)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)       
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-1700)
			drop_weapons(id, 1)
			give_item(id, "weapon_ump45")  
			cs_set_user_bpammo (id, CSW_UMP45, 100)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}  
		case 10:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)     
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_P90))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)   
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 2350)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)       
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-2350)
			drop_weapons(id, 1)
			give_item(id, "weapon_p90")  
			cs_set_user_bpammo (id, CSW_P90, 100)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}  
		case 11:     
		{     
			client_cmd(id, "mp7a160r")   
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED   
		}   
		case 12:     
		{     
			client_cmd(id, "thompson")   
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED   
		}   
		case 13:     
		{     
			client_cmd(id, "dualkriss")   
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED   
		}   
		case 14:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)     
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_GALIL))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)   
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 2000)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)       
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-2000)
			drop_weapons(id, 1)
			give_item(id, "weapon_galil")  
			cs_set_user_bpammo (id, CSW_GALIL, 90)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}  
		case 15:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)     
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_FAMAS))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)   
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 2250)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)       
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-2250)
			drop_weapons(id, 1)
			give_item(id, "weapon_famas")  
			cs_set_user_bpammo (id, CSW_FAMAS, 90)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}  
		case 16:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)     
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_AK47))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)   
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 2500)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)       
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-2500)
			drop_weapons(id, 1)
			give_item(id, "weapon_ak47")  
			cs_set_user_bpammo (id, CSW_AK47, 90)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}  
		case 17:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)     
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_SCOUT))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)   
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 2750)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)       
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-2750)
			drop_weapons(id, 1)
			give_item(id, "weapon_scout")  
			cs_set_user_bpammo (id, CSW_SCOUT, 90)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}  
		case 18:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)     
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_M4A1))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)   
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 3100)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)       
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-3100)
			drop_weapons(id, 1)
			give_item(id, "weapon_m4a1")  
			cs_set_user_bpammo (id, CSW_M4A1, 90)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}  
		case 19:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)     
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_AUG))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)   
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 3500)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)       
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-3500)
			drop_weapons(id, 1)
			give_item(id, "weapon_aug")  
			cs_set_user_bpammo (id, CSW_AUG, 90)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}  
		case 20:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)     
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_SG552))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)   
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 3500)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)       
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-3500)
			drop_weapons(id, 1)
			give_item(id, "weapon_sg552")  
			cs_set_user_bpammo (id, CSW_SG552, 90)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}  
		case 21:     
		{     
			client_cmd(id, "xm8")   
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED   
		}   
		case 22:     
		{     
			client_cmd(id, "scar")   
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED   
		}   
		case 23:     
		{     
			client_cmd(id, "f2000")   
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED   
		}   
		case 24:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)     
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_SG550))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)   
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 4200)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)       
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-4200)
			drop_weapons(id, 1)
			give_item(id, "weapon_sg550")  
			cs_set_user_bpammo (id, CSW_SG550, 90)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}  
		case 25:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)     
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_AWP))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)   
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 4750)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)       
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-4750)
			drop_weapons(id, 1)
			give_item(id, "weapon_awp")  
			cs_set_user_bpammo (id, CSW_AWP, 30)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}  
		case 26:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)     
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_G3SG1))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)   
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 5000)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)       
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-5000)
			drop_weapons(id, 1)
			give_item(id, "weapon_g3sg1")  
			cs_set_user_bpammo (id, CSW_G3SG1, 90)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}  
		case 27:     
		{     
			client_cmd(id, "wa2000")   
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED   
		}   
		case 28:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)     
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_M249))  
			{
				client_print(id,print_center,"You already own this weapon")
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)   
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 5750)
			{
          			client_print(id,print_center, "You don't have enough money")  
				client_cmd(id, "wpn_menu2")   
				menu_destroy(menu)     
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-5750)
			drop_weapons(id, 1)
			give_item(id, "weapon_m249")  
			cs_set_user_bpammo (id, CSW_M249, 200)  
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED     
		}  
		case 29:     
		{     
			client_cmd(id, "qbb95ex")   
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED   
		}   
		case 30:     
		{     
			client_cmd(id, "hk23")   
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED   
		}   
		case 31:     
		{     
			client_cmd(id, "m60e4")   
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED   
		}   
		case 32:     
		{     
			client_cmd(id, "mg36")   
			client_cmd(id, "wpn_menu2")   
			menu_destroy(menu)    
			return PLUGIN_HANDLED   
		}   
	}     
	menu_destroy(menu)    
	used[id] = true  
	return PLUGIN_HANDLED     
}     

public my_wpn_menu(id)    
{     
	new menu = menu_create("\yChange Weapons:", "new_wpn_menu")     
	menu_additem(menu, "\wGlock18 (400 $)", "1", 0)
	menu_additem(menu, "\wUSP45 Tactical (500 $)", "2", 0)
	menu_additem(menu, "\wP228 Compact (600 $)", "3", 0)   
	menu_additem(menu, "\wDesert Eagle (650 $)", "4", 0)
	menu_additem(menu, "\wES Five-Seven (750 $)", "5", 0)
	menu_additem(menu, "\wDual Elites (800 $)", "6", 0)   
	menu_additem(menu, "\wAnaconda (600 $) \r(new)", "7", 0)
	menu_additem(menu, "\wInfinitys Red (600 $) \r(new)", "8", 0)
	menu_additem(menu, "\wLuger P08 (700 $) \r(new)", "9", 0)   
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)     
	
	menu_display(id, menu, 0)    
	return PLUGIN_HANDLED     
}   

public new_wpn_menu(id, menu, item)     
{     	
	if(item == MENU_EXIT)     
	{     
		menu_destroy(menu)     
		return PLUGIN_HANDLED     
	}     
	new data[15], iName[64]      
	new access, callback     
	menu_item_getinfo(menu, item, access, data,15, iName, 64, callback)     
	
	new key = str_to_num(data)     
	switch(key)     
	{     
		case 1:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_GLOCK18))  
			{
				client_print(id,print_center,"You already own this weapon")
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 400)
			{
          			client_print(id,print_center, "You don't have enough money")  
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-400)
			drop_weapons(id, 2)
			give_item(id, "weapon_glock18")  
			cs_set_user_bpammo (id, CSW_GLOCK18, 120)  
			return PLUGIN_HANDLED     
		}     
		case 2:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_USP))  
			{
				client_print(id,print_center,"You already own this weapon")
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 500)
			{
          			client_print(id,print_center, "You don't have enough money")  
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-500)
			drop_weapons(id, 2)
			give_item(id, "weapon_usp")  
			cs_set_user_bpammo (id, CSW_USP, 100)  
			return PLUGIN_HANDLED     
		}     
		case 3:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_P228))  
			{
				client_print(id,print_center,"You already own this weapon")
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 600)
			{
          			client_print(id,print_center, "You don't have enough money")  
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-600)
			drop_weapons(id, 2)
			give_item(id, "weapon_p228")  
			cs_set_user_bpammo (id, CSW_P228, 53)  
			return PLUGIN_HANDLED     
		}     
		case 4:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_DEAGLE))  
			{
				client_print(id,print_center,"You already own this weapon")
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 650)
			{
          			client_print(id,print_center, "You don't have enough money")  
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-650)
			drop_weapons(id, 2)
			give_item(id, "weapon_deagle")  
			cs_set_user_bpammo (id, CSW_DEAGLE, 35)  
			return PLUGIN_HANDLED     
		}     
		case 5:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_FIVESEVEN))  
			{
				client_print(id,print_center,"You already own this weapon")
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 750)
			{
          			client_print(id,print_center, "You don't have enough money")  
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-750)
			drop_weapons(id, 2)
			give_item(id, "weapon_fiveseven")  
			cs_set_user_bpammo (id, CSW_FIVESEVEN, 100)  
			return PLUGIN_HANDLED     
		}     
		case 6:     
		{     
     		 	if(!cs_get_user_buyzone(id))  
      			{  
       			   	client_print(id,print_center, "You are not in buyzone")  
        		  	return PLUGIN_HANDLED
     		 	}  
      			if(user_has_weapon(id, CSW_ELITE))  
			{
				client_print(id,print_center,"You already own this weapon")
				return PLUGIN_HANDLED
			}
			if(cs_get_user_money(id) < 800)
			{
          			client_print(id,print_center, "You don't have enough money")  
				return PLUGIN_HANDLED
			}
			cs_set_user_money(id,cs_get_user_money(id)-800)
			drop_weapons(id, 2)
			give_item(id, "weapon_elite")  
			cs_set_user_bpammo (id, CSW_ELITE, 120)  
			return PLUGIN_HANDLED     
		}
		case 7:     
		{     
			client_cmd(id, "anaconda")
			return PLUGIN_HANDLED     
		}     
		case 8:     
		{     
			client_cmd(id, "infinitysr")
			return PLUGIN_HANDLED     
		}     
		case 9:     
		{     
			client_cmd(id, "luger")
			return PLUGIN_HANDLED     
		}    
	}     
	menu_destroy(menu)    
	used2[id] = true  
	return PLUGIN_HANDLED     
}   

stock print_col_chat(const id, const input[], any:...)   
{   
	new count = 1, players[32] 
	static msg[191]
	vformat(msg, 190, input, 3)
	replace_all(msg, 190, "!g", "^4") // Green Color   
	replace_all(msg, 190, "!y", "^1") // Default Color 
	replace_all(msg, 190, "!t", "^3") // Team Color   
	if (id) players[0] = id; else get_players(players, count, "ch") 
	{   
		for(new i = 0; i < count; i++)   
		{   
			if(is_user_connected(players[i]))   
			{   
				message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, players[i])   
				write_byte(players[i])  
				write_string(msg)
				message_end() 
			}   
		}   
	}   
}      

stock drop_weapons(id, dropwhat)
{
     static weapons[32], num, i, weaponid
     num = 0
     get_user_weapons(id, weapons, num)
     
     for (i = 0; i < num; i++)
     {
          weaponid = weapons[i]
          
	  if((dropwhat == 1 && ((1<< weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
          {
               static wname[32]
               get_weaponname(weaponid, wname, sizeof wname - 1)
               engclient_cmd(id, "drop", wname)
          }
     }
}