HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <cstrike>
  4. #include <sdkhooks>
  5. #pragma semicolon 1
  6.  
  7. /*
  8. Current plugin version
  9. */
  10. #define PLUGIN_VERSION "v3"
  11.  
  12.  
  13. /*
  14.  
  15.  
  16. /*
  17. Bools
  18. */
  19. new bool:bFF;
  20. /*
  21.  
  22. /*
  23. Plugin information
  24. */
  25. public Plugin:myinfo =
  26. {
  27. name = "Friendly Fire CSGO",
  28. author = "Dk--",
  29. description = "enable / disable the friendly fire",
  30. version = PLUGIN_VERSION,
  31. }
  32.  
  33. public OnPluginStart()
  34. {
  35. RegAdminCmd("sm_ff", FF_Command, ADMFLAG_GENERIC);
  36. HookEvent("round_start", OnRoundStart);
  37. }
  38.  
  39.  
  40. public Action:FF_Command(client, args)
  41. {
  42. new Handle:ffMenu = CreateMenu(ffMenu_Action);
  43. SetMenuTitle(ffMenu, "Csapattárs sebzés:");
  44. AddMenuItem(ffMenu, "enable", "Be");
  45. AddMenuItem(ffMenu, "disable", "Ki");
  46. DisplayMenu(ffMenu, client, 20);
  47. return Plugin_Handled;
  48. }
  49. public ffMenu_Action(Handle:ffMenu, MenuAction:action, client, param2)
  50. {
  51. if (action == MenuAction_Select)
  52. {
  53. new String:option[32];
  54. GetMenuItem(ffMenu, param2, option, sizeof(option));
  55.  
  56. if(strcmp(option, "enable") == 0)
  57. {
  58. bFF = true;
  59. SetConVarInt(FindConVar("mp_autokick"), 0);
  60. SetConVarInt(FindConVar("mp_tkpunish"), 0);
  61. SetConVarInt(FindConVar("ff_damage_reduction_bullets"), 0.33);
  62. SetConVarInt(FindConVar("ff_damage_reduction_grenade"), 0.85);
  63. SetConVarInt(FindConVar("ff_damage_reduction_grenade_self"), 1);
  64. SetConVarInt(FindConVar("ff_damage_reduction_other"), 0);
  65. PrintToChatAll("[FF] Csapattárs sebzés bekapcsolva!");
  66. }
  67. if(strcmp(option, "disable") == 0)
  68. {
  69. bFF = false;
  70. SetConVarInt(FindConVar("mp_autokick"), 0);
  71. SetConVarInt(FindConVar("mp_tkpunish"), 0);
  72. SetConVarInt(FindConVar("ff_damage_reduction_bullets"), 0);
  73. SetConVarInt(FindConVar("ff_damage_reduction_grenade"), 0);
  74. SetConVarInt(FindConVar("ff_damage_reduction_grenade_self"), 0);
  75. SetConVarInt(FindConVar("ff_damage_reduction_other"), 0);
  76. PrintToChatAll("[FF] Csapattárs sebzés kikapcsolva!");
  77. }
  78. }
  79. }
  80. public OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
  81. {
  82. bFF = false;
  83. ServerCommand("sm_cvar ff_damage_reduction_bullets 0");
  84. ServerCommand("sm_cvar ff_damage_reduction_grenade 0");
  85. ServerCommand("sm_cvar ff_damage_reduction_grenade_self 0");
  86. ServerCommand("sm_cvar ff_damage_reduction_other 0");
  87. }
  88.