HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <sourcemod>
  2.  
  3. #define VERSION "1.0"
  4.  
  5. public Plugin:myinfo =
  6. {
  7. name = "Mapcycle Show",
  8. author = "graczu, i used MaTTe terms script",
  9. description = "Ha 1 játékos beírja hogy: /mapcyle akkor kiadja neki a pálya listát.",
  10. version = VERSION,
  11. url = "http://www.sourcemod.net/"
  12. };
  13.  
  14. public OnPluginStart()
  15. {
  16. CreateConVar("mapcycleshow_version", VERSION, "MapCycle Mutató verzió", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
  17.  
  18. RegConsoleCmd("say", Command_Say);
  19. RegConsoleCmd("say_team", Command_Say);
  20. }
  21.  
  22. public Action:Command_Say(client, args)
  23. {
  24. decl String:text[192];
  25. new startidx = 0;
  26. GetCmdArgString(text, sizeof(text));
  27.  
  28. if (text[strlen(text)-1] == '"')
  29. {
  30. text[strlen(text)-1] = '\0';
  31. startidx = 1;
  32. }
  33.  
  34. if (strcmp(text[startidx], "/mapcycle", false) == 0)
  35. {
  36. Menu_Build(client);
  37. }
  38.  
  39.  
  40. return Plugin_Continue;
  41. }
  42.  
  43.  
  44. public Menu_Build(client)
  45. {
  46. new Handle:hFile = OpenFile("mapcycle.txt", "rt");
  47.  
  48. if(hFile == INVALID_HANDLE)
  49. {
  50. return;
  51. }
  52.  
  53. new String:szReadData[128];
  54.  
  55. new Handle:hMenu = CreatePanel();
  56.  
  57. while(!IsEndOfFile(hFile) && ReadFileLine(hFile, szReadData, sizeof(szReadData)))
  58. {
  59. DrawPanelText(hMenu, szReadData);
  60. }
  61.  
  62. SetPanelTitle(hMenu, "MapCycle:");
  63.  
  64. DrawPanelItem(hMenu, "Close Menu");
  65.  
  66. SendPanelToClient(hMenu, client, Menu_Handler, 60);
  67.  
  68. CloseHandle(hMenu);
  69. }
  70.  
  71. public Menu_Handler(Handle:hMenu, MenuAction:action, param1, param2)
  72. {
  73. if(action == MenuAction_Select)
  74. {
  75. if(param2 == 1)
  76. {
  77. PrintToChat(param1, "\x04[SM] \x01A Mapcycle Menü \x03bezárva!");
  78. }
  79. }
  80. }