HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #pragma semicolon 1
  2. #include <sourcemod>
  3.  
  4. public Plugin:myinfo =
  5. {
  6. name = "All Command and ConVar Lister",
  7. author = "Upholder of the [BFG]",
  8. description = "A plugin to list all cvars and commands",
  9. version = "1.0",
  10. url = "http://www.sourcemod.net/"
  11. }
  12.  
  13. public OnPluginStart()
  14. {
  15. RegAdminCmd("sm_cvarlist", Command_Mycvrlist, ADMFLAG_CONVARS);
  16. RegAdminCmd("sm_cmdlist", Command_Mycmdlist, ADMFLAG_CONVARS);
  17. }
  18.  
  19. public Action:Command_Mycvrlist(client, args)
  20. {
  21. decl Handle:iter;
  22. decl String:buffer[256], flags, bool:isCommand;
  23. new count = 1;
  24.  
  25. iter = FindFirstConCommand(buffer, sizeof(buffer), isCommand, flags);
  26.  
  27. do
  28. {
  29. if (!isCommand)
  30. {
  31. ReplyToCommand(client, "%s (%d)", buffer, flags);
  32. count += 1;
  33. }
  34. }
  35. while (FindNextConCommand(iter, buffer, sizeof(buffer), isCommand, flags));
  36. ReplyToCommand(client, "Osszes cvar: %d", count);
  37.  
  38. CloseHandle(iter);
  39.  
  40. return Plugin_Handled;
  41. }
  42.  
  43. public Action:Command_Mycmdlist(client, args)
  44. {
  45. decl Handle:iter;
  46. decl String:buffer[256], flags, bool:isCommand;
  47. new count = 1;
  48.  
  49. iter = FindFirstConCommand(buffer, sizeof(buffer), isCommand, flags);
  50.  
  51. do
  52. {
  53. if (isCommand)
  54. {
  55. ReplyToCommand(client, "%s (%d)", buffer, flags);
  56. count += 1;
  57. }
  58. }
  59. while (FindNextConCommand(iter, buffer, sizeof(buffer), isCommand, flags));
  60. ReplyToCommand(client, "Osszes parancs: %d", count);
  61.  
  62. CloseHandle(iter);
  63.  
  64. return Plugin_Handled;
  65. }