Post by LegendofWarior on Sept 22, 2015 15:54:24 GMT
Making Menu is Ultra Easy Just Follow those Steps.
So Lets Make Weapons Menu, Lets start with first step.
Then add All Them and Compile, if compile failed, just ask me
1/ Buidling : Put Inculde first
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <hamsandwich>
2/Register : Register The Plugin and making the command
public plugin_init()
{
register_plugin("Your Menu Name", "1.0", "Your Name");
register_clcmd("say /weapons", "ShowMenu", _, "Made By LegendofWarior");
}
3/Making : Make Menu TAGS
public ShowMenu(id)
{
new menu = menu_create("ZP : Weapons", "mh_weapons menu");
menu_additem(menu, "M4A1", "", 0); // case 0
menu_additem(menu, "AK47", "", 0); // case 1
menu_additem(menu, "UMP45", "", 0); // case 2
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
return PLUGIN_HANDLED;
}
4/Commands : Making TAG Action (only chat)
public mh_weapons menu(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: client_print(id, print_chat, "You have selected M4A1");
case 1: client_print(id, print_chat, "You have selected AK47");
case 2: client_print(id, print_chat, "You have selected UMP45");
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
5/ Actions : Now if you want make actions, follow those steps
Find This
switch(item)
{
case 0: client_print(id, print_chat, "You have selected M4A1");
case 1: client_print(id, print_chat, "You have selected AK47");
case 2: client_print(id, print_chat, "You have selected UMP45");
}
Make it
switch(item)
{
case 0:
{
client_print(id, print_chat, "You have selected M4A1");
//Add Your Code Here
}
case 1:
{
client_print(id, print_chat, "You have selected AK47");
//Add Your Code Here
}
case 2:
{
client_print(id, print_chat, "You have selected UMP45");
//Add Your Code Here
}
}
Here are Some Codes:
give_item(id, "weapon_ak47"); //For Give AK47, You Can Only Change weapon_ak47 to anothor weapon id
set_user_health(id, get_user_health(id) + 150); //For Give More 150 HP, you can only change 150 to anothor valueset_user_armor(id, get_user_armor(id) + 500); //For Give More 500 Armor, you Can Only Change 500 to anothor value
ExecuteHamB(Ham_CS_RoundRespawn, id); //For Revive your Self, You Cant Change AnyThing