Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. #pragma semicolon 1
  2. #pragma newdecls required
  3.  
  4. #define NAME "Simple Menu"
  5. #define AUTHOR "Master"
  6. #define VERSION "1.0"
  7. #define URL "https://cswild.pl/"
  8.  
  9. #define nullstr NULL_STRING
  10. bool wyswietlone_menu[MAXPLAYERS +1];
  11.  
  12. public Plugin myinfo =
  13. {
  14. name = NAME,
  15. author = AUTHOR,
  16. version = VERSION,
  17. url = URL
  18. };
  19.  
  20. public void OnPluginStart()
  21. {
  22. RegConsoleCmd("sm_help", CMD_Help);
  23. RegConsoleCmd("sm_pomoc", CMD_Help);
  24. HookEvent("player_spawn", OdrodzenieGracza, EventHookMode_Post);
  25. }
  26.  
  27. public void OnClientDisconnect(int client)
  28. {
  29. wyswietlone_menu[client] = false;
  30. }
  31.  
  32. public void OnClientAuthorized(int client)
  33. {
  34. wyswietlone_menu[client] = false;
  35. }
  36.  
  37. public Action CMD_Help(int client, int args)
  38. {
  39. Menu menu = new Menu(Menu_Handler);
  40. menu.SetTitle("Wprowadzenie do gry\n \n");
  41. menu.AddItem(nullstr, "Najważniejsze rzeczy");
  42. menu.AddItem(nullstr, "System punktów i rang");
  43. menu.AddItem(nullstr, "Administracja");
  44. menu.AddItem(nullstr, "Odwiedź nasz Sklep! (klik)");
  45. menu.Display(client, 60);
  46. return Plugin_Handled;
  47. }
  48.  
  49. public int Menu_Handler(Menu menu, MenuAction action, int client, int a)
  50. {
  51. switch(action)
  52. {
  53. case MenuAction_Select:
  54. {
  55. switch(a)
  56. {
  57. case 0: DrawPanel(client, "Na serwerze mamy:\nSystem obstawiania! Wystarczy, że wpiszesz bet drużyna ilość i obstawisz zwycięską drużynę! Pamiętaj, że musisz być martwy.\nSpadochron pod E\nSystem QuickDefuse(kabelki), użycie kiedy bombę i tak rozbroimy jest karane banem!\nAutorski Ranking\nMożesz wybrać własny HYMN MVM pod !mvp\nMożesz wymieniać się itemami ze sklepu z innymi graczami wpisując !trade :)\nPomiędzy rundami, możesz grać w Ping-Ponga!");
  58.  
  59. case 1: DrawPanel(client, "Za każde zabójstwo przeciwnika dostajemy punkty w rankingu, postep możesz sprawdzić wpisując !rank\nRanga odświeża Ci się po każdej zmianie mapy, także nie panikuj jak przez jedną mapę masz ciągle taką samą :P");
  60.  
  61. case 2:DrawPanel(client, "Właściciel:\n-->YuGi*\n\nAdministratorzy:\n-->ASzaz ^.^\n-->ADEK\n-->Sasuke\n-->oOoMACIEKoOo");
  62.  
  63. case 3: FakeClientCommandEx(client, "sm_shop");
  64. }
  65. }
  66. case MenuAction_End:
  67. delete menu;
  68. }
  69. return 0;
  70. }
  71.  
  72. public void DrawPanel(int client, const char[] buffer)
  73. {
  74. Panel panel = new Panel();
  75. panel.SetTitle("Wprowadzenie do gry");
  76. panel.DrawText("----------------------------------------------------------------------------------");
  77. panel.DrawText(buffer);
  78. panel.DrawText("----------------------------------------------------------------------------------");
  79. panel.DrawItem("Wróć");
  80. panel.DrawItem("Wyjdź");
  81. panel.Send(client, PanelHandler, 30);
  82. delete panel;
  83. }
  84.  
  85. public int PanelHandler(Menu menu, MenuAction action, int client, int item)
  86. {
  87. switch(action)
  88. {
  89. case MenuAction_Select:
  90. {
  91. switch(item)
  92. {
  93. case 1: CMD_Help(client, 0);
  94. case 2: delete menu;
  95. }
  96. }
  97. }
  98. }
  99. public void OdrodzenieGracza(Event event, const char[] name, bool dontBroadcast)
  100. {
  101. int client = GetClientOfUserId(GetEventInt(event, "userid"));
  102.  
  103. if(!wyswietlone_menu[client])
  104. FakeClientCommandEx(client, "sm_pomoc");
  105. wyswietlone_menu[client] = true;
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement