5niper

Disable Building in certain areas / problem

13 posts in this topic

Posted (edited)

I'm using this: https://github.com/Dwarfer/ExileModTweaks/blob/master/mpmissions/fixes/ExileClient_object_item_construct.sqf

to disable building on Suhrenfeld Island on Napf; which is reserved for a static DMS mission (the whole island).
So I added the coords, and set the radius to 3000M. It works great. However, since then, I can't add any items to my base which is in Muttenz;
Muttenz falls no where near those coords; but I still get the "Building Permit Denied" message.

Could it be, that the other coords given in that code, do not apply to Napf? Are they for some other map maybe, and some how fall into the
same area as my base (by chance)?

*NOTE: not sure if this is the right place for this post. What can I post here, and what is not allowed?
I posted in this question (similarly) in another area of addons, but no one has replied. Maybe no one knows the answer. So I thought I'd ask here.
 

Thanks

Edited by 5niper

Share this post


Link to post
Share on other sites

Posted (edited)

@5niper

Did you remove the _cantBuildNear objects? or are there any near your base?

Edited by xzerokoolx
1 person likes this

Share this post


Link to post
Share on other sites
Advertisement

It's not an immediate resolution, but this is going to be added in the next exile update.

  • Added: Non-buildable zones, so you can prevent players from building somewhere. Can be defined in CfgExileEnvironment / mission config.
1 person likes this

Share this post


Link to post
Share on other sites
48 minutes ago, xzerokoolx said:

@5niper

Did you remove the _cantBuildNear objects? or are there any near your base?

Ah! Didn't think about that. Will look. :D

Share this post


Link to post
Share on other sites

I removed all of the can't build near objects, AND locations, except for the location I want to prevent building near (Suhrenfeld, Napf).

Spoiler

/**
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_itemClassName","_cantBuildNear"];
_itemClassName = _this select 0;
if( isClass(configFile >> "CfgMagazines" >> _itemClassName >> "Interactions" >> "Constructing") ) then
{
    if (findDisplay 602 != displayNull) then
    {
        (findDisplay 602) closeDisplay 2;
    };
    try
    {
        if !((vehicle player) isEqualTo player) then { throw "ConstructionVehicleWarning"; };
        if ((getPosATL player) call ExileClient_util_world_isTraderZoneNearby) then { throw "ConstructionTraderZoneWarning"; };
        if ((getPosATL player) call ExileClient_util_world_isSpawnZoneNearby) then { throw "ConstructionSpawnZoneWarning"; };

        //Stops Building In Towns
        _cnt = count nearestLocations [getPosATL player, ["NameVillage","NameCity","NameCityCapital"], 400];
        if (_cnt > 0 ) then { throw "ConstructionAbortedInformation"; };        
        
        /* PREVENT BUILDING NEAR CERTAIN TYPES OF BUILDING */
        _cantBuildNear = [
            /*"Land_Dome_Big_F",
            "Land_Dome_Small_F",
            "Land_Barracks_ruins_F",
            "Land_i_Barracks_V1_F",
            "Land_i_Barracks_V1_dam_F",
            "Land_i_Barracks_V2_F",
            "Land_i_Barracks_V2_dam_F",
            "Land_u_Barracks_V2_F",
            "Land_Hospital_main_F",
            "Land_Hospital_side1_F",
            "Land_Hospital_side2_F",
            "Land_MilOffices_V1_F",
            "Land_TentHangar_V1_F",
            "Land_Hangar_F",
            "Land_Airport_Tower_F",
            "Land_Cargo_House_V1_F",
            "Land_Cargo_House_V3_F",
            "Land_Cargo_HQ_V1_F",
            "Land_Cargo_HQ_V2_F",
            "Land_Cargo_HQ_V3_F",
            "Land_Cargo_Patrol_V1_F",
            "Land_Cargo_Patrol_V2_F",
            "Land_Cargo_Tower_V1_F",
            "Land_Cargo_Tower_V1_No1_F",
            "Land_Cargo_Tower_V1_No2_F",
            "Land_Cargo_Tower_V1_No3_F",
            "Land_Cargo_Tower_V1_No4_F",
            "Land_Cargo_Tower_V1_No5_F",
            "Land_Cargo_Tower_V1_No6_F",
            "Land_Cargo_Tower_V1_No7_F",
            "Land_Cargo_Tower_V2_F",
            "Land_Cargo_Tower_V3_F",
            "Land_Radar_F"*/
        ];
        _cantBuildDist = 100;
        if ({typeOf _x in _cantBuildNear} count nearestObjects[player, _cantBuildNear, _cantBuildDist] > 0) then { throw "ConstructionAbortedInformation"; };
        
        /* PREVENT BUILDING NEAR KEY MILITARY AND INDUSTRIAL LOCATIONS */
//        if ((player distance [23802.7, 16133.9, 0]) < 1500) then { throw "ConstructionAbortedInformation"; };
        //if ((player distance [3073.84,13177.1,0]) < 250) then { throw "ConstructionAbortedInformation"; };
        //if ((player distance [12813.08, 16672.213, 0]) < 500) then { throw "ConstructionAbortedInformation"; };
        //if ((player distance [20941.604, 19236.865, 0]) < 150) then { throw "ConstructionAbortedInformation"; };
        //if ((player distance [6178.40, 16245.77, 0]) < 250) then { throw "ConstructionAbortedInformation"; };
        //if ((player distance [14347.18, 18940.27, 0]) < 200) then { throw "ConstructionAbortedInformation"; };
        //if ((player distance [18310.604, 15548.075, 0]) < 150) then { throw "ConstructionAbortedInformation"; };
        //if ((player distance [16083.555, 16992.264, 0]) < 200) then { throw "ConstructionAbortedInformation"; };
        //if ((player distance [17432.287, 13148.771, 0]) < 150) then { throw "ConstructionAbortedInformation"; };
        //if ((player distance [23581.842, 21099.982, 0]) < 200) then { throw "ConstructionAbortedInformation"; };
        if ((player distance [16612,18300.8,0.00130081]) < 3000) then { throw "ConstructionAbortedInformation"; };
        
        /* PREVENT BUILDING ON ROADS
        if (isOnRoad getPosATL player) then { throw "ConstructionAbortedInformation"; }; */        

        if(_itemClassName isEqualTo "Exile_Item_Flag") then { throw "FLAG"; };
        [_itemClassName] call ExileClient_construction_beginNewObject;
    }
    catch
    {
        if(_exception isEqualTo "FLAG")then
        {
            call ExileClient_gui_setupTerritoryDialog_show;
        }
        else
        {
            if(_exception isEqualTo "ConstructionAbortedInformation")then{
                [_exception,"Building Permit Denied"] call ExileClient_gui_notification_event_addNotification;
            }else{
                [_exception] call ExileClient_gui_notification_event_addNotification;
            };
        };    
    };
};
true

And still no go. Something's awry.

I know it has to be coming from here, because the message is Building Permit Denied.

Share this post


Link to post
Share on other sites
26 minutes ago, ciberloky said:

 work but messages not work on 0.98 any fix  please

On 6/17/2016 at 5:18 PM, Mr Sin said:

It's not an immediate resolution, but this is going to be added in the next exile update.

  • Added: Non-buildable zones, so you can prevent players from building somewhere. Can be defined in CfgExileEnvironment / mission config.

It's been added now as a feature of exile now. Read above ^

Share this post


Link to post
Share on other sites

yes but only define position we can't define buildings 

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.