├── .gitattributes ├── .gitignore ├── CustomModesConfig.cs ├── FunBaseClass.cs ├── FunBulletTeleport.cs ├── FunC4EveryWhere.cs ├── FunChangeWeaponOnShoot.cs ├── FunCustomConsoleMode.cs ├── FunDropWeaponOnShoot.cs ├── FunFootBall.cs ├── FunHealTeammates.cs ├── FunHealthRaid.cs ├── FunHighHP.cs ├── FunInfiniteGrenade.cs ├── FunJumpOrDie.cs ├── FunMatchPlugin.cs ├── FunMatchPlugin.csproj ├── FunMatchPlugin.sln ├── FunMatchPluginConfig.cs ├── FunNoClip.cs ├── FunPlayerShootExChange.cs ├── FunToTheMoon.cs ├── FunWNoStop.cs ├── LICENSE ├── README.md └── config-example ├── CustomModes.json ├── FunMatchPlugin.json ├── end.cfg └── start.cfg /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled source # 2 | ################### 3 | *.com 4 | *.class 5 | *.dll 6 | *.exe 7 | *.o 8 | *.so 9 | *.pbd 10 | 11 | # Packages # 12 | ############ 13 | # it's better to unpack these files and commit the raw source 14 | # git has its own built in compression methods 15 | *.7z 16 | *.dmg 17 | *.gz 18 | *.iso 19 | *.jar 20 | *.rar 21 | *.tar 22 | *.zip 23 | 24 | # Logs and databases # 25 | ###################### 26 | *.log 27 | *.sql 28 | *.sqlite 29 | 30 | # OS generated files # 31 | ###################### 32 | .DS_Store 33 | .DS_Store? 34 | ._* 35 | .Spotlight-V100 36 | .Trashes 37 | ehthumbs.db 38 | Thumbs.db 39 | 40 | #Dir 41 | /bin/ 42 | /obj/ 43 | *.cache 44 | obj/Debug/net8.0/FunMatchPlugin.AssemblyInfo.cs 45 | /obj 46 | -------------------------------------------------------------------------------- /CustomModesConfig.cs: -------------------------------------------------------------------------------- 1 | namespace FunMatchPlugin; 2 | #pragma warning disable CS8618 // 在退出构造函数时,不可为 null 的字段必须包含非 null 值。请考虑声明为可以为 null。 3 | public class CustomModeInfo 4 | { 5 | public string Decr {get;set;} 6 | public string Fun_cfgfilename {get;set;} 7 | public string Endfun_cfgfilename {get;set;} 8 | } 9 | 10 | public class CustomModesConfig 11 | { 12 | 13 | public List Modes{get;set;} 14 | } 15 | 16 | #pragma warning restore CS8618 // 在退出构造函数时,不可为 null 的字段必须包含非 null 值。请考虑声明为可以为 null。 17 | -------------------------------------------------------------------------------- /FunBaseClass.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API.Core.Translations; 2 | using CounterStrikeSharp.API; 3 | 4 | namespace FunMatchPlugin; 5 | public abstract class FunBaseClass 6 | { 7 | public bool Enabled = false; 8 | abstract public string Decription{get;} 9 | public FunBaseClass(FunMatchPlugin plugin) 10 | { 11 | RegisterCommand(plugin); 12 | } 13 | public FunBaseClass(){} 14 | public abstract void Fun(FunMatchPlugin plugin); 15 | public abstract void EndFun(FunMatchPlugin plugin); 16 | public virtual void RegisterCommand(FunMatchPlugin plugin){} 17 | public virtual void DisPlayHelp() 18 | { 19 | Server.PrintToChatAll(StringExtensions.ReplaceColorTags("{RED}") + "[FunMatchPlugin] " + this.Decription); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /FunBulletTeleport.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API.Core; 2 | using CounterStrikeSharp.API.Modules.Utils; 3 | 4 | namespace FunMatchPlugin; 5 | 6 | public class FunBulletTeleport : FunBaseClass 7 | { 8 | public override string Decription => "Bullet Teleport 瞬移子弹"; 9 | public FunBulletTeleport (FunMatchPlugin plugin): base(plugin){} 10 | private BasePlugin.GameEventHandler? EventBulletImpactHandler; 11 | public override void Fun(FunMatchPlugin plugin) 12 | { 13 | if (Enabled) return; 14 | Enabled = true; 15 | plugin.RegisterEventHandler (EventBulletImpactHandler = (@event, info) => 16 | { 17 | if (Enabled == false) return HookResult.Stop; 18 | Vector Position = new Vector(@event.X,@event.Y,@event.Z); 19 | var oringin = @event.Userid!.OriginalControllerOfCurrentPawn.Get()!; 20 | if (oringin is null) return HookResult.Continue; 21 | var oringinpawn = oringin.PlayerPawn.Get(); 22 | if (oringinpawn is null) return HookResult.Continue; 23 | oringinpawn!.Teleport(Position); 24 | return HookResult.Continue; 25 | }); 26 | } 27 | 28 | public override void RegisterCommand(FunMatchPlugin plugin) 29 | { 30 | } 31 | public override void EndFun(FunMatchPlugin plugin) 32 | { 33 | plugin.DeregisterEventHandler (EventBulletImpactHandler!); 34 | Enabled = false; 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /FunC4EveryWhere.cs: -------------------------------------------------------------------------------- 1 | namespace FunMatchPlugin; 2 | 3 | using System.Runtime.InteropServices; 4 | using CounterStrikeSharp.API; 5 | using CounterStrikeSharp.API.Core; 6 | using CounterStrikeSharp.API.Core.Translations; 7 | using CounterStrikeSharp.API.Modules.Cvars; 8 | using CounterStrikeSharp.API.Modules.Entities.Constants; 9 | using CounterStrikeSharp.API.Modules.Memory.DynamicFunctions; 10 | using CounterStrikeSharp.API.Modules.Timers; 11 | using CounterStrikeSharp.API.Modules.Utils; 12 | 13 | // gameRules not working https://github.com/roflmuffin/CounterStrikeSharp/issues/489 14 | public class FunC4EveryWhere : FunBaseClass 15 | { 16 | public override string Decription => "C4 EveryWhere 10s to explode C4大战 10s爆炸"; 17 | public FunC4EveryWhere(FunMatchPlugin plugin) : base(plugin){} 18 | public CCSGameRules? gameRules = null; 19 | private Timer? roundTimer = null; 20 | 21 | private Timer? roundTimer90 = null; 22 | private Timer? roundTimer60 = null; 23 | private Timer? roundTimer110 = null; 24 | private bool TeamHasWon = false; 25 | private CTeam? Team_CT; 26 | private CTeam? Team_T; 27 | 28 | private BasePlugin.GameEventHandler? EventBombPlantedHandler=null; 29 | private BasePlugin.GameEventHandler? EventPlayerDeathHandler=null; 30 | public override void Fun(FunMatchPlugin plugin) 31 | { 32 | Enabled = true; 33 | ConVar.Find("sv_cheats")!.SetValue(true); 34 | ConVar.Find("mp_autokick")!.SetValue(false); 35 | ConVar.Find("mp_c4timer")!.SetValue(10); 36 | ConVar.Find("mp_plant_c4_anywhere")!.SetValue(true); 37 | ConVar.Find("mp_c4_cannot_be_defused")!.SetValue(true); 38 | ConVar.Find("mp_anyone_can_pickup_c4")!.SetValue(true); 39 | //ConVar.Find("mp_ignore_round_win_conditions")!.SetValue(true); 40 | ConVar.Find("sv_cheats")!.SetValue(false); 41 | 42 | var gameRulesProxie = Utilities.FindAllEntitiesByDesignerName("cs_gamerules"); 43 | var CTeamArray = Utilities.FindAllEntitiesByDesignerName("cs_team_manager").ToArray(); 44 | gameRules = gameRulesProxie.First().GameRules!; 45 | foreach (var t in CTeamArray) 46 | { 47 | if (t.Teamname == "CT") 48 | Team_CT = t; 49 | if (t.Teamname == "TERRORIST") 50 | Team_T = t; 51 | } 52 | 53 | if (gameRules is null || Team_CT is null || Team_T is null) 54 | { 55 | Console.WriteLine("[C4 everywhere] Exception No Gamesrules/Team CTorT Found"); 56 | return; 57 | } 58 | 59 | var Allplayers = Utilities.GetPlayers(); 60 | foreach (var p in Allplayers) 61 | { 62 | if (!p.IsValid) continue; 63 | p.RemoveWeapons(); 64 | p.GiveNamedItem(CsItem.C4); 65 | p.GiveNamedItem(CsItem.Knife); 66 | p.RemoveAllItemsOnNextRoundReset = true; 67 | } 68 | plugin.RegisterEventHandler (EventBombPlantedHandler = (@event,info)=> 69 | { 70 | if (Enabled == false) return HookResult.Stop; 71 | var player = @event.Userid!.OriginalControllerOfCurrentPawn.Get(); 72 | if (player is null || !player.IsValid) return HookResult.Continue; 73 | player.GiveNamedItem(CsItem.C4); 74 | return HookResult.Continue; 75 | }); 76 | 77 | if(gameRules.WarmupPeriod) return; 78 | 79 | roundTimer = plugin.AddTimer(120, ()=>CTWin() , TimerFlags.STOP_ON_MAPCHANGE); 80 | roundTimer60 = plugin.AddTimer(60, ()=>Server.PrintToChatAll(StringExtensions.ReplaceColorTags("{RED}") + "[C4 Everywhere] 60s Left 剩余60s") , TimerFlags.STOP_ON_MAPCHANGE); 81 | roundTimer90 = plugin.AddTimer(90, ()=>Server.PrintToChatAll(StringExtensions.ReplaceColorTags("{RED}") + "[C4 Everywhere] 30s Left 剩余30s") , TimerFlags.STOP_ON_MAPCHANGE); 82 | roundTimer110 = plugin.AddTimer(110, ()=>Server.PrintToChatAll(StringExtensions.ReplaceColorTags("{RED}") + "[C4 Everywhere] 10s Left 剩余10s") , TimerFlags.STOP_ON_MAPCHANGE); 83 | 84 | plugin.RegisterEventHandler (EventPlayerDeathHandler = (@event,info)=> 85 | { 86 | if (Enabled == false) return HookResult.Stop; 87 | if (TeamHasWon == true) return HookResult.Stop; 88 | int ct_num = AlivePlayerNum(CsTeam.CounterTerrorist); 89 | int t_num = AlivePlayerNum(CsTeam.Terrorist); 90 | if (@event.Userid is null || !@event.Userid.IsValid) return HookResult.Continue; 91 | if (@event.Userid.Team == CsTeam.CounterTerrorist) 92 | ct_num --; 93 | if (@event.Userid.Team == CsTeam.Terrorist) 94 | t_num --; 95 | if (t_num == 0 && ct_num == 0) 96 | { 97 | //gameRules.TerminateRound(3.0f,RoundEndReason.RoundDraw); 98 | TerminateRoundFix(3.0f,RoundEndReason.RoundDraw); 99 | roundTimer!.Kill(); 100 | roundTimer60!.Kill(); 101 | roundTimer90!.Kill(); 102 | roundTimer110!.Kill(); 103 | TeamHasWon = true; 104 | var q = @event.Userid.Team; 105 | } 106 | else if (t_num == 0) 107 | { 108 | //gameRules.TerminateRound(3.0f,RoundEndReason.CTsWin); 109 | TerminateRoundFix(3.0f,RoundEndReason.TargetBombed); 110 | roundTimer!.Kill(); 111 | roundTimer60!.Kill(); 112 | roundTimer90!.Kill(); 113 | roundTimer110!.Kill(); 114 | TeamHasWon = true; 115 | Team_CT!.Score++; 116 | Utilities.SetStateChanged(Team_CT,"CTeam", "m_iScore"); 117 | } 118 | else if (ct_num == 0) 119 | { 120 | //gameRules.TerminateRound(3.0f,RoundEndReason.TerroristsWin); 121 | TerminateRoundFix(3.0f,RoundEndReason.BombDefused); 122 | roundTimer!.Kill(); 123 | roundTimer60!.Kill(); 124 | roundTimer90!.Kill(); 125 | roundTimer110!.Kill(); 126 | TeamHasWon = true; 127 | Team_T!.Score++; 128 | Utilities.SetStateChanged(Team_T,"CTeam", "m_iScore"); 129 | } 130 | return HookResult.Continue; 131 | }); 132 | 133 | } 134 | private void CTWin() 135 | { 136 | //gameRules!.TerminateRound(0.1f,RoundEndReason.CTsWin); 137 | //gameRules!.RoundWinStatus = 8; 138 | //gameRules!.TotalRoundsPlayed++; 139 | //gameRules!.ITotalRoundsPlayed++; 140 | TerminateRoundFix(3.0f,RoundEndReason.CTsWin); 141 | roundTimer!.Kill(); 142 | roundTimer60!.Kill(); 143 | roundTimer90!.Kill(); 144 | roundTimer110!.Kill(); 145 | TeamHasWon = true; 146 | Team_CT!.Score++; 147 | Utilities.SetStateChanged(Team_CT,"CTeam", "m_iScore"); 148 | 149 | } 150 | 151 | private int AlivePlayerNum(CsTeam csTeam) 152 | { 153 | int players = 0; 154 | foreach (var player in Utilities.GetPlayers().Where(player => player.IsValid && player.Connected == PlayerConnectedState.PlayerConnected && player.PawnIsAlive)) 155 | { 156 | if (player.Team == csTeam) 157 | players++; 158 | } 159 | return players; 160 | } 161 | 162 | public override void EndFun(FunMatchPlugin plugin) 163 | { 164 | Enabled = false; 165 | ConVar.Find("sv_cheats")!.SetValue(true); 166 | ConVar.Find("mp_autokick")!.SetValue(true); 167 | ConVar.Find("mp_c4timer")!.SetValue(40); 168 | ConVar.Find("mp_plant_c4_anywhere")!.SetValue(false); 169 | ConVar.Find("mp_c4_cannot_be_defused")!.SetValue(false); 170 | ConVar.Find("mp_anyone_can_pickup_c4")!.SetValue(false); 171 | ConVar.Find("mp_ignore_round_win_conditions")!.SetValue(false); 172 | ConVar.Find("sv_cheats")!.SetValue(false); 173 | if (roundTimer is not null) 174 | roundTimer!.Kill(); 175 | if (roundTimer60 is not null) 176 | roundTimer60!.Kill(); 177 | if (roundTimer90 is not null) 178 | roundTimer90!.Kill(); 179 | if (roundTimer110 is not null) 180 | roundTimer110!.Kill(); 181 | TeamHasWon = false; 182 | if (EventBombPlantedHandler is not null) 183 | plugin.DeregisterEventHandler(EventBombPlantedHandler); 184 | if (EventPlayerDeathHandler is not null) 185 | plugin.DeregisterEventHandler(EventPlayerDeathHandler); 186 | 187 | } 188 | 189 | // to be fixed in https://github.com/roflmuffin/CounterStrikeSharp/issues/489 190 | public void TerminateRoundFix(float delay, RoundEndReason roundEndReason) 191 | { 192 | if (gameRules is null) return; 193 | if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) 194 | TerminateRound(gameRules!.Handle,delay, roundEndReason, 0, 0); 195 | else 196 | TerminateRoundLinux(gameRules!.Handle, roundEndReason, 0, 0, delay); 197 | 198 | } 199 | public static MemoryFunctionVoid TerminateRoundFunc = 200 | new(GameData.GetSignature("CCSGameRules_TerminateRound")); 201 | public static Action TerminateRound = TerminateRoundFunc.Invoke; 202 | public static MemoryFunctionVoid TerminateRoundLinuxFunc = 203 | new(GameData.GetSignature("CCSGameRules_TerminateRound")); 204 | public static Action TerminateRoundLinux = TerminateRoundLinuxFunc.Invoke; 205 | 206 | } 207 | 208 | -------------------------------------------------------------------------------- /FunChangeWeaponOnShoot.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API; 2 | using CounterStrikeSharp.API.Core; 3 | using CounterStrikeSharp.API.Modules.Entities.Constants; 4 | using CounterStrikeSharp.API.Modules.Utils; 5 | 6 | namespace FunMatchPlugin; 7 | 8 | public class FunChangeWeaponOnShoot : FunBaseClass 9 | { 10 | public override string Decription => "Change Weapon OnShoot 射击换枪"; 11 | private BasePlugin.GameEventHandler? EventBulletImpactHandler=null; 12 | private Random random = new Random(); 13 | public override void Fun(FunMatchPlugin plugin) 14 | { 15 | if (Enabled) return; 16 | Enabled = true; 17 | //EventPlayerShoot Not Working 18 | plugin.RegisterEventHandler (EventBulletImpactHandler = (@event, info) => 19 | { 20 | if (Enabled == false) return HookResult.Stop; 21 | if (@event.Userid == null) return HookResult.Continue; 22 | //200-209 300-312 400-410 23 | //give random weapon ON shoot 24 | var guntype = random.Next(2,5); 25 | int guntype_add = 0; 26 | switch (guntype) 27 | { 28 | case 2: 29 | { 30 | guntype_add = random.Next(0,10); 31 | break; 32 | } 33 | case 3: 34 | { 35 | guntype_add = random.Next(0,13); 36 | break; 37 | } 38 | case 4: 39 | { 40 | guntype_add = random.Next(0,11); 41 | break; 42 | } 43 | } 44 | CsItem csItem = (CsItem)(guntype * 100 + guntype_add); 45 | 46 | var player = @event.Userid!.OriginalControllerOfCurrentPawn.Get(); 47 | var pawn = player!.PlayerPawn.Get(); 48 | var cur_weapon = pawn!.WeaponServices!.ActiveWeapon.Get(); 49 | if (cur_weapon is null) return HookResult.Continue; 50 | if (cur_weapon.DesignerName == "weapon_c4" || cur_weapon.DesignerName == "weapon_knife" || cur_weapon.DesignerName == "weapon_knife_t") 51 | return HookResult.Continue; 52 | 53 | player!.DropActiveWeapon(); 54 | 55 | player!.GiveNamedItem(csItem); 56 | Server.NextFrame(()=>{ 57 | cur_weapon!.Remove(); 58 | if (pawn!.WeaponServices!.ActiveWeapon.Get() is null) 59 | { 60 | player!.GiveNamedItem(CsItem.Knife); 61 | } 62 | }); 63 | return HookResult.Continue; 64 | }); 65 | } 66 | 67 | public override void EndFun(FunMatchPlugin plugin) 68 | { 69 | Enabled = false; 70 | plugin.DeregisterEventHandler(EventBulletImpactHandler!); 71 | } 72 | } 73 | 74 | -------------------------------------------------------------------------------- /FunCustomConsoleMode.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API; 2 | using CounterStrikeSharp.API.Core.Translations; 3 | 4 | namespace FunMatchPlugin; 5 | 6 | public class FunCustomConsoleMode : FunBaseClass 7 | { 8 | public string DecriptionCustom; 9 | private string CFGLoadFile; 10 | private string CFGUnLoadFile; 11 | public override string Decription => "Custom Modes"; 12 | 13 | public FunCustomConsoleMode(string decr,string loadFile, string unLoadFile) 14 | { 15 | DecriptionCustom = decr; 16 | CFGLoadFile = loadFile; 17 | CFGUnLoadFile = unLoadFile; 18 | } 19 | 20 | public override void EndFun(FunMatchPlugin plugin) 21 | { 22 | Enabled = false; 23 | Server.ExecuteCommand("exec " + CFGUnLoadFile); 24 | } 25 | 26 | public override void Fun(FunMatchPlugin plugin) 27 | { 28 | if (Enabled == true) return; 29 | Enabled = true; 30 | Server.ExecuteCommand("exec " + CFGLoadFile); 31 | } 32 | public override void DisPlayHelp() 33 | { 34 | Server.PrintToChatAll(StringExtensions.ReplaceColorTags("{RED}") + "[FunMatchPlugin] " + DecriptionCustom); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /FunDropWeaponOnShoot.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API; 2 | using CounterStrikeSharp.API.Core; 3 | using CounterStrikeSharp.API.Modules.Entities.Constants; 4 | using CounterStrikeSharp.API.Modules.Utils; 5 | 6 | namespace FunMatchPlugin; 7 | 8 | public class FunDropWeaponOnShoot : FunBaseClass 9 | { 10 | public override string Decription => "Drop Weapon OnShoot 射击丢枪"; 11 | private BasePlugin.GameEventHandler? EventBulletImpactHandler=null; 12 | public override void Fun(FunMatchPlugin plugin) 13 | { 14 | if (Enabled) return; 15 | Enabled = true; 16 | //EventPlayerShoot Not Working 17 | plugin.RegisterEventHandler (EventBulletImpactHandler = (@event, info) => 18 | { 19 | if (Enabled == false) return HookResult.Stop; 20 | var player = @event.Userid!.OriginalControllerOfCurrentPawn.Get(); 21 | var pawn = player!.PlayerPawn.Get(); 22 | var cur_weapon = pawn!.WeaponServices!.ActiveWeapon.Get(); 23 | if (cur_weapon is null) return HookResult.Continue; 24 | if (cur_weapon.DesignerName == "weapon_c4" || cur_weapon.DesignerName == "weapon_knife" || cur_weapon.DesignerName == "weapon_knife_t") 25 | return HookResult.Continue; 26 | 27 | player!.DropActiveWeapon(); 28 | Server.NextFrame(()=>{ 29 | if (pawn!.WeaponServices!.ActiveWeapon.Get() is null) 30 | { 31 | player!.GiveNamedItem(CsItem.Knife); 32 | } 33 | }); 34 | return HookResult.Continue; 35 | }); 36 | } 37 | 38 | public override void EndFun(FunMatchPlugin plugin) 39 | { 40 | Enabled = false; 41 | plugin.DeregisterEventHandler(EventBulletImpactHandler!); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /FunFootBall.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API; 2 | using CounterStrikeSharp.API.Core; 3 | using CounterStrikeSharp.API.Modules.Utils; 4 | 5 | namespace FunMatchPlugin; 6 | 7 | using CounterStrikeSharp.API.Core.Translations; 8 | using CounterStrikeSharp.API.Modules.Cvars; 9 | using CounterStrikeSharp.API.Modules.Timers; 10 | 11 | public class FunFootBall : FunBaseClass 12 | { 13 | public override string Decription => "FootBall Mode T aims to take soccerball to CTspawn 足球模式 T需要将球踢进CT出生点"; 14 | 15 | private CPhysicsProp ?SoccerBall; 16 | private Timer ?BallStatusTimer; 17 | private Vector ScoreCenter = new(0,0,0); 18 | private Vector SoccerLastPosition = new(0,0,0); 19 | private Vector SoccerSpawnPosition = new(0,0,0); 20 | private int soccer_same_pos_times = 0; 21 | private BasePlugin.GameEventHandler ?EventRoundFreezeEndHandler; 22 | public override void EndFun(FunMatchPlugin plugin) 23 | { 24 | Enabled = false; 25 | ConVar.Find("mp_buytime")!.SetValue(20.0f); 26 | ConVar.Find("mp_autokick")!.SetValue(true); 27 | ConVar.Find("mp_buy_during_immunity")!.SetValue(0); 28 | if (EventRoundFreezeEndHandler is not null) 29 | plugin.DeregisterEventHandler(EventRoundFreezeEndHandler!); 30 | if (BallStatusTimer is not null) 31 | BallStatusTimer!.Kill(); 32 | } 33 | public override void Fun(FunMatchPlugin plugin) 34 | { 35 | if (Enabled) return; 36 | Enabled = true; 37 | ScoreCenter = new(0,0,0); 38 | SoccerLastPosition = new(0,0,0); 39 | SoccerSpawnPosition = new(0,0,0); 40 | soccer_same_pos_times = 0; 41 | ConVar.Find("mp_buytime")!.SetValue(0.0f); 42 | ConVar.Find("mp_autokick")!.SetValue(false); 43 | ConVar.Find("mp_buy_during_immunity")!.SetValue(1); 44 | var Allplayers = Utilities.GetPlayers(); 45 | foreach (var p in Allplayers) 46 | { 47 | if (!p.IsValid || !p.PawnIsAlive) continue; 48 | p.RemoveWeapons(); 49 | } 50 | /* 51 | var gameRulesProxie = Utilities.FindAllEntitiesByDesignerName("cs_gamerules"); 52 | var gameRules = gameRulesProxie.First().GameRules!; 53 | var spawnpoints_ct = gameRules.CTSpawnPoints.GetEnumerator(); 54 | foreach (var sp in spawnpoints_ct) 55 | { 56 | //ScoreCenter.X += sp!.AbsOrigin!.X; 57 | //ScoreCenter.Y += sp!.AbsOrigin!.Y; 58 | //ScoreCenter.Z += sp!.AbsOrigin!.Z; 59 | Console.WriteLine($"scorecenter{sp!.AbsOrigin!.X} {sp!.AbsOrigin!.Y} {sp!.AbsOrigin!.Z}"); 60 | } 61 | ScoreCenter.X = ScoreCenter.X/gameRules.SpawnPointCount_CT; 62 | ScoreCenter.Y = ScoreCenter.Y/gameRules.SpawnPointCount_CT; 63 | ScoreCenter.Z = ScoreCenter.Z/gameRules.SpawnPointCount_CT; 64 | Console.WriteLine($"scorecenter{ScoreCenter.X} {ScoreCenter.Y} {ScoreCenter.Z}"); 65 | */ 66 | plugin.RegisterEventHandler(EventRoundFreezeEndHandler = (@event, info)=> 67 | { 68 | var Allplayers = Utilities.GetPlayers(); 69 | bool HasGivenBall = false; 70 | bool HasSetScorePoint = false; 71 | //mp_buytime 72 | foreach (var p in Allplayers) 73 | { 74 | if (!p.IsValid || !p.PawnIsAlive) continue; 75 | p.RemoveWeapons(); 76 | if (p.PawnIsAlive && p.Team == CsTeam.Terrorist && HasGivenBall == false) 77 | { 78 | HasGivenBall = true; 79 | SoccerBall = Utilities.CreateEntityByName("prop_physics_multiplayer")!; 80 | var pawn = p.PlayerPawn.Get(); 81 | Vector position = new(pawn!.AbsOrigin!.X,pawn!.AbsOrigin!.Y,pawn!.AbsOrigin!.Z + 100); 82 | SoccerBall.Teleport(position); 83 | SoccerBall.SetModel("models/props/de_dust/hr_dust/dust_soccerball/dust_soccer_ball001.vmdl"); 84 | //models/props/de_dust/hr_dust/dust_soccerball/dust_soccer_ball001.vmdl_c 85 | SoccerSpawnPosition.X = SoccerBall!.AbsOrigin!.X; 86 | SoccerSpawnPosition.Y = SoccerBall!.AbsOrigin!.Y; 87 | SoccerSpawnPosition.Z = SoccerBall!.AbsOrigin!.Z; 88 | //SoccerBall.GlowColor = Color.GreenYellow; 89 | 90 | SoccerBall.DispatchSpawn(); 91 | } 92 | if (p.PawnIsAlive && p.Team == CsTeam.CounterTerrorist && HasSetScorePoint == false) 93 | { 94 | HasSetScorePoint = true; 95 | //models/props_fairgrounds/fairgrounds_flagpole01.vmdl 96 | var flag = Utilities.CreateEntityByName("prop_dynamic")!; 97 | var pawn = p.PlayerPawn.Get(); 98 | //Vector position = new(pawn!.AbsOrigin!.X,pawn!.AbsOrigin!.Y,pawn!.AbsOrigin!.Z); 99 | flag.Teleport(pawn!.AbsOrigin); 100 | flag.SetModel("models/props_fairgrounds/fairgrounds_flagpole01.vmdl"); 101 | flag.DispatchSpawn(); 102 | ScoreCenter = flag!.AbsOrigin!; 103 | } 104 | } 105 | //CCSPlayerResource siteA siteB position? 106 | //Utilities.FindAllEntitiesByDesignerName("???"); 107 | BallStatusTimer = plugin.AddTimer(1,()=>CheckBallStatus(),TimerFlags.REPEAT); 108 | return HookResult.Stop; 109 | }); 110 | 111 | plugin.RegisterEventHandler((@event, info)=> 112 | { 113 | EndFun(plugin); 114 | return HookResult.Stop; 115 | }); 116 | } 117 | 118 | private void CheckBallStatus() 119 | { 120 | if (Enabled == false) 121 | { 122 | BallStatusTimer!.Kill(); 123 | return; 124 | } 125 | if (SoccerBall == null) 126 | { 127 | BallStatusTimer!.Kill(); 128 | return; 129 | } 130 | if (IsBallIn()) 131 | { 132 | TWin(); 133 | return; 134 | } 135 | if (IsBallFalling() || IsBallStuck()) 136 | { 137 | if (SoccerBall!.IsValid) 138 | SoccerBall.Teleport(SoccerSpawnPosition); 139 | SoccerLastPosition.X = SoccerSpawnPosition.X; 140 | SoccerLastPosition.Y = SoccerSpawnPosition.Y; 141 | SoccerLastPosition.Z = SoccerSpawnPosition.Z; 142 | } 143 | } 144 | 145 | private bool IsBallIn() 146 | { 147 | if (!SoccerBall!.IsValid) return false; 148 | var ball_x = SoccerBall.AbsOrigin!.X; 149 | var ball_y = SoccerBall.AbsOrigin!.Y; 150 | var ball_z = SoccerBall.AbsOrigin!.Z; 151 | if (Math.Abs(ScoreCenter.X-ball_x) <= 500 && Math.Abs(ScoreCenter.Y-ball_y) <= 500 && Math.Abs(ScoreCenter.Z-ball_z) <= 50) 152 | return true; 153 | else return false; 154 | } 155 | 156 | private void TWin() 157 | { 158 | var gameRulesProxie = Utilities.FindAllEntitiesByDesignerName("cs_gamerules"); 159 | var gameRules = gameRulesProxie.First().GameRules!; 160 | if (gameRules!.WarmupPeriod) 161 | return; 162 | var Allplayers = Utilities.GetPlayers(); 163 | foreach (var p in Allplayers) 164 | { 165 | if (!p.IsValid) continue; 166 | if (p.Team == CsTeam.CounterTerrorist) 167 | { 168 | p.CommitSuicide(false,true); 169 | } 170 | } 171 | } 172 | 173 | private bool IsBallStuck() 174 | { 175 | if (SoccerBall!.AbsOrigin!.X == SoccerLastPosition.X && SoccerBall!.AbsOrigin.Y == SoccerLastPosition.Y && SoccerBall!.AbsOrigin.Z == SoccerLastPosition.Z) 176 | { 177 | soccer_same_pos_times++; 178 | } 179 | else 180 | { 181 | soccer_same_pos_times = 0; 182 | SoccerLastPosition.X = SoccerBall!.AbsOrigin!.X; 183 | SoccerLastPosition.Y = SoccerBall!.AbsOrigin!.Y; 184 | SoccerLastPosition.Z = SoccerBall!.AbsOrigin!.Z; 185 | } 186 | if (soccer_same_pos_times >= 5) 187 | { 188 | Server.PrintToChatAll(StringExtensions.ReplaceColorTags("{RED}") + "[FootBallMode] " + "Ball Stuck Resetting"); 189 | return true; 190 | } 191 | 192 | return false; 193 | } 194 | 195 | private bool IsBallFalling() 196 | { 197 | if (SoccerBall!.AbsOrigin!.Z - SoccerLastPosition.Z < -400) 198 | { 199 | Server.PrintToChatAll(StringExtensions.ReplaceColorTags("{RED}") + "[FootBallMode] " + "Ball Falling Resetting"); 200 | return true; 201 | } 202 | return false; 203 | } 204 | } 205 | -------------------------------------------------------------------------------- /FunHealTeammates.cs: -------------------------------------------------------------------------------- 1 | namespace FunMatchPlugin; 2 | 3 | using System.Data.Common; 4 | using CounterStrikeSharp.API; 5 | using CounterStrikeSharp.API.Core; 6 | using CounterStrikeSharp.API.Modules.Cvars; 7 | using CounterStrikeSharp.API.Modules.Timers; 8 | 9 | 10 | 11 | public class FunHealTeammates : FunBaseClass 12 | { 13 | public override string Decription => "Heal Teammates 治疗队友"; 14 | 15 | public FunHealTeammates(FunMatchPlugin plugin) : base(plugin){} 16 | public float BurnAfterSecond = 1.0F; 17 | public int BurnDamage = 5; 18 | public int HealValue = 10; 19 | private bool ?LastConvar_friendlyfire; 20 | private BasePlugin.GameEventHandler? EventRoundFreezeEndHandler; 21 | private BasePlugin.GameEventHandler? EventPlayerDisconnectHandler; 22 | private BasePlugin.GameEventHandler? EventPlayerConnectFullHandler; 23 | private BasePlugin.GameEventHandler? EventPlayerHurtHandler; 24 | private Dictionary playerTimersDict = new (); 25 | private void BurnPlayer(CCSPlayerPawn? pawn) 26 | { 27 | if (pawn is null) return; 28 | pawn.Health -= BurnDamage; 29 | pawn.ApplyStressDamage = true; 30 | Utilities.SetStateChanged(pawn, "CBaseEntity", "m_iHealth"); 31 | if (pawn.Health <= 0) 32 | { 33 | pawn.CommitSuicide(true,true); 34 | } 35 | } 36 | public override void EndFun(FunMatchPlugin plugin) 37 | { 38 | Enabled = false; 39 | ConVar.Find("mp_autokick")!.SetValue(true); 40 | ConVar.Find("ff_damage_reduction_bullets")!.SetValue(0.1F); 41 | foreach (var value in playerTimersDict.Values) 42 | { 43 | if (value is not null) 44 | value.Kill(); 45 | } 46 | playerTimersDict.Clear(); 47 | plugin.DeregisterEventHandler (EventRoundFreezeEndHandler!); 48 | plugin.DeregisterEventHandler (EventPlayerDisconnectHandler!); 49 | plugin.DeregisterEventHandler (EventPlayerConnectFullHandler!); 50 | plugin.DeregisterEventHandler (EventPlayerHurtHandler!); 51 | ConVar.Find("mp_friendlyfire")!.SetValue(false); 52 | } 53 | 54 | public override void Fun(FunMatchPlugin plugin) 55 | { 56 | if (Enabled) return; 57 | Enabled = true; 58 | 59 | ConVar.Find("mp_autokick")!.SetValue(false); 60 | LastConvar_friendlyfire = ConVar.Find("mp_friendlyfire")!.GetPrimitiveValue(); 61 | ConVar.Find("mp_friendlyfire")!.SetValue(true); 62 | ConVar.Find("ff_damage_reduction_bullets")!.SetValue(0.0f); 63 | plugin.RegisterEventHandler (EventRoundFreezeEndHandler = (@event, info) => 64 | { 65 | 66 | if (Enabled == false) return HookResult.Stop; 67 | var Allplayers = Utilities.GetPlayers(); 68 | foreach (var p in Allplayers) 69 | { 70 | if (p.UserId is null || (int)p.UserId < 0 || !p.PawnIsAlive || p.OriginalControllerOfCurrentPawn is null) continue; 71 | //if (p.IsBot) continue; 72 | var pawn = p.OriginalControllerOfCurrentPawn.Get()!.PlayerPawn.Get(); 73 | playerTimersDict.TryAdd((int)p.UserId,plugin.AddTimer(BurnAfterSecond,() => BurnPlayer(pawn!),TimerFlags.REPEAT)); 74 | } 75 | return HookResult.Stop; 76 | }); 77 | 78 | plugin.RegisterEventHandler (EventPlayerConnectFullHandler = (@event, info) => 79 | { 80 | 81 | if (Enabled == false) return HookResult.Stop; 82 | Timer ?playerTimer; 83 | if (!@event.Userid!.IsValid) return HookResult.Continue; 84 | var oringin = @event.Userid!.OriginalControllerOfCurrentPawn.Get()!; 85 | if (oringin is null) return HookResult.Continue; 86 | CCSPlayerPawn ?pawn = oringin.PlayerPawn.Get(); 87 | if (pawn is null) return HookResult.Continue; 88 | playerTimer = plugin.AddTimer(BurnAfterSecond,() => BurnPlayer(pawn!),TimerFlags.REPEAT); 89 | playerTimersDict.TryAdd((int)@event.Userid.UserId!,playerTimer); 90 | return HookResult.Continue; 91 | }); 92 | 93 | plugin.RegisterEventHandler (EventPlayerDisconnectHandler = (@event, info) => 94 | { 95 | 96 | if (Enabled == false) return HookResult.Stop; 97 | Timer ?playerTimer; 98 | if (!@event.Userid!.IsValid) return HookResult.Continue; 99 | playerTimersDict.TryGetValue((int)@event.Userid!.UserId!,out playerTimer); 100 | if (playerTimer is null) return HookResult.Continue; 101 | playerTimer.Kill(); 102 | playerTimersDict.Remove((int)@event.Userid.UserId); 103 | return HookResult.Continue; 104 | }); 105 | 106 | //EventPlayerAvengedTeammate not working using playerhurtinstead 107 | plugin.RegisterEventHandler (EventPlayerHurtHandler = (@event , info)=> 108 | { 109 | if (@event.Attacker is null && @event.Userid is null) return HookResult.Continue; 110 | if (@event.Attacker == @event.Userid) return HookResult.Continue; 111 | if (@event.Attacker!.Team != @event.Userid!.Team) return HookResult.Continue; 112 | CCSPlayerPawn pawn = @event.Userid.OriginalControllerOfCurrentPawn.Get()!.PlayerPawn.Get()!; 113 | pawn.Health += HealValue; 114 | if (pawn.Health >= 100) pawn.Health = 100; 115 | Utilities.SetStateChanged(pawn, "CBaseEntity", "m_iHealth"); 116 | return HookResult.Continue; 117 | }); 118 | 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /FunHealthRaid.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API; 2 | using CounterStrikeSharp.API.Core; 3 | using CounterStrikeSharp.API.Modules.Entities.Constants; 4 | 5 | namespace FunMatchPlugin; 6 | 7 | public class FunHealthRaid : FunBaseClass 8 | { 9 | public override string Decription => "Health Raid 攻击吸血"; 10 | 11 | public FunHealthRaid(FunMatchPlugin plugin) : base(plugin){} 12 | private BasePlugin.GameEventHandler? EventPlayerHurtHandler; 13 | public int initHP = 100; 14 | public int maxRaid = 100; 15 | public float RaidScale = 0.5F; 16 | 17 | public override void EndFun(FunMatchPlugin plugin) 18 | { 19 | Enabled = false; 20 | var Allplayers = Utilities.GetPlayers(); 21 | plugin.DeregisterEventHandler(EventPlayerHurtHandler!); 22 | foreach (var p in Allplayers) 23 | { 24 | var oringin = p!.OriginalControllerOfCurrentPawn.Get()!; 25 | if (oringin is null) continue; 26 | CCSPlayerPawn ?pawn = oringin.PlayerPawn.Get(); 27 | if (pawn is null) continue; 28 | if (!pawn!.IsValid) continue; 29 | pawn!.MaxHealth = 100; 30 | pawn!.Health = 100; 31 | Utilities.SetStateChanged(pawn, "CBaseEntity", "m_iMaxHealth"); 32 | Utilities.SetStateChanged(pawn, "CBaseEntity", "m_iHealth"); 33 | } 34 | } 35 | 36 | public override void Fun(FunMatchPlugin plugin) 37 | { 38 | if (Enabled) return; 39 | Enabled = true; 40 | var Allplayers = Utilities.GetPlayers(); 41 | foreach (var p in Allplayers) 42 | { 43 | var oringin = p!.OriginalControllerOfCurrentPawn.Get()!; 44 | if (oringin is null) continue; 45 | CCSPlayerPawn ?pawn = oringin.PlayerPawn.Get(); 46 | if (pawn is null) continue; 47 | if (!pawn!.IsValid) continue; 48 | p.GiveNamedItem(CsItem.Kevlar); 49 | p.GiveNamedItem(CsItem.KevlarHelmet); 50 | pawn!.MaxHealth = initHP; 51 | pawn!.Health = initHP; 52 | Utilities.SetStateChanged(pawn, "CBaseEntity", "m_iMaxHealth"); 53 | Utilities.SetStateChanged(pawn, "CBaseEntity", "m_iHealth"); 54 | } 55 | 56 | plugin.RegisterEventHandler (EventPlayerHurtHandler = (@event, info)=> 57 | { 58 | if (Enabled == false) return HookResult.Stop; 59 | if (@event.Userid is null || @event.Attacker is null) return HookResult.Continue; 60 | if (@event.Userid == @event.Attacker) return HookResult.Continue; 61 | if (@event.Userid.Team == @event.Attacker.Team) return HookResult.Continue;; 62 | var attacker = @event.Attacker.OriginalControllerOfCurrentPawn.Get()!.PlayerPawn.Get(); 63 | var damage = @event.DmgHealth * RaidScale; 64 | if (damage > maxRaid) damage = maxRaid; 65 | Server.NextFrame(() => 66 | { 67 | attacker!.MaxHealth += (int)damage; 68 | attacker!.Health += (int)damage; 69 | Utilities.SetStateChanged(attacker, "CBaseEntity", "m_iMaxHealth"); 70 | Utilities.SetStateChanged(attacker, "CBaseEntity", "m_iHealth"); 71 | }); 72 | return HookResult.Continue; 73 | }); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /FunHighHP.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API.Modules.Entities.Constants; 2 | using CounterStrikeSharp.API; 3 | using CounterStrikeSharp.API.Core; 4 | 5 | namespace FunMatchPlugin; 6 | 7 | public class FunHighHP : FunBaseClass 8 | { 9 | public override string Decription => "1000 HP 1000生命值"; 10 | private List Allplayers = new(); 11 | public FunHighHP(FunMatchPlugin plugin) : base(plugin){} 12 | public int maxHP = 1000; 13 | public int armor = 200; 14 | public override void Fun(FunMatchPlugin plugin) 15 | { 16 | if (Enabled) return; 17 | Enabled = true; 18 | Allplayers = Utilities.GetPlayers(); 19 | foreach (var p in Allplayers) 20 | { 21 | var oringin = p!.OriginalControllerOfCurrentPawn.Get()!; 22 | if (oringin is null) continue; 23 | CCSPlayerPawn ?pawn = oringin.PlayerPawn.Get(); 24 | if (pawn is null) continue; 25 | if (!pawn!.IsValid) continue; 26 | p.GiveNamedItem(CsItem.Kevlar); 27 | p.GiveNamedItem(CsItem.KevlarHelmet); 28 | pawn!.MaxHealth = maxHP; 29 | pawn!.Health = maxHP; 30 | pawn!.ArmorValue = armor; 31 | Utilities.SetStateChanged(pawn, "CBaseEntity", "m_iMaxHealth"); 32 | Utilities.SetStateChanged(pawn, "CBaseEntity", "m_iHealth"); 33 | Utilities.SetStateChanged(pawn, "CCSPlayerPawn", "m_ArmorValue"); 34 | } 35 | } 36 | public override void EndFun(FunMatchPlugin plugin) 37 | { 38 | Allplayers = Utilities.GetPlayers(); 39 | foreach (var p in Allplayers) 40 | { 41 | var oringin = p!.OriginalControllerOfCurrentPawn.Get()!; 42 | if (oringin is null) continue; 43 | CCSPlayerPawn ?pawn = oringin.PlayerPawn.Get(); 44 | if (pawn is null) continue; 45 | if (!pawn!.IsValid) continue; 46 | pawn!.MaxHealth = 100; 47 | pawn!.Health = 100; 48 | pawn!.ArmorValue = 100; 49 | Utilities.SetStateChanged(pawn, "CBaseEntity", "m_iMaxHealth"); 50 | Utilities.SetStateChanged(pawn, "CBaseEntity", "m_iHealth"); 51 | Utilities.SetStateChanged(pawn, "CCSPlayerPawn", "m_ArmorValue"); 52 | } 53 | Enabled = false; 54 | Allplayers.Clear(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /FunInfiniteGrenade.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API; 2 | using CounterStrikeSharp.API.Core; 3 | using CounterStrikeSharp.API.Core.Translations; 4 | using CounterStrikeSharp.API.Modules.Cvars; 5 | using CounterStrikeSharp.API.Modules.Entities.Constants; 6 | 7 | namespace FunMatchPlugin; 8 | 9 | public class FunInfiniteGrenade : FunBaseClass 10 | { 11 | public override string Decription => "Infinite Grenade 无限火力"; 12 | 13 | public FunInfiniteGrenade(FunMatchPlugin plugin) : base(plugin){} 14 | 15 | public override void Fun(FunMatchPlugin plugin) 16 | { 17 | if (Enabled) return; 18 | Enabled = true; 19 | //ConVar.Find("mp_weapons_allow_heavyassaultsuit").SetValue(true); 20 | ConVar.Find("sv_cheats")!.SetValue(true); 21 | ConVar.Find("mp_autokick")!.SetValue(false); 22 | ConVar.Find("sv_infinite_ammo")!.SetValue(1); 23 | ConVar.Find("ammo_grenade_limit_total")!.SetValue(10); 24 | ConVar.Find("ammo_grenade_limit_default")!.SetValue(2); 25 | ConVar.Find("mp_weapons_allow_rifles")!.SetValue(0); 26 | ConVar.Find("mp_weapons_allow_pistols")!.SetValue(0); 27 | ConVar.Find("mp_weapons_allow_smgs")!.SetValue(0); 28 | ConVar.Find("mp_weapons_allow_heavy")!.SetValue(0); 29 | ConVar.Find("sv_cheats")!.SetValue(false); 30 | var Allplayers = Utilities.GetPlayers(); 31 | bool BombHasGiven = false; 32 | foreach (var p in Allplayers) 33 | { 34 | if (!p.IsValid) continue; 35 | p.RemoveWeapons(); 36 | p.GiveNamedItem(CsItem.HE); 37 | p.GiveNamedItem(CsItem.Knife); 38 | p.GiveNamedItem(CsItem.Kevlar); 39 | p.GiveNamedItem(CsItem.KevlarHelmet); 40 | if (p.Team == CounterStrikeSharp.API.Modules.Utils.CsTeam.Terrorist && !BombHasGiven) 41 | { 42 | p.GiveNamedItem(CsItem.C4); 43 | BombHasGiven = true; 44 | } 45 | } 46 | } 47 | public override void EndFun(FunMatchPlugin plugin) 48 | { 49 | Enabled = false; 50 | ConVar.Find("sv_cheats")!.SetValue(true); 51 | ConVar.Find("mp_autokick")!.SetValue(true); 52 | ConVar.Find("sv_infinite_ammo")!.SetValue(0); 53 | ConVar.Find("ammo_grenade_limit_total")!.SetValue(5); 54 | ConVar.Find("ammo_grenade_limit_default")!.SetValue(1); 55 | ConVar.Find("mp_weapons_allow_rifles")!.SetValue(-1); 56 | ConVar.Find("mp_weapons_allow_pistols")!.SetValue(-1); 57 | ConVar.Find("mp_weapons_allow_smgs")!.SetValue(-1); 58 | ConVar.Find("mp_weapons_allow_heavy")!.SetValue(-1); 59 | ConVar.Find("sv_cheats")!.SetValue(false); 60 | Server.PrintToChatAll(StringExtensions.ReplaceColorTags("{RED}") + "[FunMatchPlugin] " + "If U Cannot Buy guns,Reconnect 如果手雷结束后买不了枪 请重新连接服务器"); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /FunJumpOrDie.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API.Core; 2 | using CounterStrikeSharp.API; 3 | using CounterStrikeSharp.API.Modules.Timers; 4 | using CounterStrikeSharp.API.Modules.Cvars; 5 | 6 | namespace FunMatchPlugin; 7 | 8 | public class FunJumpOrDie : FunBaseClass 9 | { 10 | public float BurnAfterSecond = 1F; 11 | public override string Decription => "Jump OR Die 地板烫脚"; 12 | public int BurnDamage = 5; 13 | 14 | private class playerTimer 15 | { 16 | public CounterStrikeSharp.API.Modules.Timers.Timer? timer; 17 | 18 | public playerTimer(){} 19 | 20 | public playerTimer(CounterStrikeSharp.API.Modules.Timers.Timer? t) {timer = t;} 21 | } 22 | 23 | private Dictionary playerTimersDict = new (); 24 | private BasePlugin.GameEventHandler? EventPlayerJumpHandler; 25 | private BasePlugin.GameEventHandler? EventRoundFreezeEndHandler; 26 | private BasePlugin.GameEventHandler? EventPlayerDisconnectHandler; 27 | private BasePlugin.GameEventHandler? EventPlayerConnectFullHandler; 28 | public FunJumpOrDie (FunMatchPlugin plugin) : base (plugin){} 29 | public override void Fun(FunMatchPlugin plugin) 30 | { 31 | if (Enabled) return; 32 | Enabled = true; 33 | ConVar.Find("mp_autokick")!.SetValue(false); 34 | plugin.RegisterEventHandler (EventRoundFreezeEndHandler = (@event, info) => 35 | { 36 | 37 | if (Enabled == false) return HookResult.Stop; 38 | var Allplayers = Utilities.GetPlayers(); 39 | foreach (var p in Allplayers) 40 | { 41 | if (p.UserId is null || (int)p.UserId < 0 || !p.PawnIsAlive || p.PlayerPawn is null) continue; 42 | //if (p.IsBot) continue; 43 | CCSPlayerPawn ?pawn = p.OriginalControllerOfCurrentPawn.Get()!.PlayerPawn.Get(); 44 | if (pawn is null) continue; 45 | playerTimer playerTimer = new(); 46 | playerTimer.timer = plugin.AddTimer(BurnAfterSecond,() => BurnPlayer(pawn),TimerFlags.REPEAT); 47 | playerTimersDict.TryAdd((int)p.UserId,playerTimer); 48 | } 49 | return HookResult.Stop; 50 | }); 51 | 52 | plugin.RegisterEventHandler (EventPlayerDisconnectHandler = (@event, info) => 53 | { 54 | 55 | if (Enabled == false) return HookResult.Stop; 56 | playerTimer ?playerTimer = new(); 57 | if (!@event.Userid!.IsValid) return HookResult.Continue; 58 | playerTimersDict.TryGetValue((int)@event.Userid!.UserId!,out playerTimer); 59 | if (playerTimer is null) return HookResult.Continue; 60 | if (playerTimer.timer is not null) playerTimer.timer.Kill(); 61 | playerTimersDict.Remove((int)@event.Userid.UserId); 62 | return HookResult.Continue; 63 | }); 64 | 65 | plugin.RegisterEventHandler (EventPlayerConnectFullHandler = (@event, info) => 66 | { 67 | 68 | if (Enabled == false) return HookResult.Stop; 69 | playerTimer playerTimer = new(); 70 | if (!@event.Userid!.IsValid) return HookResult.Continue; 71 | var oringin = @event.Userid!.OriginalControllerOfCurrentPawn.Get()!; 72 | if (oringin is null) return HookResult.Continue; 73 | CCSPlayerPawn ?pawn = oringin.PlayerPawn.Get(); 74 | if (pawn is null) return HookResult.Continue; 75 | playerTimer.timer = plugin.AddTimer(BurnAfterSecond,() => BurnPlayer(pawn),TimerFlags.REPEAT); 76 | playerTimersDict.TryAdd((int)@event.Userid.UserId!,playerTimer); 77 | return HookResult.Continue; 78 | }); 79 | 80 | plugin.RegisterEventHandler (EventPlayerJumpHandler = (@event, info) => 81 | { 82 | if (Enabled == false) return HookResult.Stop; 83 | if (@event is null) return HookResult.Continue; 84 | if (@event.Userid is null) return HookResult.Continue; 85 | if (@event.Userid.UserId is null) return HookResult.Continue; 86 | var pawn = @event.Userid.OriginalControllerOfCurrentPawn.Get()!.PlayerPawn.Get(); 87 | if (pawn is null) return HookResult.Continue; 88 | playerTimer? playerTimer = new(); 89 | if (playerTimersDict.ContainsKey((int)@event.Userid.UserId)) 90 | { 91 | playerTimersDict.TryGetValue((int)@event.Userid.UserId, out playerTimer); 92 | if (playerTimer!.timer is not null) playerTimer.timer.Kill(); 93 | playerTimer.timer = plugin.AddTimer(BurnAfterSecond,() => BurnPlayer(pawn),TimerFlags.REPEAT); 94 | } 95 | else 96 | { 97 | Console.WriteLine("[Jump Or Die] Unbinding Timers player detected"); 98 | playerTimer.timer = plugin.AddTimer(BurnAfterSecond,() => BurnPlayer(pawn),TimerFlags.REPEAT); 99 | playerTimersDict.TryAdd((int)@event.Userid.UserId,playerTimer); 100 | } 101 | return HookResult.Continue; 102 | }); 103 | } 104 | 105 | public override void EndFun(FunMatchPlugin plugin) 106 | { 107 | ConVar.Find("mp_autokick")!.SetValue(true); 108 | plugin.DeregisterEventHandler (EventPlayerJumpHandler!); 109 | plugin.DeregisterEventHandler (EventRoundFreezeEndHandler!); 110 | plugin.DeregisterEventHandler (EventPlayerDisconnectHandler!); 111 | plugin.DeregisterEventHandler (EventPlayerConnectFullHandler!); 112 | 113 | foreach (var value in playerTimersDict.Values) 114 | { 115 | if (value.timer is not null) 116 | value.timer.Kill(); 117 | } 118 | playerTimersDict.Clear(); 119 | Enabled = false; 120 | } 121 | private void BurnPlayer(CCSPlayerPawn pawn) 122 | { 123 | pawn.Health -= BurnDamage; 124 | pawn.ApplyStressDamage = true; 125 | Utilities.SetStateChanged(pawn, "CBaseEntity", "m_iHealth"); 126 | if (pawn.Health <= 0) 127 | { 128 | pawn.CommitSuicide(true,true); 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /FunMatchPlugin.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API.Core; 2 | using CounterStrikeSharp.API.Core.Attributes.Registration; 3 | using CounterStrikeSharp.API; 4 | using CounterStrikeSharp.API.Modules.Commands; 5 | using CounterStrikeSharp.API.Modules.Admin; 6 | using System.Text.Json; 7 | 8 | namespace FunMatchPlugin; 9 | 10 | public class FunMatchPlugin: BasePlugin , IPluginConfig 11 | { 12 | public override string ModuleName => "Fun Match Plugin"; 13 | public override string ModuleVersion => "1.1.1"; 14 | public FunMatchPluginConfig Config {get;set;} = new(); 15 | public override void Load(bool hotReload) 16 | { 17 | Console.WriteLine("Fun Match Plugin Load!"); 18 | InstallFun(Config); 19 | InstallCustomModes(); 20 | //FunC4EveryWhere funC4EveryWhere = new(this); 21 | //FunLists.Add(funC4EveryWhere); 22 | } 23 | public void OnConfigParsed(FunMatchPluginConfig config) 24 | { 25 | Console.WriteLine("Parsing config"); 26 | Config = config; 27 | } 28 | 29 | private void InstallCustomModes() 30 | { 31 | var configdirectory = Path.Combine(Application.RootDirectory, "configs/plugins/FunMatchPlugin"); 32 | if (!Path.Exists(configdirectory)) Directory.CreateDirectory(configdirectory); 33 | var configpath = Path.Combine(configdirectory,"CustomModes.json"); 34 | if (!File.Exists(configpath)) return; 35 | 36 | var dir_addons = Directory.GetParent(Application.RootDirectory); 37 | var dir_csgo = Directory.GetParent(dir_addons!.FullName); 38 | var path_cfg = Path.Combine(dir_csgo!.FullName,"cfg"); 39 | 40 | using (StreamReader r = new StreamReader(configpath)) 41 | { 42 | string json = r.ReadToEnd(); 43 | CustomModesConfig customModesConfig = JsonSerializer.Deserialize(json)!; 44 | foreach (var mode in customModesConfig.Modes) 45 | { 46 | var fun_cfg_game = Path.Combine(path_cfg,mode.Fun_cfgfilename); 47 | var fun_cfg_config = Path.Combine(configdirectory,mode.Fun_cfgfilename); 48 | var endfun_cfg_game = Path.Combine(path_cfg,mode.Endfun_cfgfilename); 49 | var endfun_cfg_config = Path.Combine(configdirectory,mode.Endfun_cfgfilename); 50 | File.Copy(fun_cfg_config,fun_cfg_game,true); 51 | File.Copy(endfun_cfg_config,endfun_cfg_game,true); 52 | FunLists.Add(new FunCustomConsoleMode(mode.Decr,mode.Fun_cfgfilename,mode.Endfun_cfgfilename)); 53 | } 54 | } 55 | } 56 | 57 | private void InstallFun(FunMatchPluginConfig config) 58 | { 59 | if (config.IsFunBulletTeleportOn) 60 | { 61 | FunBulletTeleport funBulletTeleport = new (this); 62 | FunLists.Add(funBulletTeleport); 63 | } 64 | if (config.IsFunHealTeammatesOn) 65 | { 66 | FunHealTeammates funHealTeammates = new(this) 67 | { 68 | BurnAfterSecond = config.FunHealTeammatesBurnAfterSecond, 69 | BurnDamage = config.FunHealTeammatesBurnDamage, 70 | HealValue = config.FunHealTeammatesHealValue, 71 | }; 72 | FunLists.Add(funHealTeammates); 73 | } 74 | if (config.IsFunHealthRaidOn) 75 | { 76 | FunHealthRaid funHealthRaid = new (this) 77 | { 78 | initHP = config.FunHealthRaidinitHP, 79 | maxRaid = config.FunHealthRaidmaxRaid, 80 | RaidScale = config.FunHealthRaidScale, 81 | }; 82 | FunLists.Add(funHealthRaid); 83 | } 84 | if (config.IsFunHighHPOn) 85 | { 86 | FunHighHP funHighHP = new (this) 87 | { 88 | maxHP = config.FunHighHPmaxHP, 89 | armor = config.FunHighHParmor, 90 | }; 91 | FunLists.Add(funHighHP); 92 | } 93 | if (config.IsFunInfiniteGrenadeOn) 94 | { 95 | FunInfiniteGrenade funFunInfiniteGrenade = new (this); 96 | FunLists.Add(funFunInfiniteGrenade); 97 | } 98 | if (config.IsFunJumpOrDieOn) 99 | { 100 | FunJumpOrDie funJumpOrDie = new(this) 101 | { 102 | BurnAfterSecond = config.FunJumpOrDieBurnAfterSecond, 103 | BurnDamage = config.FunJumpOrDieBurnDamage, 104 | }; 105 | FunLists.Add(funJumpOrDie); 106 | } 107 | if (config.IsFunNoClipOn) 108 | { 109 | FunNoClip funNoClip = new (this){ 110 | interval = config.FunNoClipinterval, 111 | }; 112 | FunLists.Add(funNoClip); 113 | } 114 | if (config.IsFunPlayerShootExChangeOn) 115 | { 116 | FunPlayerShootExChange funPlayerShootExChange = new (this); 117 | FunLists.Add(funPlayerShootExChange); 118 | } 119 | if (config.IsFunToTheMoonOn) 120 | { 121 | FunToTheMoon funToTheMoon = new(this) 122 | { 123 | gravity = config.FunToTheMoongravity, 124 | BulletGiveAbsV = config.FunToTheMoonBulletGiveAbsV, 125 | }; 126 | FunLists.Add(funToTheMoon); 127 | } 128 | if (config.IsFunWNoStopOn) 129 | { 130 | FunWNoStop funWNoStop = new (this) 131 | { 132 | BurnAfterSecond = config.FunWNoStopBurnAfterSecond, 133 | BurnDamage = config.FunWNoStopBurnDamage, 134 | }; 135 | FunLists.Add(funWNoStop); 136 | } 137 | if (config.IsFunDropWeaponOnShootOn) 138 | { 139 | FunDropWeaponOnShoot funDropWeaponOnShoot = new(); 140 | FunLists.Add(funDropWeaponOnShoot); 141 | } 142 | if (config.IsFunChangeWeaponOnShootOn) 143 | { 144 | FunChangeWeaponOnShoot funChangeWeaponOnShoot = new(); 145 | FunLists.Add(funChangeWeaponOnShoot); 146 | } 147 | if (config.IsFunFootBallOn) 148 | { 149 | FunFootBall funFootBall = new(); 150 | FunLists.Add(funFootBall); 151 | RegisterListener((manifest) => 152 | { 153 | manifest.AddResource("models/props/de_dust/hr_dust/dust_soccerball/dust_soccer_ball001.vmdl"); 154 | manifest.AddResource("models/props_fairgrounds/fairgrounds_flagpole01.vmdl"); 155 | }); 156 | } 157 | } 158 | 159 | private Random rd = new Random(); 160 | public void LoadRandomFun() 161 | { 162 | if (CurrentActiceFunIndex >= 0) return; 163 | CurrentActiceFunIndex = rd.Next(0,FunLists.Count); 164 | FunLists[CurrentActiceFunIndex].Fun(this); 165 | if (DisPlayHelp) FunLists[CurrentActiceFunIndex].DisPlayHelp(); 166 | } 167 | 168 | public void UnLoadFun() 169 | { 170 | if (CurrentActiceFunIndex < 0) return; 171 | FunLists[CurrentActiceFunIndex].EndFun(this); 172 | } 173 | 174 | public void LoadFunByIndex(int index) 175 | { 176 | if (index < 0 || index >=FunLists.Count) return; 177 | FunLists[index].Fun(this); 178 | if (DisPlayHelp) FunLists[index].DisPlayHelp(); 179 | } 180 | 181 | public void UnLoadFunByIndex(int index) 182 | { 183 | if (index < 0 || index >=FunLists.Count) return; 184 | FunLists[index].EndFun(this); 185 | } 186 | 187 | 188 | public void LoadFunByName(string name) 189 | { 190 | 191 | } 192 | public bool DisPlayHelp = true; 193 | private int CurrentActiceFunIndex = -1; 194 | private List FunLists = new List(); 195 | private bool EnableRandom = true; 196 | 197 | private GameEventHandler ?ManualLoadHander; 198 | private int ManualLoadIndex = -1; 199 | 200 | [GameEventHandler] 201 | public HookResult OnRoundStart(EventRoundStart @event, GameEventInfo info) 202 | { 203 | if (!EnableRandom) return HookResult.Continue; 204 | UnLoadFun(); 205 | CurrentActiceFunIndex = -1; 206 | Server.NextFrame(()=>{ 207 | LoadRandomFun(); 208 | }); 209 | return HookResult.Continue; 210 | } 211 | 212 | [ConsoleCommand("fun_load", "Load fun by num")] 213 | [CommandHelper(minArgs: 1, usage: "[num]", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)] 214 | [RequiresPermissions("@css/root")] 215 | public void OnLoadFunCommand(CCSPlayerController? player, CommandInfo commandInfo) 216 | { 217 | 218 | int num; 219 | int.TryParse(commandInfo.GetArg(1),out num); 220 | if (num <= 0 || num >FunLists.Count) 221 | { 222 | commandInfo.ReplyToCommand($"Invalid num. pls input num from {1} - {FunLists.Count}"); 223 | return; 224 | } 225 | if (ManualLoadHander is not null) 226 | { 227 | commandInfo.ReplyToCommand($"Alraedy loaded {ManualLoadIndex + 1} Manually, Pls !fun_load first"); 228 | return; 229 | } 230 | ManualLoadIndex = num - 1; 231 | LoadFunByIndex(ManualLoadIndex); 232 | RegisterEventHandler (ManualLoadHander = (@event, info) => 233 | { 234 | UnLoadFunByIndex(ManualLoadIndex); 235 | Server.NextFrame(()=>{ 236 | LoadFunByIndex(ManualLoadIndex); 237 | }); 238 | return HookResult.Continue; 239 | }); 240 | } 241 | 242 | [ConsoleCommand("!fun_load", "UnLoad fun Manually")] 243 | [CommandHelper(minArgs: 0, usage: "", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)] 244 | [RequiresPermissions("@css/root")] 245 | public void OnUnLoadFunCommand(CCSPlayerController? player, CommandInfo commandInfo) 246 | { 247 | UnLoadFunByIndex(ManualLoadIndex); 248 | DeregisterEventHandler(ManualLoadHander!); 249 | ManualLoadHander = null; 250 | commandInfo.ReplyToCommand($"Unloaded {ManualLoadIndex + 1}"); 251 | } 252 | 253 | [ConsoleCommand("fun_lists", "Lists Avaliable Fun")] 254 | [CommandHelper(minArgs: 0, usage: "", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)] 255 | public void OnListFunCommand(CCSPlayerController? player, CommandInfo commandInfo) 256 | { 257 | for (int i = 0;i < FunLists.Count; i++) 258 | { 259 | commandInfo.ReplyToCommand($"{i + 1} {FunLists[i].Decription}"); 260 | } 261 | } 262 | 263 | [ConsoleCommand("fun_displayhelp", "DisPlay Help Fun")] 264 | [CommandHelper(minArgs: 0, usage: "", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)] 265 | [RequiresPermissions("@css/root")] 266 | public void OnDisPlayHelpCommand(CCSPlayerController? player, CommandInfo commandInfo) 267 | { 268 | DisPlayHelp = true; 269 | } 270 | 271 | [ConsoleCommand("!fun_displayhelp", "Don't DisPlay Help Fun")] 272 | [CommandHelper(minArgs: 0, usage: "", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)] 273 | [RequiresPermissions("@css/root")] 274 | public void OnDontDisPlayHelpCommand(CCSPlayerController? player, CommandInfo commandInfo) 275 | { 276 | DisPlayHelp = false; 277 | } 278 | 279 | [ConsoleCommand("!fun_random", "Don't random Fun everyround")] 280 | [CommandHelper(minArgs: 0, usage: "", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)] 281 | [RequiresPermissions("@css/root")] 282 | public void OnDontRandomCommand(CCSPlayerController? player, CommandInfo commandInfo) 283 | { 284 | EnableRandom = false; 285 | UnLoadFun(); 286 | } 287 | 288 | [ConsoleCommand("fun_random", "random Fun everyround")] 289 | [CommandHelper(minArgs: 0, usage: "", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)] 290 | [RequiresPermissions("@css/root")] 291 | public void OnRandomCommand(CCSPlayerController? player, CommandInfo commandInfo) 292 | { 293 | EnableRandom = true; 294 | } 295 | } 296 | -------------------------------------------------------------------------------- /FunMatchPlugin.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /FunMatchPlugin.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.5.002.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunMatchPlugin", "FunMatchPlugin.csproj", "{CEEC8521-78DA-42E5-93E4-0C19066DBDAF}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {CEEC8521-78DA-42E5-93E4-0C19066DBDAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {CEEC8521-78DA-42E5-93E4-0C19066DBDAF}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {CEEC8521-78DA-42E5-93E4-0C19066DBDAF}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {CEEC8521-78DA-42E5-93E4-0C19066DBDAF}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {B53A33E3-BD4C-4436-984B-64CF31C581AB} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /FunMatchPluginConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | using CounterStrikeSharp.API.Core; 3 | using CounterStrikeSharp.API.Core.Attributes; 4 | 5 | namespace FunMatchPlugin; 6 | public class FunMatchPluginConfig : BasePluginConfig 7 | { 8 | [JsonPropertyName("BulletTeleport")] public bool IsFunBulletTeleportOn { get; set; } = true; 9 | [JsonPropertyName("ChangeWeaponOnShoot")] public bool IsFunChangeWeaponOnShootOn { get; set; } = true; 10 | [JsonPropertyName("FunDropWeaponOnShoot")] public bool IsFunDropWeaponOnShootOn { get; set; } = true; 11 | [JsonPropertyName("FunHealTeammates")] public bool IsFunHealTeammatesOn { get; set; } = true; 12 | [JsonPropertyName("FunHealTeammatesBurnAfterSecond")] public float FunHealTeammatesBurnAfterSecond { get; set; } = 1.0f; 13 | [JsonPropertyName("FunHealTeammatesBurnDamage")] public int FunHealTeammatesBurnDamage { get; set; } = 5; 14 | [JsonPropertyName("FunHealTeammatesHealValue")] public int FunHealTeammatesHealValue { get; set; } = 10; 15 | [JsonPropertyName("FunHealthRaid")] public bool IsFunHealthRaidOn { get; set; } = true; 16 | [JsonPropertyName("FunHealthRaidinitHP")] public int FunHealthRaidinitHP { get; set; } = 100; 17 | [JsonPropertyName("FunHealthRaidmaxRaid")] public int FunHealthRaidmaxRaid { get; set; } = 100; 18 | [JsonPropertyName("FunHealthRaidScale")] public float FunHealthRaidScale { get; set; } = 0.5f; 19 | [JsonPropertyName("FunHighHP")] public bool IsFunHighHPOn { get; set; } = true; 20 | [JsonPropertyName("FunHighHPmaxHP")] public int FunHighHPmaxHP { get; set; } = 1000; 21 | [JsonPropertyName("FunHighHParmor")] public int FunHighHParmor { get; set; } = 200; 22 | [JsonPropertyName("FunInfiniteGrenade")] public bool IsFunInfiniteGrenadeOn { get; set; } = true; 23 | [JsonPropertyName("FunJumpOrDie")] public bool IsFunJumpOrDieOn { get; set; } = true; 24 | [JsonPropertyName("FunJumpOrDieBurnAfterSecond")] public float FunJumpOrDieBurnAfterSecond { get; set; } = 1.0f; 25 | [JsonPropertyName("FunJumpOrDieBurnDamage")] public int FunJumpOrDieBurnDamage { get; set; } = 5; 26 | [JsonPropertyName("FunNoClip")] public bool IsFunNoClipOn { get; set; } = true; 27 | [JsonPropertyName("FunNoClipinterval")] public float FunNoClipinterval { get; set; } = 2.0f; 28 | [JsonPropertyName("FunPlayerShootExChange")] public bool IsFunPlayerShootExChangeOn { get; set; } = true; 29 | [JsonPropertyName("FunToTheMoon")] public bool IsFunToTheMoonOn { get; set; } = true; 30 | [JsonPropertyName("FunToTheMoongravity")] public float FunToTheMoongravity { get; set; } = (float)(800 * 0.166); 31 | [JsonPropertyName("FunToTheMoonBulletGiveAbsV")] public float FunToTheMoonBulletGiveAbsV { get; set; } = 100; 32 | [JsonPropertyName("FunWNoStop")] public bool IsFunWNoStopOn { get; set; } = true; 33 | [JsonPropertyName("FunWNoStopBurnAfterSecond")] public float FunWNoStopBurnAfterSecond { get; set; } = 0.5f; 34 | [JsonPropertyName("FunWNoStopBurnDamage")] public int FunWNoStopBurnDamage { get; set; } = 2; 35 | [JsonPropertyName("FunFootBall")] public bool IsFunFootBallOn { get; set; } = true; 36 | } -------------------------------------------------------------------------------- /FunNoClip.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API.Modules.Cvars; 2 | using CounterStrikeSharp.API; 3 | using CounterStrikeSharp.API.Core; 4 | 5 | namespace FunMatchPlugin; 6 | 7 | using CounterStrikeSharp.API.Modules.Timers; 8 | public class FunNoClip : FunBaseClass 9 | { 10 | public override string Decription => "NoClip ON 启用飞行"; 11 | private List Allplayers = new(); 12 | public FunNoClip(FunMatchPlugin plugin) : base(plugin){} 13 | private Timer ?NoclipOnTimer = null; 14 | private bool IsNoClipON = false; 15 | public float interval = 2.0f; 16 | 17 | public override void Fun(FunMatchPlugin plugin) 18 | { 19 | if (Enabled) return; 20 | Enabled = true; 21 | IsNoClipON = false; 22 | NoclipOnTimer = plugin.AddTimer(interval,SetNoclip,TimerFlags.REPEAT); 23 | } 24 | public override void EndFun(FunMatchPlugin plugin) 25 | { 26 | Allplayers = Utilities.GetPlayers(); 27 | foreach (var p in Allplayers) 28 | { 29 | if (p.IsValid) 30 | { 31 | p.ExecuteClientCommandFromServer("noclip 0"); 32 | } 33 | } 34 | Enabled = false; 35 | IsNoClipON = false; 36 | ConVar.Find("sv_cheats")!.SetValue(false); 37 | Allplayers.Clear(); 38 | if (NoclipOnTimer is not null) NoclipOnTimer.Kill(); 39 | } 40 | 41 | private void SetNoclip() 42 | { 43 | if (IsNoClipON is false) 44 | { 45 | ConVar.Find("sv_cheats")!.SetValue(true); 46 | Allplayers = Utilities.GetPlayers(); 47 | foreach (var p in Allplayers) 48 | { 49 | if (!p.IsValid) continue; 50 | if (p.IsBot) continue; 51 | if (p.OriginalControllerOfCurrentPawn.Get()!.PlayerPawn.Get()!.IsDefusing || p.OriginalControllerOfCurrentPawn.Get()!.PlayerPawn.Get()!.InBombZone) 52 | { 53 | continue; 54 | } 55 | p.ExecuteClientCommandFromServer("noclip 1"); 56 | } 57 | IsNoClipON = true; 58 | ConVar.Find("sv_cheats")!.SetValue(false); 59 | } 60 | else 61 | { 62 | ConVar.Find("sv_cheats")!.SetValue(true); 63 | Allplayers = Utilities.GetPlayers(); 64 | foreach (var p in Allplayers) 65 | { 66 | if (!p.IsValid) continue; 67 | if (p.IsBot) continue; 68 | p.ExecuteClientCommandFromServer("noclip 0"); 69 | } 70 | IsNoClipON = false; 71 | ConVar.Find("sv_cheats")!.SetValue(false); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /FunPlayerShootExChange.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API.Core; 2 | using CounterStrikeSharp.API.Modules.Utils; 3 | using CounterStrikeSharp.API; 4 | 5 | namespace FunMatchPlugin; 6 | 7 | public class FunPlayerShootExChange : FunBaseClass 8 | { 9 | public override string Decription => "Bullet ExChange 击中交换位置"; 10 | public FunPlayerShootExChange (FunMatchPlugin plugin): base(plugin){} 11 | private BasePlugin.GameEventHandler? EventPlayerHurtHandler; 12 | public override void Fun(FunMatchPlugin plugin) 13 | { 14 | if (Enabled) return; 15 | Enabled = true; 16 | plugin.RegisterEventHandler (EventPlayerHurtHandler = (@event, info) => 17 | { 18 | if (Enabled == false) return HookResult.Stop; 19 | //Console.WriteLine("Player Shoot ExChange Event"); 20 | //To Avoid VScode Warning "might be null" 21 | if (@event is null) return HookResult.Continue; 22 | if (@event.Attacker is null) return HookResult.Continue; 23 | if (@event.Userid is null) return HookResult.Continue; 24 | 25 | if (@event.Userid == @event.Attacker) return HookResult.Continue; 26 | var attacker = @event.Attacker.OriginalControllerOfCurrentPawn.Get()!.PlayerPawn.Get(); 27 | var victim = @event.Userid.OriginalControllerOfCurrentPawn.Get()!.PlayerPawn.Get(); 28 | Vector PositionAttacker = new Vector(attacker!.AbsOrigin!.X,attacker.AbsOrigin.Y,attacker.AbsOrigin.Z); 29 | Vector PositionVictim = new Vector(victim!.AbsOrigin!.X,victim.AbsOrigin.Y,victim.AbsOrigin.Z); 30 | Server.NextFrame(() => 31 | { 32 | victim.Teleport(PositionAttacker); 33 | attacker.Teleport(PositionVictim); 34 | }); 35 | 36 | return HookResult.Continue; 37 | }); 38 | } 39 | public override void RegisterCommand(FunMatchPlugin plugin) 40 | { 41 | 42 | } 43 | public override void EndFun(FunMatchPlugin plugin) 44 | { 45 | plugin.DeregisterEventHandler (EventPlayerHurtHandler!); 46 | Enabled = false; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /FunToTheMoon.cs: -------------------------------------------------------------------------------- 1 | using CounterStrikeSharp.API.Modules.Cvars; 2 | using CounterStrikeSharp.API.Modules.Utils; 3 | using CounterStrikeSharp.API.Core; 4 | using CounterStrikeSharp.API; 5 | 6 | namespace FunMatchPlugin; 7 | 8 | public class FunToTheMoon : FunBaseClass 9 | { 10 | public override string Decription => "To The Moon 月球低重力"; 11 | public FunToTheMoon(FunMatchPlugin plugin) : base(plugin){} 12 | public float gravity = (float)(800 * 0.166); 13 | public float BulletGiveAbsV = 100; 14 | private BasePlugin.GameEventHandler? EventBulletImpactHandler; 15 | private BasePlugin.GameEventHandler? EventPlayerHurtHandler; 16 | public override void Fun(FunMatchPlugin plugin) 17 | { 18 | if (Enabled) return; 19 | Enabled = true; 20 | ConVar.Find("sv_cheats")!.SetValue(true); 21 | ConVar.Find("sv_gravity")!.SetValue(gravity); 22 | ConVar.Find("sv_cheats")!.SetValue(false); 23 | plugin.RegisterEventHandler (EventBulletImpactHandler = (@event, info) => 24 | { 25 | if (Enabled == false) return HookResult.Stop; 26 | if (@event.Userid is null) return HookResult.Continue; 27 | var pawn = @event.Userid.OriginalControllerOfCurrentPawn.Get()!.PlayerPawn.Get(); 28 | Vector bulletPosition = new Vector(@event.X,@event.Y,@event.Z); 29 | Vector playerPosition = pawn!.AbsOrigin!; 30 | double V2 = Math.Pow(playerPosition.X-bulletPosition.X,2) + Math.Pow(playerPosition.Y-bulletPosition.Y,2) + Math.Pow(playerPosition.Z-bulletPosition.Z,2); 31 | float Scale = (float)(BulletGiveAbsV /Math.Sqrt(V2)); 32 | pawn.AbsVelocity.X += (playerPosition.X-bulletPosition.X)*Scale; 33 | pawn.AbsVelocity.Y += (playerPosition.Y-bulletPosition.Y)*Scale; 34 | pawn.AbsVelocity.Z += (playerPosition.Z-bulletPosition.Z)*Scale; 35 | return HookResult.Continue; 36 | }); 37 | 38 | // if molotov hurt the player, will add V from Acctacker not from damage source... to be rewrite 39 | plugin.RegisterEventHandler (EventPlayerHurtHandler = (@event, info) => 40 | { 41 | 42 | if (Enabled == false) return HookResult.Stop; 43 | if (@event.Attacker is null) return HookResult.Continue; 44 | if (@event.Userid is null) return HookResult.Continue; 45 | 46 | if (@event.Userid == @event.Attacker) return HookResult.Continue; 47 | 48 | var attacker = @event.Attacker.OriginalControllerOfCurrentPawn.Get()!.PlayerPawn.Get(); 49 | var victim = @event.Userid.OriginalControllerOfCurrentPawn.Get()!.PlayerPawn.Get(); 50 | Vector PositionAttacker = new Vector(attacker!.AbsOrigin!.X,attacker.AbsOrigin.Y,attacker.AbsOrigin.Z); 51 | Vector PositionVictim = new Vector(victim!.AbsOrigin!.X,victim.AbsOrigin.Y,victim.AbsOrigin.Z); 52 | 53 | double V2 = Math.Pow(PositionAttacker.X-PositionVictim.X,2) + Math.Pow(PositionAttacker.Y-PositionVictim.Y,2) + Math.Pow(PositionAttacker.Z-PositionVictim.Z,2); 54 | float Scale = (float)(BulletGiveAbsV /Math.Sqrt(V2)); 55 | victim.AbsVelocity.X += (PositionVictim.X-PositionAttacker.X)*Scale; 56 | victim.AbsVelocity.Y += (PositionVictim.Y-PositionAttacker.Y)*Scale; 57 | victim.AbsVelocity.Z += (PositionVictim.Z-PositionAttacker.Z)*Scale; 58 | 59 | return HookResult.Continue; 60 | }); 61 | } 62 | public override void EndFun(FunMatchPlugin plugin) 63 | { 64 | Enabled = false; 65 | plugin.DeregisterEventHandler (EventBulletImpactHandler!); 66 | plugin.DeregisterEventHandler (EventPlayerHurtHandler!); 67 | ConVar.Find("sv_cheats")!.SetValue(true); 68 | ConVar.Find("sv_gravity")!.SetValue((float)800); 69 | ConVar.Find("sv_cheats")!.SetValue(false); 70 | } 71 | } 72 | 73 | -------------------------------------------------------------------------------- /FunWNoStop.cs: -------------------------------------------------------------------------------- 1 | namespace FunMatchPlugin; 2 | 3 | using CounterStrikeSharp.API.Core; 4 | using CounterStrikeSharp.API; 5 | using CounterStrikeSharp.API.Modules.Timers; 6 | using CounterStrikeSharp.API.Modules.Cvars; 7 | using CounterStrikeSharp.API.Modules.Utils; 8 | 9 | public class FunWNoStop: FunBaseClass 10 | { 11 | public float BurnAfterSecond = 0.5F; 12 | public override string Decription => "W No Stop 按住W不松手"; 13 | public int BurnDamage = 2; 14 | private BasePlugin.GameEventHandler? EventRoundFreezeEndHandler; 15 | private BasePlugin.GameEventHandler? EventPlayerDisconnectHandler; 16 | private BasePlugin.GameEventHandler? EventPlayerConnectFullHandler; 17 | private Dictionary playerTimersDict = new (); 18 | public FunWNoStop(FunMatchPlugin plugin) : base(plugin) 19 | { 20 | } 21 | 22 | private void BurnPlayer(CCSPlayerPawn pawn) 23 | { 24 | pawn.Health -= BurnDamage; 25 | pawn.ApplyStressDamage = true; 26 | Utilities.SetStateChanged(pawn, "CBaseEntity", "m_iHealth"); 27 | if (pawn.Health <= 0) 28 | { 29 | pawn.CommitSuicide(true,true); 30 | } 31 | } 32 | public override void Fun(FunMatchPlugin plugin) 33 | { 34 | if (Enabled) return; 35 | Enabled = true; 36 | 37 | ConVar.Find("mp_autokick")!.SetValue(false); 38 | plugin.RegisterEventHandler (EventRoundFreezeEndHandler = (@event, info) => 39 | { 40 | 41 | if (Enabled == false) return HookResult.Stop; 42 | var Allplayers = Utilities.GetPlayers(); 43 | foreach (var p in Allplayers) 44 | { 45 | if (p.UserId is null || (int)p.UserId < 0 || !p.PawnIsAlive || p.PlayerPawn is null) continue; 46 | //if (p.IsBot) continue; 47 | int playerid = (int)p.UserId; 48 | playerTimersDict.TryAdd((int)p.UserId,plugin.AddTimer(BurnAfterSecond,() => CheckPlayerForward(playerid),TimerFlags.REPEAT)); 49 | } 50 | return HookResult.Stop; 51 | }); 52 | 53 | plugin.RegisterEventHandler (EventPlayerDisconnectHandler = (@event, info) => 54 | { 55 | 56 | if (Enabled == false) return HookResult.Stop; 57 | Timer ?playerTimer; 58 | playerTimersDict.TryGetValue((int)@event.Userid!.UserId!,out playerTimer); 59 | if (playerTimer is null) return HookResult.Continue; 60 | playerTimer.Kill(); 61 | playerTimersDict.Remove((int)@event.Userid.UserId); 62 | return HookResult.Continue; 63 | }); 64 | 65 | plugin.RegisterEventHandler (EventPlayerConnectFullHandler = (@event, info) => 66 | { 67 | 68 | if (Enabled == false) return HookResult.Stop; 69 | Timer ?playerTimer; 70 | var oringin = @event.Userid!.OriginalControllerOfCurrentPawn.Get()!; 71 | if (oringin is null) return HookResult.Continue; 72 | CCSPlayerPawn ?pawn = oringin.PlayerPawn.Get(); 73 | if (pawn is null) return HookResult.Continue; 74 | if (@event.Userid.UserId is null) {Console.WriteLine("null userid"); return HookResult.Continue;} 75 | int playerid = (int)@event.Userid.UserId; 76 | playerTimer = plugin.AddTimer(BurnAfterSecond,() => CheckPlayerForward(playerid),TimerFlags.REPEAT); 77 | playerTimersDict.TryAdd((int)@event.Userid.UserId!,playerTimer); 78 | return HookResult.Continue; 79 | }); 80 | 81 | } 82 | 83 | public void CheckPlayerForward(int id) 84 | { 85 | CCSPlayerController? player = Utilities.GetPlayerFromUserid(id); 86 | if (player is null || (int)player.UserId! < 0 || !player.PawnIsAlive || player.PlayerPawn is null) 87 | { 88 | return; 89 | } 90 | if (!player.Buttons.HasFlag(PlayerButtons.Forward) || player.Buttons.HasFlag(PlayerButtons.Back) || player.Buttons.HasFlag(PlayerButtons.Duck) || player.Buttons.HasFlag(PlayerButtons.Walk)) 91 | { 92 | CCSPlayerPawn ? pawn = player.OriginalControllerOfCurrentPawn.Get()!.PlayerPawn.Get(); 93 | BurnPlayer(pawn!); 94 | } 95 | } 96 | 97 | public override void EndFun(FunMatchPlugin plugin) 98 | { 99 | Enabled = false; 100 | ConVar.Find("mp_autokick")!.SetValue(true); 101 | foreach (var value in playerTimersDict.Values) 102 | { 103 | if (value is not null) 104 | value.Kill(); 105 | } 106 | playerTimersDict.Clear(); 107 | plugin.DeregisterEventHandler (EventRoundFreezeEndHandler!); 108 | plugin.DeregisterEventHandler (EventPlayerDisconnectHandler!); 109 | plugin.DeregisterEventHandler (EventPlayerConnectFullHandler!); 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # **CS2FunMatchPlugin CS2类表演赛娱乐插件** 2 | a showmatch like plugin for fun 3 | 4 | ## Features 5 | 6 | ### random fun mode every round 每回合随机一种娱乐模式 7 | 8 | ### enable or disable modes in config 可配置各个模式是否启用 配置模式参数 9 | 10 | ### custom console-only(.cfg) modes loading 可自定义仅控制台命令的模式 11 | 12 | ## Avaliable Fun/Mode 当前可使用的娱乐模式 13 | 14 | ### Bullet Teleport 瞬移子弹 15 | ### HealTeammates 攻击治疗队友 16 | get hurt continually, your teammates can heal you. 17 | 持续受到伤害 只有队友能帮你活下去 18 | ### Health Raid 攻击吸血 19 | ### 1000 Hp 1000血量 20 | ### Infinite Grenades 无限手雷 21 | ### Jump Or Die 地板烫脚 22 | if you don't jump, you will get hurt. 23 | 不跳就会收到伤害 24 | ### NoClip On 启用飞行穿墙 25 | will noclip on for a while. 26 | 每隔一段时间切换一次状态 包点无法起飞 27 | ### Shoot Exchange 换位子弹 28 | ### To The Moon 月球模式 29 | low gravity, counterforce enabled (like that in space). 30 | 低重力 射击会有一定反作用力 31 | ### WNoStop 按住W不松手 32 | if you don't forward, you will get hurt. 33 | 不按住w则会收到伤害 34 | ### Change Weapon ONShoot 射击换枪 35 | ### Drop Weapon ONShoot 射击丢枪 36 | ### FootBall Mode 足球模式 37 | Ts aim to take soccer ball to CTspawn, while CTs will stop them. T需要将足球踢进CT出生点 38 | 39 | ## How to Install 如何安装 40 | 41 | ### 1.Install metamod & CounterstrikeSharp 安装metamod以及CounterstrikeSharp 42 | see [https://docs.cssharp.dev/docs/guides/getting-started.html](https://docs.cssharp.dev/docs/guides/getting-started.html) 43 | ### 2.Put dll to plugins folder 将插件放于指定目录 44 | ...\Counter-Strike Global Offensive\game\csgo\addons\counterstrikesharp\plugins\FunMatchPlugin\FunMatchPlugin.dll 45 | 46 | ## Plugin Console Commands 插件控制台相关指令 47 | `fun_lists` Show all avaliable Fun/Mode 显示所有当前支持的娱乐模式 48 | 49 | `fun_displayhelp` will display help of every mode on round start 每回合开始播报模式帮助信息 @css/root required 50 | 51 | `!fun_displayhelp` will NOT display help of every mode 停止播报模式帮助信息 @css/root required 52 | 53 | `fun_random` will load random mode per round automaticly 启用每回合随机模式 @css/root required 54 | 55 | `!fun_random` will not load any random mode per round automaticly 停用每回合随机模式 @css/root required 56 | 57 | `fun_load [num]` load certain mode by num (num can be found in command "fun_lists") won't affect random load 手动加载模式 对应的数字可以在"funlists"指令查到 与随机模式独立 @css/root required 58 | 59 | `!fun_load` Unload mode you manually load (num can be found in command "fun_lists") 卸载手动加载的模式 @css/root required 60 | 61 | ## Config 插件配置 62 | 63 | if you would like to configurate something, pls put config here 修改模式默认配置 请将配置文件放在此文件夹 64 | ...\Counter-Strike Global Offensive\game\csgo\addons\counterstrikesharp\configs\plugins\FunMatchPlugin 65 | 66 | `FunMatchPlugin.json` will configure enable or disable modes and how modes work. 该文件会配置是否启用特定模式,特定模式的参数 67 | 68 | `CustomModes.json` will add new custom console-only mode to this plugin. 该文件会配置仅控制台自定义新模式并加入游戏中 69 | you will need .cfg files to add custom console-only mode. 该模式基于.cfg文件运行,请将你需要的指令放在指定的.cfg文件中 70 | 71 | see [https://github.com/TitaniumLithium/CS2FunMatchPlugin/tree/main/config-example](config-example) 72 | -------------------------------------------------------------------------------- /config-example/CustomModes.json: -------------------------------------------------------------------------------- 1 | { 2 | "Modes" : 3 | [ 4 | { 5 | "Decr" : "headshot only 爆头模式", 6 | "Fun_cfgfilename" : "start.cfg", 7 | "Endfun_cfgfilename" : "end.cfg" 8 | }, 9 | { 10 | "Decr" : "your custom mode decription", 11 | "Fun_cfgfilename" : "cfg file to excute on round start", 12 | "Endfun_cfgfilename" : "cfg file to excute on next round start to end mode" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /config-example/FunMatchPlugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "BulletTeleport" :true, 3 | "ChangeWeaponOnShoot" :true, 4 | "FunDropWeaponOnShoot" :true, 5 | "FunHealTeammates" :true, 6 | "FunHealTeammatesBurnAfterSecond" :1.0, 7 | "FunHealTeammatesBurnDamage" :5, 8 | "FunHealTeammatesHealValue" :10, 9 | "FunHealthRaid" :true, 10 | "FunHealthRaidinitHP" :100, 11 | "FunHealthRaidmaxRaid" :100, 12 | "FunHealthRaidScale" :0.5, 13 | "FunHighHP" :true, 14 | "FunHighHPmaxHP" :1000, 15 | "FunHighHParmor" :100, 16 | "FunInfiniteGrenade" :true, 17 | "FunJumpOrDie" :true, 18 | "FunJumpOrDieBurnAfterSecond" :1.0, 19 | "FunJumpOrDieBurnDamage" :5, 20 | "FunNoClip" :true, 21 | "FunNoClipinterval" :2.0, 22 | "FunPlayerShootExChange" :true, 23 | "FunToTheMoon" :true, 24 | "FunToTheMoongravity":132.8, 25 | "FunToTheMoonBulletGiveAbsV" :100, 26 | "FunWNoStop" :true, 27 | "FunWNoStopBurnAfterSecond" :0.5, 28 | "FunWNoStopBurnDamage" : 2, 29 | "FunFootBall" : true 30 | } -------------------------------------------------------------------------------- /config-example/end.cfg: -------------------------------------------------------------------------------- 1 | sv_cheats 1 2 | mp_damage_headshot_only 0 3 | sv_cheats 0 -------------------------------------------------------------------------------- /config-example/start.cfg: -------------------------------------------------------------------------------- 1 | sv_cheats 1 2 | mp_damage_headshot_only 1 3 | sv_cheats 0 --------------------------------------------------------------------------------