oSoDirty

[UPDATED - 1.0.0 ] [Overwrite] Limit Base Building Height (without effecting radius)

22 posts in this topic

Updated to fix an exploit to get around the limit. A full reinstall of this will be required to update.

Just some simple overwrites and a config to limit the the height of Sky Scraper bases without effecting the full radius. :)

DOWNLOAD

Download zip from link, extract the folder and place it in the root of your mission file.

Load the config in init.sqf like so:       (If you dont have an init.sqf simply create one and put it in the root of your mission file.)

execVM "Build_Limits\config.sqf";

 

Call the overwrites in mission pbo > config.cpp > CfgExileCustomCode like so:

	//Build limits
	ExileClient_construction_handleAbort = "Build_Limits\ExileClient_construction_handleAbort.sqf";
	ExileClient_object_item_construct = "Build_Limits\ExileClient_object_item_construct.sqf";
	ExileClient_construction_thread = "Build_Limits\ExileClient_construction_thread.sqf";

 Enjoy!

Edited by oSoDirty
  • Like 12

Share this post


Link to post
Share on other sites
Advertisement
55 minutes ago, StrokeR said:

Link not working :(

 

Quote

/**
 * ExileClient_object_item_construct
 *
 * Exile Mod
 * exile.majormittens.co.uk
 * © 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["_heightLimit","_message","_elevation","_itemClassName","_minimumDistanceToTraderZones","_minimumDistanceToSpawnZones","_maximumNumberOfTerritoriesPerPlayer","_numberOfTerritories"];


//////////////
//Config
//////////////

_heightLimit = 30;                                            // Height limitation in meters. Default: 30 Plenty IMO
_message = format ["The build height limit of %1 meters has been reached!", _heightLimit];                // Message players are given when maximum hight is reachedThe //////ТЕКСТ

//////////////
// End config
//////////////


_elevation = (getPosATL player) select 2;
_itemClassName = _this select 0;
if !(_itemClassName in (magazines player)) exitWith {false};
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 "You cannot build while in a vehicle.";//////ТЕКСТ
        };
        _minimumDistanceToTraderZones = getNumber (missionConfigFile >> "CfgTerritories" >> "minimumDistanceToTraderZones");
        if ([player, _minimumDistanceToTraderZones] call ExileClient_util_world_isTraderZoneInRange) then
        {
            throw "You are too close to a safe zone.";//////ТЕКСТ
        };
        if (player call ExileClient_util_world_isInNonConstructionZone) then
        {
            throw "Building is disallowed here on this server.";//////ТЕКСТ
        };
        if (player call ExileClient_util_world_isInConcreteMixerZone) then
        {
            throw "You are too close to a concrete mixer zone.";//////ТЕКСТ
        };
        _minimumDistanceToSpawnZones = getNumber (missionConfigFile >> "CfgTerritories" >> "minimumDistanceToSpawnZones");
        if ([player, _minimumDistanceToSpawnZones] call ExileClient_util_world_isSpawnZoneInRange) then
        {
            throw "You are too close to a spawn zone.";//////ТЕКСТ
        };
        if (_elevation >= _heightLimit) then
        {
            throw "Whoops";
        };
        if(_itemClassName isEqualTo "Exile_Item_Flag") then
        {
            _maximumNumberOfTerritoriesPerPlayer = getNumber (missionConfigFile >> "CfgTerritories" >> "maximumNumberOfTerritoriesPerPlayer");
            _numberOfTerritories = player call ExileClient_util_territory_getNumberOfTerritories;
            if (_numberOfTerritories >= _maximumNumberOfTerritoriesPerPlayer) then
            {
                throw "You have reached the maximum number of territories you can own.";//////ТЕКСТ
            };
            call ExileClient_gui_setupTerritoryDialog_show;
        }
        else
        {
            [_itemClassName] call ExileClient_construction_beginNewObject;
        };
    }
    catch
    {
        if(_exception isEqualTo "Whoops") then
        {
            ["ErrorTitleAndText", ["Construction aborted!", _message]] call ExileClient_gui_toaster_addTemplateToast;
        }
        else
        {
            ["ErrorTitleAndText", ["Construction aborted!", _exception]] call ExileClient_gui_toaster_addTemplateToast;
        };
    };
};
true

 

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.