•  
     

Plugin Cs 1.6

Alguem Pode Me Fazer Um Plugin De Menu De Armas Para Admins E Vips ?
 
Ta ae parça

Código: Selecionar todos

/* Plugin generated by AMXX-Studio */

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

public plugin_init()
{
	register_plugin("Menu", "1.0", "Ninguem");
	register_clcmd("say /armasvip", "morto", ADMIN_KICK);
	RegisterHam(Ham_Spawn, "player", "player_spawn", 1) 
}
public morto(id)
{
	if((is_user_alive(id)))
	{
		MostrarMenu(id)
	} 
	else
	{  
		client_print(id, print_chat, "Voce precisa estar vivo para abrir o menu")
	}
}
public player_spawn(id)
{
	morto(id)
}
public MostrarMenu(id)
{
	if(!(get_user_flags(id) & ADMIN_KICK))
	{
		return PLUGIN_HANDLED
	}
	new menu = menu_create("Menu de armas", "Funcao");
	
	menu_additem(menu, "\wM4A1 \r+ \wDEAGLE \r+ \yCOLETE \r+ \wCAPACETE \r+ \yGRANADAS", "0", 0); // case 0
	menu_additem(menu, "\wAK47 \r+ \wDEAGLE \r+ \yCOLETE \r+ \wCAPACETE \r+ \yGRANADAS", "1", 0); // case 1
	menu_additem(menu, "\wAWP \r+ \wDEAGLE \r+ \yCOLETE \r+ \wCAPACETE \r+ \yGRANADAS", "3", 0); // case 2
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	
	menu_display(id, menu, 0);
	
	return PLUGIN_HANDLED;
}

public Funcao(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_cancel(id);
		return PLUGIN_HANDLED;
	}
	
	new command[6], name[64], access, callback;
	
	menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
	
	switch(item)
	{
		case 0: 
		{
			strip_user_weapons(id) 
			give_item(id, "weapon_m4a1")
			give_item(id, "weapon_deagle")
			give_item(id, "item_kevlar")
			give_item(id, "item_assaultsuit")
			give_item(id, "weapon_hegrenade")
			give_item(id, "weapon_flashbang")
			give_item(id, "weapon_flashbang")
			give_item(id, "weapon_smokegrenade")
			give_item(id, "weapon_knife")
			cs_set_user_bpammo(id, CSW_M4A1, 90);
			cs_set_user_bpammo(id, CSW_DEAGLE, 32);
		}
		case 1:
		{
			strip_user_weapons(id) 
			give_item(id, "weapon_ak47")
			give_item(id, "weapon_deagle")
			give_item(id, "item_kevlar")
			give_item(id, "item_assaultsuit")
			give_item(id, "weapon_hegrenade")
			give_item(id, "weapon_flashbang")
			give_item(id, "weapon_flashbang")
			give_item(id, "weapon_smokegrenade")
			give_item(id, "weapon_knife")
			cs_set_user_bpammo(id, CSW_AK47, 90);
			cs_set_user_bpammo(id, CSW_DEAGLE, 32);
		}
		case 2: 
		{
			strip_user_weapons(id) 
			give_item(id, "weapon_awp")
			give_item(id, "weapon_deagle")
			give_item(id, "item_kevlar")
			give_item(id, "item_assaultsuit")
			give_item(id, "weapon_hegrenade")
			give_item(id, "weapon_flashbang")
			give_item(id, "weapon_flashbang")
			give_item(id, "weapon_smokegrenade")
			give_item(id, "weapon_knife")
			cs_set_user_bpammo(id, CSW_AWP, 30);
			cs_set_user_bpammo(id, CSW_DEAGLE, 35);
		}
	}
	menu_destroy(menu);
	
	return PLUGIN_HANDLED;
}