From ccf2a6eb23623c387ef22b8b305169a57505dc40 Mon Sep 17 00:00:00 2001 From: StrawWagen <64710817+StrawWagen@users.noreply.github.com> Date: Sun, 15 Feb 2026 00:57:38 -0700 Subject: [PATCH 1/4] Update gm_darkfusion.lua --- lua/map_scripts/maps/gm_darkfusion.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lua/map_scripts/maps/gm_darkfusion.lua b/lua/map_scripts/maps/gm_darkfusion.lua index 650504d..4ad7c45 100644 --- a/lua/map_scripts/maps/gm_darkfusion.lua +++ b/lua/map_scripts/maps/gm_darkfusion.lua @@ -27,4 +27,22 @@ local entIDs = { hook.Add( "CFC_MapScripts_PostMapEntsSpawn", "CFC_MapScripts_darkfusion_removeadminbuttons", function() MapScripts.Utils.RemoveButtonsByID( entIDs ) +end ) + + +-- only allow pvpers to mess with the map for maximum LARP +if not CFCPvp then return end + +local tooFarDistanceSqr = 200^2 + +hook.Add( "PlayerUse", "CFC_MapScripts_darkfusion_BlockBuilderUseOnMapButtons", function( ply, ent ) + if ent:MapCreationID() <= -1 then return end + if not string.find( ent:GetClass(), "button" ) then return end -- not a button? who cares! + + if ply:IsInBuild() then return false end -- pvpers only! + + local plysPos = ply:GetPos() + if plysPos:DistToSqr( ent:GetPos() ) > tooFarDistanceSqr then return false end -- too far away, probably a wire user, etc + + -- all good, let them use the button end ) \ No newline at end of file From 2e23bb7a47046d1756a7df15487a9daf0e4e70e3 Mon Sep 17 00:00:00 2001 From: StrawWagen <64710817+StrawWagen@users.noreply.github.com> Date: Sun, 15 Feb 2026 01:07:25 -0700 Subject: [PATCH 2/4] Update lua/map_scripts/maps/gm_darkfusion.lua Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- lua/map_scripts/maps/gm_darkfusion.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/map_scripts/maps/gm_darkfusion.lua b/lua/map_scripts/maps/gm_darkfusion.lua index 4ad7c45..5fae7fa 100644 --- a/lua/map_scripts/maps/gm_darkfusion.lua +++ b/lua/map_scripts/maps/gm_darkfusion.lua @@ -36,7 +36,7 @@ if not CFCPvp then return end local tooFarDistanceSqr = 200^2 hook.Add( "PlayerUse", "CFC_MapScripts_darkfusion_BlockBuilderUseOnMapButtons", function( ply, ent ) - if ent:MapCreationID() <= -1 then return end + if ent:MapCreationID() == -1 then return end if not string.find( ent:GetClass(), "button" ) then return end -- not a button? who cares! if ply:IsInBuild() then return false end -- pvpers only! From 411ac9b37e4e69a8620809df80056f761a8449a4 Mon Sep 17 00:00:00 2001 From: StrawWagen <64710817+StrawWagen@users.noreply.github.com> Date: Sun, 15 Feb 2026 01:07:33 -0700 Subject: [PATCH 3/4] Update lua/map_scripts/maps/gm_darkfusion.lua Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- lua/map_scripts/maps/gm_darkfusion.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/map_scripts/maps/gm_darkfusion.lua b/lua/map_scripts/maps/gm_darkfusion.lua index 5fae7fa..6874d11 100644 --- a/lua/map_scripts/maps/gm_darkfusion.lua +++ b/lua/map_scripts/maps/gm_darkfusion.lua @@ -41,8 +41,8 @@ hook.Add( "PlayerUse", "CFC_MapScripts_darkfusion_BlockBuilderUseOnMapButtons", if ply:IsInBuild() then return false end -- pvpers only! - local plysPos = ply:GetPos() - if plysPos:DistToSqr( ent:GetPos() ) > tooFarDistanceSqr then return false end -- too far away, probably a wire user, etc + local plyPos = ply:GetPos() + if plyPos:DistToSqr( ent:GetPos() ) > tooFarDistanceSqr then return false end -- too far away, probably a wire user, etc -- all good, let them use the button end ) \ No newline at end of file From 023a5f107e084e869f2a79d7d44e3df02c99d630 Mon Sep 17 00:00:00 2001 From: StrawWagen <64710817+StrawWagen@users.noreply.github.com> Date: Sun, 15 Feb 2026 01:16:08 -0700 Subject: [PATCH 4/4] print! --- lua/map_scripts/maps/gm_darkfusion.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/map_scripts/maps/gm_darkfusion.lua b/lua/map_scripts/maps/gm_darkfusion.lua index 6874d11..5739530 100644 --- a/lua/map_scripts/maps/gm_darkfusion.lua +++ b/lua/map_scripts/maps/gm_darkfusion.lua @@ -39,7 +39,7 @@ hook.Add( "PlayerUse", "CFC_MapScripts_darkfusion_BlockBuilderUseOnMapButtons", if ent:MapCreationID() == -1 then return end if not string.find( ent:GetClass(), "button" ) then return end -- not a button? who cares! - if ply:IsInBuild() then return false end -- pvpers only! + if ply:IsInBuild() then ply:ChatPrint( "You must be in PVP to press darkfusion map buttons!" ) return false end -- pvpers only! local plyPos = ply:GetPos() if plyPos:DistToSqr( ent:GetPos() ) > tooFarDistanceSqr then return false end -- too far away, probably a wire user, etc