Jump to content
  • 0

Building prohibition


Line2.lv

Question

Hi guys!

I know how to make script that does not allow to build in certain areas, but how to make following:

 

I want to disable building near (500 m radius) certain building objects all around the map.

Such building objects like Land_A_BuildingWIP, Land_A_Hospital, Land_A_Office01 and other good looting places.

 

Can somebody please give me a script example.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Hi guys!

I know how to make script that does not allow to build in certain areas, but how to make following:

 

I want to disable building near (500 m radius) certain building objects all around the map.

Such building objects like Land_A_BuildingWIP, Land_A_Hospital, Land_A_Office01 and other good looting places.

 

Can somebody please give me a script example.

this may help

 

I like the idea so I am working on it now

something like this

 

Idea example credit to 

 

_playerpos = getPosATL player;
_nearObject = count nearestObjects [_playerpos, ["Land_A_BuildingWIP", "Land_A_Hospital", "Land_A_Office01"], 500] > 0;

if (_nearObject) then { canBuild false; } else { canBuild true; }

or something like this maybe

 

_playerPos = getPosATL player;
_nobuild = count nearestObjects [_playerPos, [""Land_A_BuildingWIP", "Land_A_Hospital", "Land_A_Office01""], 500] > 0;

if (_nobuild) then {
canbuild = true;
else
canBuild =true;
Link to comment
Share on other sites

  • 0

Calamitys first example should work. 

 

We use this:

 

Go in player_build.sqf and add:

//Forbidden Buildings
	_isNear = count (nearestObjects [player, ["Land_A_BuildingWIP", "Land_A_Hospital", "Land_A_Office01"], 500]);
	if(_isNear > 0) then { _cancel = true; _reason = "It is forbidden to build in/near this Building."; };

below:

// No building in trader zones
if(!canbuild) then { _cancel = true; _reason = "Cannot build in a city."; };
Link to comment
Share on other sites

  • 0

 

Calamitys first example should work. 

 

We use this:

 

Go in player_build.sqf and add:

//Forbidden Buildings
	_isNear = count (nearestObjects [player, ["Land_A_BuildingWIP", "Land_A_Hospital", "Land_A_Office01"], 500]);
	if(_isNear > 0) then { _cancel = true; _reason = "It is forbidden to build in/near this Building."; };

below:

// No building in trader zones
if(!canbuild) then { _cancel = true; _reason = "Cannot build in a city."; };

 

What is the distance from the buildings that is prohibited?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...