Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2. #include <amxmodx>
  3. #include <amxmisc>
  4. #define PLUGIN "Tags"
  5. #define VERSION "0.1"
  6. #define AUTHOR "c4mp3r"
  7.  
  8. #define TAG "wZ ' "
  9.  
  10. new bool:has_tag[33];
  11.  
  12. public plugin_init() {
  13. register_plugin(PLUGIN, VERSION, AUTHOR)
  14. register_clcmd("say /tag", "settag")
  15. }
  16. public client_putinserver(id)
  17. {
  18. new name[32]
  19. get_user_name( id, name, 31 )
  20. if (!(containi(name, TAG) != -1))
  21. {
  22. set_task(20.0, "opentagmenu", id);
  23. }
  24. }
  25. public opentagmenu(id)
  26. {
  27. new line[110];
  28. new name[32]
  29. get_user_name( id, name, 31 )
  30.  
  31. formatex(line, charsmax(line), "\w[\r wolvesZone\w ] - \yDesejas usar a nossa tag?^n\w[ %s\d %s ]^n", TAG, name)
  32. new tagmenu = menu_create(line, "sub_menu")
  33. menu_additem(tagmenu, "Sim", "1");
  34. menu_additem(tagmenu, "Nao", "2");
  35.  
  36. menu_setprop(tagmenu, MPROP_EXIT, MEXIT_ALL);
  37. menu_display(id, tagmenu);
  38. }
  39. public sub_menu(id, tagmenu, item)
  40. {
  41. if (item == MENU_EXIT)
  42. {
  43. menu_destroy(tagmenu);
  44. return PLUGIN_HANDLED;
  45. }
  46.  
  47. new Data[7], Name[64];
  48. new Access, Callback;
  49. menu_item_getinfo(tagmenu, item, Access, Data,5, Name, 63, Callback);
  50.  
  51. new Key = str_to_num(Data);
  52.  
  53. switch (Key)
  54. {
  55. case 1:
  56. settag(id)
  57. }
  58.  
  59. menu_destroy(tagmenu);
  60. return PLUGIN_HANDLED;
  61. }
  62. public settag(id)
  63. {
  64. if(!(has_tag[id]))
  65. {
  66. new szName[32];
  67. get_user_name(id, szName, 31);
  68. client_cmd(id, "name ^"%s %s^"", TAG, szName)
  69. has_tag[id] = true;
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement