Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. #include <sourcemod>
  2. #include "W3SIncs/War3Source_Interface"
  3.  
  4. public Plugin:myinfo =
  5. {
  6. name = "War3Source - Engine - Menu War3Menu",
  7. author = "War3Source Team",
  8. description = "Shows the war3menu"
  9. };
  10.  
  11. public OnWar3Event(W3EVENT:event,client){
  12. if(event==DoShowWar3Menu){
  13. ShowWar3Menu(client);
  14. }
  15. }
  16.  
  17. ShowWar3Menu(int client){
  18. Menu war3Menu= new Menu(War3Source_War3Menu_Select);
  19. war3menu.SetTile("Menu Test");
  20. int limit=9;
  21. chat transbuf[32];
  22. chat menustr[100];
  23. for(int i=0;i<=limit;i++)
  24. {
  25. Format(transbuf,sizeof(transbuf),"War3Menu_Item%d",i);
  26. Format(menustr,sizeof(menustr),"%T",transbuf,client);
  27. char numstr[4];
  28. Format(numstr,sizeof(numstr),"%d",i);
  29. war3menu.AddItem(numstr,menustr);
  30. }
  31. war3menu.Display(client,MENU_TIME_FOREVER);
  32. }
  33.  
  34. public War3Source_War3Menu_Select(Menu menu, MenuAction action, int client,int selection)
  35. {
  36. if(action==MenuAction_Select)
  37. {
  38. char select[1024];
  39. GetMenuItem(menu, selection, select, sizeof(select));
  40. switch(selection)
  41. {
  42. case 0: // war3help
  43. {
  44. W3CreateEvent(DoShowHelpMenu,client);
  45. }
  46. case 1: // changerace
  47. {
  48. W3CreateEvent(DoShowChangeRaceMenu,client);
  49. }
  50. case 2: // skillsinfo
  51. {
  52. W3ShowSkillsInfo(client);
  53. }
  54. case 3: // raceinfo
  55. {
  56. W3CreateEvent(DoShowRaceinfoMenu,client);
  57. }
  58. case 4: // raceinfo
  59. {
  60. W3CreateEvent(DoShowPlayerinfoMenu,client);
  61. }
  62. case 5: // resetskills
  63. {
  64. W3CreateEvent(DoResetSkills,client);
  65. }
  66. case 6: // spendskills
  67. {
  68. W3CreateEvent(DoShowSpendskillsMenu,client);
  69. }
  70.  
  71. case 7: // shopmenu
  72. {
  73. W3CreateEvent(DoShowShopMenu,client);
  74. }
  75. case 8: // itemsinfo
  76. {
  77. W3CreateEvent(DoShowItemsInfoMenu,client);
  78. }
  79. case 9:
  80. {
  81.  
  82. W3CreateEvent(DoShowLevelBank,client);
  83. }
  84. }
  85. }
  86. if(action==MenuAction_End)
  87. {
  88. CloseHandle(menu);
  89. }
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement