Skip to content

Commit 2bf1878

Browse files
authored
Merge pull request #10 from CFC-Servers/vacant_industry
Disable Vacant Industry admin buttons
2 parents d9ce38f + 6e7e9c1 commit 2bf1878

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
local entIds = {
2+
2725, -- color correction
3+
2716, -- high quality snowfall
4+
2729, -- toggle skybox
5+
2696, -- disable smog
6+
2698, -- fps mode
7+
2701, -- disable snow
8+
2889, -- sandbox mode button!!!
9+
2902, -- shake
10+
2718, -- fast
11+
}
12+
13+
local buttonClass = "func_button"
14+
15+
hook.Add( "CFC_MapScripts_PostMapEntsSpawn", "CFC_MapScripts_vacant_removeadminbuttons", function()
16+
local removedEnts = 0
17+
for _, entId in ipairs( entIds ) do
18+
local ent = ents.GetMapCreatedEntity( entId )
19+
if not IsValid( ent ) then
20+
ErrorNoHaltWithStack( "Admin button removal: Couldn't find map ent " .. entId )
21+
continue
22+
end
23+
if ent:GetClass() ~= buttonClass then
24+
ErrorNoHaltWithStack( "Admin button removal: Map entity " .. entId .. " is not a button!" )
25+
continue
26+
end
27+
removedEnts = removedEnts + 1
28+
SafeRemoveEntity( ent )
29+
end
30+
end )

0 commit comments

Comments
 (0)