From a6e6a4efdaa88ed9bc352da6bdb4fa358fd776f9 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Thu, 18 Jul 2024 09:40:14 +0500 Subject: [PATCH] Remove admin guns from Beatrun_RandomMWLoadouts --- beatrun/gamemodes/beatrun/gamemode/sh/DataTheft.lua | 3 +++ beatrun/gamemodes/beatrun/gamemode/sh/Deathmatch.lua | 7 +++++-- beatrun/gamemodes/beatrun/gamemode/shared.lua | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/DataTheft.lua b/beatrun/gamemodes/beatrun/gamemode/sh/DataTheft.lua index 8c6fe08..717bb0f 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/DataTheft.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/DataTheft.lua @@ -3,6 +3,9 @@ if SERVER then util.AddNetworkString("DataTheft_Sync") function Beatrun_StartDataTheft() + if GetGlobalBool("GM_DATATHEFT") then return end + if Course_Name ~= "" then return end + SetGlobalBool("GM_DATATHEFT", true) net.Start("DataTheft_Start") diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Deathmatch.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Deathmatch.lua index 038a127..a2a9401 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Deathmatch.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Deathmatch.lua @@ -9,7 +9,7 @@ if SERVER then local wepIndex = math.random(#allWep) local wep = allWep[wepIndex] - if wep.Base == "mg_base" then + if wep.Base == "mg_base" and not wep.AdminOnly then return wep else return getRandomMGBaseWeapon() @@ -17,6 +17,9 @@ if SERVER then end function Beatrun_StartDeathmatch() + if GetGlobalBool("GM_DEATHMATCH") then return end + if Course_Name ~= "" then return end + SetGlobalBool("GM_DEATHMATCH", true) net.Start("Deathmatch_Start") @@ -78,7 +81,7 @@ if SERVER then if GetGlobalBool("GM_DEATHMATCH") then local plyKills = ply:GetNW2Int("DeathmatchKills", 0) - if ply == attacker and plyKills ~= 0 then + if ply == attacker and plyKills > 0 then ply:SetNW2Int("DeathmatchKills", plyKills - 1) elseif IsValid(attacker) and attacker ~= ply then local kills = attacker:GetNW2Int("DeathmatchKills", 0) diff --git a/beatrun/gamemodes/beatrun/gamemode/shared.lua b/beatrun/gamemodes/beatrun/gamemode/shared.lua index b9ef7fd..8468ec5 100644 --- a/beatrun/gamemodes/beatrun/gamemode/shared.lua +++ b/beatrun/gamemodes/beatrun/gamemode/shared.lua @@ -1,4 +1,4 @@ -VERSIONGLOBAL = "v1.0.4" +VERSIONGLOBAL = "v1.0.5" DeriveGamemode("sandbox")