[Release] Restrict building near defined areas


New Member
I released this on the Epoch forums a while back and figured I would post it here too!

So you currently have a rule that states you can not build within a certain distance of Military barracks etc..... Although making it a rule is easy, making it impossible is almost easier. No deleting bases or having to constantly be on the look out.

You will need:

Notepad++ (or a software of your choice)


player_build.sqf (can be found in your snap build folder)


Step one:

Open up your init.sqf and add this to the very bottom:

ServerIllegalRadius = 500;

ServerNoBuildList = [ "Land_Mil_ControlTower",
"HeliHEmpty" ];
Step two:

At the top of player_build.sqf add these to the end of the Private line:

Step three:

Find this line in player_build.sqf:

if(!canbuild) then { _cancel = true; _reason = "Cannot build in a city."; };
Under it add:

(Updated code thanks to Gr8)
_posrad = [player] call FNC_GetPos;
_cntrad = count (nearestObjects [_posrad, ServerNoBuildList, ServerIllegalRadius]);
if (_cntrad > 0) then {
_cancel = true;
_reason = format["- Building is restricted %1m near Trader Cities and Millitary Loot Areas", ServerIllegalRadius];
Hope it helps :)