From 51438c7ee9b7c031adc8f1a0743bba0b3813abba Mon Sep 17 00:00:00 2001 From: Ryan Amos Date: Sun, 22 May 2022 20:45:47 +0100 Subject: [PATCH 1/4] Fix !hide provide "mitigation" to noclip ghost bug --- GameFiles/_integration.gsc | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/GameFiles/_integration.gsc b/GameFiles/_integration.gsc index b6f2237f..d3f775e3 100644 --- a/GameFiles/_integration.gsc +++ b/GameFiles/_integration.gsc @@ -772,7 +772,9 @@ NoClipImpl() if ( !IsAlive( self ) ) { self IPrintLnBold( "You are not alive" ); - return; + // Due to bug when sometimes disabling noclip game thinks you're dead + // removing the return and allowing them to go back into noclip is probably better. + //return; } self SetClientDvar( "sv_cheats", 1 ); @@ -782,18 +784,20 @@ NoClipImpl() self call [[level.overrideMethods["god"]]]( true ); self call [[level.overrideMethods["noclip"]]]( true ); self Hide(); + + self.isNoClipped = true; self IPrintLnBold( "NoClip enabled" ); } NoClipOffImpl() -{ - if ( !IsAlive( self ) ) +{ + if ( !IsDefined( self.isNoClipped ) || !self.isNoClipped ) { - self IPrintLnBold( "You are not alive" ); + self IPrintLnBold( "You are not no-clipped" ); return; } - + self SetClientDvar( "sv_cheats", 1 ); self SetClientDvar( "cg_thirdperson", 0 ); self SetClientDvar( "sv_cheats", 0 ); @@ -803,6 +807,16 @@ NoClipOffImpl() self Show(); self IPrintLnBold( "NoClip disabled" ); + + if ( !IsAlive( self ) && self.isNoClipped ) + { + // Sometimes you will bug exiting noclip where the game thinks you're dead + // but you're not. You will retain godmode but be able to run around and kill people. + // So, it's important to let the user know. + self IPrintLnBold( "^1You are bugged! ^4Swap team." ); + } + + self.isNoClipped = false; } HideImpl() @@ -817,7 +831,7 @@ HideImpl() self SetClientDvar( "cg_thirdperson", 1 ); self SetClientDvar( "sv_cheats", 0 ); - if ( !IsDefined( self.savedHealth ) || self.health < 1000 ) + if ( !IsDefined( self.savedHealth ) || self.health < 1000 ) { self.savedHealth = self.health; self.savedMaxHealth = self.maxhealth; @@ -825,6 +839,8 @@ HideImpl() self call [[level.overrideMethods["god"]]]( true ); self Hide(); + + self.isHidden = true; self IPrintLnBold( "You are now ^5hidden ^7from other players" ); } @@ -849,6 +865,8 @@ UnhideImpl() self call [[level.overrideMethods["god"]]]( false ); self Show(); + + self.isHidden = false; self IPrintLnBold( "You are now ^5visible ^7to other players" ); } From 36899e781afa32a65c17dacd29fe44661dfd46e4 Mon Sep 17 00:00:00 2001 From: Amos Date: Wed, 1 Jun 2022 21:03:26 +0100 Subject: [PATCH 2/4] Broadcast bans (Anti-cheat and manuals) script plugin --- IW4MAdmin.sln | 1 + Plugins/ScriptPlugins/BanBroadcasting.js | 48 ++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 Plugins/ScriptPlugins/BanBroadcasting.js diff --git a/IW4MAdmin.sln b/IW4MAdmin.sln index b59f4a03..42c29352 100644 --- a/IW4MAdmin.sln +++ b/IW4MAdmin.sln @@ -52,6 +52,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ScriptPlugins", "ScriptPlug Plugins\ScriptPlugins\ParserPlutoniumT4COZM.js = Plugins\ScriptPlugins\ParserPlutoniumT4COZM.js Plugins\ScriptPlugins\GameInterface.js = Plugins\ScriptPlugins\GameInterface.js Plugins\ScriptPlugins\SubnetBan.js = Plugins\ScriptPlugins\SubnetBan.js + Plugins\ScriptPlugins\BanBroadcasting.js = Plugins\ScriptPlugins\BanBroadcasting.js EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutomessageFeed", "Plugins\AutomessageFeed\AutomessageFeed.csproj", "{F5815359-CFC7-44B4-9A3B-C04BACAD5836}" diff --git a/Plugins/ScriptPlugins/BanBroadcasting.js b/Plugins/ScriptPlugins/BanBroadcasting.js new file mode 100644 index 00000000..8f82e76c --- /dev/null +++ b/Plugins/ScriptPlugins/BanBroadcasting.js @@ -0,0 +1,48 @@ +const broadcastMessage = (server, message) => { + server.Manager.GetServers().forEach(s => { + s.Broadcast(message); + }); +}; + +const plugin = { + author: 'Amos', + version: 1.0, + name: 'Broadcast Bans', + + onEventAsync: function (gameEvent, server) { + if (!this.enableBroadcastBans) { + return; + } + + if (gameEvent.TypeName === 'Ban') { + let penalty = undefined; + gameEvent.Origin.AdministeredPenalties?.forEach(p => { + penalty = p.AutomatedOffense; + }) + + if (gameEvent.Origin.ClientId === 1 && penalty !== undefined) { + let localization = _localization.LocalizationIndex['PLUGINS_BROADCAST_BAN_ACMESSAGE'].replace('{{targetClient}}', gameEvent.Target.CleanedName); + broadcastMessage(server, localization); + } else { + let localization = _localization.LocalizationIndex['PLUGINS_BROADCAST_BAN_MESSAGE'].replace('{{targetClient}}', gameEvent.Target.CleanedName); + broadcastMessage(server, localization); + } + } + }, + + onLoadAsync: function (manager) { + this.configHandler = _configHandler; + this.enableBroadcastBans = this.configHandler.GetValue('EnableBroadcastBans'); + + if (this.enableBroadcastBans === undefined) { + this.enableBroadcastBans = false; + this.configHandler.SetValue('EnableBroadcastBans', this.enableBroadcastBans); + } + }, + + onUnloadAsync: function () { + }, + + onTickAsync: function (server) { + } +}; From 5245c483ca7e509839aeba178900facca9cde9a0 Mon Sep 17 00:00:00 2001 From: Amos Date: Wed, 1 Jun 2022 22:48:56 +0100 Subject: [PATCH 3/4] Fixed formatting... Tabs/spaces --- GameFiles/_integration.gsc | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/GameFiles/_integration.gsc b/GameFiles/_integration.gsc index d3f775e3..80e32395 100644 --- a/GameFiles/_integration.gsc +++ b/GameFiles/_integration.gsc @@ -269,10 +269,10 @@ InitializeGameMethods() { level.overrideMethods["noclip"] = ::NoClip; } - + if ( level.eventBus.gamename == "IW5" ) - { //PlutoIW5 only allows Godmode and NoClip if cheats are on.. - level.overrideMethods["god"] = ::IW5_God; + { //PlutoIW5 only allows Godmode and NoClip if cheats are on.. + level.overrideMethods["god"] = ::IW5_God; level.overrideMethods["noclip"] = ::IW5_NoClip; } } @@ -772,9 +772,9 @@ NoClipImpl() if ( !IsAlive( self ) ) { self IPrintLnBold( "You are not alive" ); - // Due to bug when sometimes disabling noclip game thinks you're dead - // removing the return and allowing them to go back into noclip is probably better. - //return; + // Due to bug when sometimes disabling noclip game thinks you're dead + // removing the return and allowing them to go back into noclip is probably better. + //return; } self SetClientDvar( "sv_cheats", 1 ); @@ -784,20 +784,20 @@ NoClipImpl() self call [[level.overrideMethods["god"]]]( true ); self call [[level.overrideMethods["noclip"]]]( true ); self Hide(); - - self.isNoClipped = true; + + self.isNoClipped = true; self IPrintLnBold( "NoClip enabled" ); } NoClipOffImpl() -{ +{ if ( !IsDefined( self.isNoClipped ) || !self.isNoClipped ) { self IPrintLnBold( "You are not no-clipped" ); return; } - + self SetClientDvar( "sv_cheats", 1 ); self SetClientDvar( "cg_thirdperson", 0 ); self SetClientDvar( "sv_cheats", 0 ); @@ -807,12 +807,12 @@ NoClipOffImpl() self Show(); self IPrintLnBold( "NoClip disabled" ); - - if ( !IsAlive( self ) && self.isNoClipped ) + + if ( !IsAlive( self ) && self.isNoClipped ) { - // Sometimes you will bug exiting noclip where the game thinks you're dead - // but you're not. You will retain godmode but be able to run around and kill people. - // So, it's important to let the user know. + // Sometimes you will bug exiting noclip where the game thinks you're dead + // but you're not. You will retain godmode but be able to run around and kill people. + // So, it's important to let the user know. self IPrintLnBold( "^1You are bugged! ^4Swap team." ); } @@ -839,7 +839,7 @@ HideImpl() self call [[level.overrideMethods["god"]]]( true ); self Hide(); - + self.isHidden = true; self IPrintLnBold( "You are now ^5hidden ^7from other players" ); @@ -865,8 +865,8 @@ UnhideImpl() self call [[level.overrideMethods["god"]]]( false ); self Show(); - - self.isHidden = false; + + self.isHidden = false; self IPrintLnBold( "You are now ^5visible ^7to other players" ); } From a456a12bc086eb55936e9c5a1d5da2954cd54502 Mon Sep 17 00:00:00 2001 From: Skull Merlin <86374920+skkuull@users.noreply.github.com> Date: Thu, 2 Jun 2022 17:25:29 +0300 Subject: [PATCH 4/4] Create ParserH1MOD.js (#248) Co-Authored-By: fed <58637860+fedddddd@users.noreply.github.com> Co-authored-by: fed <58637860+fedddddd@users.noreply.github.com> --- Plugins/ScriptPlugins/ParserH1MOD.js | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Plugins/ScriptPlugins/ParserH1MOD.js diff --git a/Plugins/ScriptPlugins/ParserH1MOD.js b/Plugins/ScriptPlugins/ParserH1MOD.js new file mode 100644 index 00000000..3ba0de8b --- /dev/null +++ b/Plugins/ScriptPlugins/ParserH1MOD.js @@ -0,0 +1,42 @@ +var rconParser; +var eventParser; + +var plugin = { + author: 'fed', + version: 0.1, + name: 'H1-Mod Parser', + isParser: true, + + onEventAsync: function(gameEvent, server) {}, + + onLoadAsync: function(manager) { + rconParser = manager.GenerateDynamicRConParser(this.name); + eventParser = manager.GenerateDynamicEventParser(this.name); + + rconParser.Configuration.CommandPrefixes.Kick = 'kickClient {0} "{1}"'; + rconParser.Configuration.CommandPrefixes.Ban = 'kickClient {0} "{1}"'; + rconParser.Configuration.CommandPrefixes.TempBan = 'kickClient {0} "{1}"'; + rconParser.Configuration.CommandPrefixes.Tell = 'tellraw {0} "{1}"'; + rconParser.Configuration.CommandPrefixes.Say = 'sayraw "{0}"'; + rconParser.Configuration.CommandPrefixes.RConResponse = '\xff\xff\xff\xffprint'; + rconParser.Configuration.Dvar.Pattern = '^ *\\"(.+)\\" is: \\"(.+)?\\" default: \\"(.+)?\\"'; + rconParser.Configuration.Status.Pattern = '^ *([0-9]+) +-?([0-9]+) +(Yes|No) +((?:[A-Z]+|[0-9]+)) +((?:[a-z]|[0-9]){8,32}|(?:[a-z]|[0-9]){8,32}|bot[0-9]+|(?:[0-9]+)) *(.{0,32}) +(\\d+\\.\\d+\\.\\d+.\\d+\\:-*\\d{1,5}|0+.0+:-*\\d{1,5}|loopback|unknown|bot) +(-*[0-9]+) *$'; + rconParser.Configuration.StatusHeader.Pattern = 'num +score +bot +ping +guid +name +address +qport *'; + rconParser.Configuration.Status.AddMapping(102, 4); + rconParser.Configuration.Status.AddMapping(103, 5); + rconParser.Configuration.Status.AddMapping(104, 6); + rconParser.Configuration.WaitForResponse = false; + rconParser.Configuration.DefaultRConPort = 27016; + + eventParser.Configuration.GameDirectory = ''; + + rconParser.Version = 'H1 MP 1.15 build 1251288 Tue Jul 23 13:38:30 2019 win64'; + rconParser.GameName = 11; // H1 + eventParser.Version = 'H1 MP 1.15 build 1251288 Tue Jul 23 13:38:30 2019 win64'; + eventParser.GameName = 11; // H1 + }, + + onUnloadAsync: function() {}, + + onTickAsync: function(server) {} +};