So I think I was mistaken, what you should've done, instead of the if statement, was register_clcmd( "say /vipmenu", "VIPMenu", "ADMIN_LEVEL_A") The admin levels have to be from a-h. then remove the if statement.
Code:
#include <amxmodx>
#include <fun>
new vip_menu
public plugin_init()
{
register_clcmd( "say /vipmenu","VIPMenu", ADMIN_LEVEL_A);
}
public VIPMenu(id)
{
vip_menu = menu_create("\rVip menu:", "menu_handler");
menu_additem(vip_menu, "\wHealth And Armor", "1", 0);
menu_additem(vip_menu, "\wGive Deagle", "2", 0);
menu_additem(vip_menu, "\wGrenades", "3", 0); //is it right?
menu_additem(vip_menu, "\wScout", "4" , 0);
menu_setprop(vip_menu, MPROP_EXIT, MEXIT_ALL);
}
public menu_handler(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
set_user_health(id, 150); //Sets health of id to 150
set_user_armor(id, 200); //Sets armor of id to 200
}
case 2:
{
give_item(id, "weapon_deagle");
give_item(id, "ammo_50ae");
}
case 3:
{
give_item(id, "weapon_flashbang") ;
give_item(id, "weapon_flashbang") ;
give_item(id, "weapon_smokegrenade") ;
give_item(id, "weapon_hegrenade") ;
}
case 4:
{
give_item(id, "weapon_scout") ;
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
Try that and then try to compile. Post the log if it doesn't work.