From 1c8a8e9211e40897beb37f89df4d44c6f1a666ab Mon Sep 17 00:00:00 2001 From: StrawWagen <64710817+StrawWagen@users.noreply.github.com> Date: Fri, 2 Jan 2026 18:35:58 -0700 Subject: [PATCH 1/4] Disable admin buttons --- .../maps/gm_vacant_industry_revamped.lua | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 lua/map_scripts/maps/gm_vacant_industry_revamped.lua diff --git a/lua/map_scripts/maps/gm_vacant_industry_revamped.lua b/lua/map_scripts/maps/gm_vacant_industry_revamped.lua new file mode 100644 index 0000000..7d64627 --- /dev/null +++ b/lua/map_scripts/maps/gm_vacant_industry_revamped.lua @@ -0,0 +1,22 @@ +local entIds = { + 2725, -- color correction + 2716, -- high quality snowfall + 2729, -- toggle skybox + 2696, -- disable smog + 2698, -- fps mode + 2701, -- disable snow + 2889, -- sandbox mode button!!! + 2902, -- shake + 2718, -- fast +} + +hook.Add( "CFC_MapScripts_PostMapEntsSpawn", "CFC_MapScripts_vacant_removeadminbuttons", function() + local removedEnts = 0 + for _, entId in ipairs( entIds ) do + local ent = ents.GetMapCreatedEntity( entId ) + if not IsValid( ent ) then continue end + removedEnts = removedEnts + 1 + SafeRemoveEntity( ent ) + end + print( "Removed entities: " .. removedEnts .. "/" .. #entIds ) +end ) From 960e4b7cb3bd3f8549f87700682472c7c12dc9f7 Mon Sep 17 00:00:00 2001 From: StrawWagen <64710817+StrawWagen@users.noreply.github.com> Date: Fri, 2 Jan 2026 18:36:10 -0700 Subject: [PATCH 2/4] No print pls --- lua/map_scripts/maps/gm_vacant_industry_revamped.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/map_scripts/maps/gm_vacant_industry_revamped.lua b/lua/map_scripts/maps/gm_vacant_industry_revamped.lua index 7d64627..ca1b539 100644 --- a/lua/map_scripts/maps/gm_vacant_industry_revamped.lua +++ b/lua/map_scripts/maps/gm_vacant_industry_revamped.lua @@ -18,5 +18,4 @@ hook.Add( "CFC_MapScripts_PostMapEntsSpawn", "CFC_MapScripts_vacant_removeadminb removedEnts = removedEnts + 1 SafeRemoveEntity( ent ) end - print( "Removed entities: " .. removedEnts .. "/" .. #entIds ) end ) From 6a42aca8299698ebb76f9e2241914f6a50fb6352 Mon Sep 17 00:00:00 2001 From: StrawWagen <64710817+StrawWagen@users.noreply.github.com> Date: Fri, 2 Jan 2026 18:52:48 -0700 Subject: [PATCH 3/4] Error if removing unexpected ents --- lua/map_scripts/maps/gm_vacant_industry_revamped.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lua/map_scripts/maps/gm_vacant_industry_revamped.lua b/lua/map_scripts/maps/gm_vacant_industry_revamped.lua index ca1b539..692f1aa 100644 --- a/lua/map_scripts/maps/gm_vacant_industry_revamped.lua +++ b/lua/map_scripts/maps/gm_vacant_industry_revamped.lua @@ -10,11 +10,20 @@ local entIds = { 2718, -- fast } +local buttonClass = "func_button" + hook.Add( "CFC_MapScripts_PostMapEntsSpawn", "CFC_MapScripts_vacant_removeadminbuttons", function() local removedEnts = 0 for _, entId in ipairs( entIds ) do local ent = ents.GetMapCreatedEntity( entId ) - if not IsValid( ent ) then continue end + if not IsValid( ent ) then + ErrorNoHaltWithStack("Admin button removal: Couldn't find " .. entId) + continue + end + if ent:GetClass() ~= buttonClass then + ErrorNoHaltWithStack("Admin button removal: Entity " .. entId .. " is not a button!") + continue + end removedEnts = removedEnts + 1 SafeRemoveEntity( ent ) end From 6e7e9c12765c128994ffd32547e05ae5f5617c9b Mon Sep 17 00:00:00 2001 From: StrawWagen <64710817+StrawWagen@users.noreply.github.com> Date: Fri, 2 Jan 2026 18:53:44 -0700 Subject: [PATCH 4/4] Fix style --- lua/map_scripts/maps/gm_vacant_industry_revamped.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/map_scripts/maps/gm_vacant_industry_revamped.lua b/lua/map_scripts/maps/gm_vacant_industry_revamped.lua index 692f1aa..6f6aced 100644 --- a/lua/map_scripts/maps/gm_vacant_industry_revamped.lua +++ b/lua/map_scripts/maps/gm_vacant_industry_revamped.lua @@ -17,11 +17,11 @@ hook.Add( "CFC_MapScripts_PostMapEntsSpawn", "CFC_MapScripts_vacant_removeadminb for _, entId in ipairs( entIds ) do local ent = ents.GetMapCreatedEntity( entId ) if not IsValid( ent ) then - ErrorNoHaltWithStack("Admin button removal: Couldn't find " .. entId) + ErrorNoHaltWithStack( "Admin button removal: Couldn't find map ent " .. entId ) continue end if ent:GetClass() ~= buttonClass then - ErrorNoHaltWithStack("Admin button removal: Entity " .. entId .. " is not a button!") + ErrorNoHaltWithStack( "Admin button removal: Map entity " .. entId .. " is not a button!" ) continue end removedEnts = removedEnts + 1