configize isBuildAllowed

This commit is contained in:
vbawol 2016-07-14 16:36:24 -05:00
parent dd54f07534
commit 1688486cd1
2 changed files with 14 additions and 8 deletions

View File

@ -165,10 +165,9 @@ if !(_buildingAllowed)exitWith{ false };
if (getNumber(_config >> "buildingNearbyMilitary") == 0) then{
_range = getNumber(_config >> "buildingNearbyMilitaryRange");
if (_range > 0) then {
_restricted = nearestObjects [player, ["ProtectionZone_Invisible_F","Cargo_Tower_base_F","Cargo_HQ_base_F","Cargo_Patrol_base_F","Cargo_House_base_F"], 300];
} else {
_restricted = nearestObjects [player, ["Cargo_Tower_base_F","Cargo_HQ_base_F","Cargo_Patrol_base_F","Cargo_House_base_F"], _range];
_restricted append (nearestObjects [player, ["ProtectionZone_Invisible_F","Cargo_Tower_base_F","Cargo_HQ_base_F","Cargo_Patrol_base_F","Cargo_House_base_F"], 300]);
_restrictedArray = ["ProtectionZone_Invisible_F"];
_restrictedArray append getArray(_config >> "buildingNearbyMilitaryClasses");
_restricted = nearestObjects [player, _restrictedArray, _range];
};
} else {
_restricted = nearestObjects [player, ["ProtectionZone_Invisible_F"], 300];
@ -178,10 +177,14 @@ if !(_restricted isEqualTo []) then {
["Building Disallowed: Area Blocked", 5] call Epoch_message;
};
_restrictedLocations = nearestLocations [player, ["NameCityCapital"], 300];
if !(_restrictedLocations isEqualTo []) then {
_buildingAllowed = false;
["Building Disallowed: Area Blocked", 5] call Epoch_message;
_restrictedLocationsArray = getArray(_config >> "restrictedLocations");
_restrictedLocationsRange = getNumber(_config >> "restrictedLocationsRange");
if !(_restrictedLocationsArray isEqualTo []) then {
_restrictedLocations = nearestLocations [player, _restrictedLocationsArray, _restrictedLocationsRange];
if !(_restrictedLocations isEqualTo []) then {
_buildingAllowed = false;
["Building Disallowed: Area Blocked", 5] call Epoch_message;
};
};
_myPosATL = getPosATL player;

View File

@ -18,6 +18,9 @@ class CfgEpochClient
droneRngChance = 100; // increase number to reduce chances and reduce to increase. Default 100 = // 2% chance (+ 4% chance if in city) (1% - 2% Half if using silencer) to spawn drone if shot fired
buildingNearbyMilitary = 0; //1 to allow building nearby
buildingNearbyMilitaryRange = 300; //Define radius of blocked area
buildingNearbyMilitaryClasses[] = {"Cargo_Tower_base_F","Cargo_HQ_base_F","Cargo_Patrol_base_F","Cargo_House_base_F"};
restrictedLocations[] = {"NameCityCapital"};
restrictedLocationsRange = 300;
buildingRequireJammer = 0; // 1 = to allow building without a jammer
buildingCountLimit = 200; // how many objects can be built within range of a jammer
buildingJammerRange = 75; // jammer range in meters