HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1.  
  2. /*
  3. Round End Protection
  4.  
  5. This Plugin Will Stop Players From Being Harmed/Killed After The ROund Has Ended
  6. */
  7.  
  8. #include <sourcemod>
  9. #include <clients>
  10. #include <sdktools>
  11.  
  12. #define VERSION "0.4" //plugin version
  13.  
  14. new Handle: Switch;
  15. //new bool:RoundEnded = true
  16.  
  17. public Plugin:myinfo =
  18. {
  19. name = "Körvégi védelem",
  20. author = "Peoples Army",
  21. description = "Körvégén nem tudják egymást megölni a játékosok",
  22. version = VERSION,
  23. url = "www.sourcemod.net"
  24. }
  25.  
  26. // hook round end event on plugin start
  27.  
  28. public OnPluginStart()
  29. {
  30. Switch = CreateConVar("round_end_on","1","1 - be | 0 - ki",FCVAR_NOTIFY);
  31. HookEvent("round_end",StopKills, EventHookMode_Pre);
  32. HookEvent("round_start",ResetMode);
  33. ///HookEvent("player_spawn",SpawnEvent);
  34. }
  35.  
  36. // force godmode on all players for round end
  37.  
  38. public Action:StopKills(Handle: event , const String: name[] , bool: dontBroadcast)
  39. {
  40. if(GetConVarInt(Switch))
  41. {
  42. new PLAYERS = GetMaxClients();
  43. //RoundEnded = true;
  44.  
  45. for(new j = 1 ; j <= PLAYERS ; ++j)
  46. {
  47. if(IsValidEntity(j))
  48. {
  49. SetEntProp(j, Prop_Data, "m_takedamage", 0 , 1);
  50. }
  51. }
  52. }
  53. }
  54.  
  55. public ResetMode(Handle: event , const String: name[] , bool: dontBroadcast)
  56. {
  57. if(GetConVarInt(Switch))
  58. {
  59. new PLAYERS = GetMaxClients();
  60. //RoundEnded = false;
  61.  
  62. for(new j = 1 ; j <= PLAYERS ; ++j)
  63. {
  64. if(IsValidEntity(j))
  65. {
  66. SetEntProp(j, Prop_Data, "m_takedamage", 2 , 1);
  67. }
  68. }
  69. }
  70. }
  71. /*
  72. public SpawnEvent(Handle:event,const String:name[],bool:dontBroadcast)
  73. {
  74. new clientID = GetEventInt(event,"userid");
  75. new client = GetClientOfUserId(clientID);
  76.  
  77. if(RoundEnded == true)
  78. {
  79. SetEntProp(client, Prop_Data, "m_takedamage", 0 , 1);
  80. }
  81.  
  82. */