SHARE
TWEET

Untitled

a guest Sep 12th, 2019 101 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. new bool:g_Help[33];
  5. new g_max;
  6.  
  7. public plugin_init()
  8. {
  9.     register_plugin("Help Menu", "1.0", "LondoN eXtream");
  10.    
  11.     register_clcmd("say /help", "say_help");
  12.     register_clcmd("say /menu", "say_menu");
  13.  
  14.     g_max = get_maxplayers();
  15. }
  16.  
  17. public say_help(id)
  18. {
  19.     if(g_Help[id])
  20.     {
  21.         client_print(id, print_chat, "cererea a fost deja depusa");
  22.         return;
  23.     }
  24.  
  25.     g_Help[id] = true;
  26.     client_print(id, print_chat, "cererea ta a fost depusa si va fi acceptata in curand.");
  27. }
  28.  
  29. public say_menu(id)
  30. {
  31.     if(!is_user_admin(id))
  32.         return;
  33.  
  34.     new menuid = menu_create("help", "menu_handler");
  35.  
  36.     for(new i = 0; i <= g_max; i++)
  37.     {
  38.         if(!is_user_connected(i))
  39.             continue;
  40.  
  41.         if(!g_Help[i])
  42.             continue;
  43.  
  44.         new name[32];
  45.         get_user_name(id, name, charsmax(name));
  46.  
  47.         new buffer[2];  buffer[0] = i;  buffer[1] = 0;
  48.         menu_additem(menuid, name, buffer);
  49.     }
  50.  
  51.     menu_setprop(menuid, MPROP_EXIT, MEXIT_ALL);
  52.     menu_display(id, menuid, 0);
  53. }
  54.  
  55. public menu_handler(id, menu, item)
  56. {
  57.     if(item == MENU_EXIT)
  58.     {
  59.         menu_destroy(menu);
  60.         return;
  61.     }
  62.  
  63.     static buff[2], dummy, pid;
  64.     menu_item_getinfo(menu, item, dummy, buff, charsmax(buff), _, _, dummy);
  65.     pid = buff[0];
  66.  
  67.     //
  68.     new target[32];
  69.     get_user_name(pid, target, charsmax(target));
  70.    
  71.     client_print(id, print_chat, "jucatorul %s are help", target);
  72.  
  73.     return;
  74. }
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