SHARE
TWEET

Test menu

orayon May 11th, 2020 (edited) 1,002 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <amxmodx>
  2.  
  3. public plugin_init() register_clcmd("say /menu", "cmdmenu")
  4.  
  5. public cmdmenu(id)
  6. {
  7.     new menu = menu_create("test menu", "menu_handler")
  8.    
  9.     menu_additem(menu, "Item 1")
  10.     menu_additem(menu, "Item 2")
  11.     menu_additem(menu, "Item 3")
  12.  
  13.     menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
  14.    
  15.     menu_display(id, menu)
  16. }
  17.  
  18. public menu_handler(id, menu, item)
  19. {
  20.     if (item == MENU_EXIT)
  21.     {
  22.         menu_destroy(menu)
  23.         return;
  24.     }
  25.    
  26.     switch (item)
  27.     {
  28.         case 0: client_cmd(id, "say im a noob1")
  29.        
  30.         case 1: client_cmd(id, "say im a noob2")
  31.        
  32.         case 2: client_cmd(id, "say im a noob3")
  33.     }
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top