Jump to content

DangerRuss

Member
  • Posts

    963
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by DangerRuss

  1. HUGE exploit found. This will kill the mod for anyone using it unless a fix is found.  If you go to buy an item, and you manually input a number to buy which is greater than 0 but less than 1, it will sell you that item at a fraction of the cost.

    For example, trader sells a ruby for 1000 coins... you select buy and enter 0.1 as the amount and it will sell you that ruby for 100 coins, 1/10 of the cost. If you select 0.01 it will sell it to you at 1/100th of the cost (10 coins) and if you select 0.001 it will sell it to you for 1/1000 of the cost (1 coin) 

    If someone could come out with a quick fix for this that would be amazing otherwise it would be the end of this very useful mod.  Honestly all you would have to do is disable manual input of a value so you can only use your mouse to select the items.  Either way its above my skill to fix

  2. Is it a safezone ? Whats the point of looting the airdrops without any risk

    no, my banks are not in safe zones.. that would be pointless yes.

     

    The reason I dont want to use tables, is because a lot of my traders have tables in front of them and i only want people to be able to access these at banks which are not in safe zones.

  3. _isAirdrop = cursorTarget isKindOf "Notebook";
    if ((speed player <= 1) && _isAirdrop && _canDo && (player distance cursorTarget < 4)) then {
        if (s_player_Airdrop < 0) then {
            s_player_Airdrop = player addAction [("<t color=""#0096ff"">" + ("Deploy Carepackage") +"</t>"),"custom\carepackages.sqf",cursorTarget, 0, false, true, "",""];
        };
    } else {
        player removeAction s_player_Airdrop;
        s_player_Airdrop = -1;
    };

    I dont need to modify the carepackages.sqf at all?

     

    What qualifies as a notebook? I have static laptops around the map which you can't pick up. I was trying to get a cursor option when you look at one, similar to a banker except your only option is to call in this carepackage.

     

    Im definitely missing something here because i get no scroll wheel option when looking at the laptop_EP1

  4. so yea I'd like to add this as a scroll wheel option when looking at say, a notebook. But this script doesn't seem designed for that.. I'd need to make variables to add the fn_selfactions and somehow add them to the script?

    _isPC = typeOf cursorTarget in ["Laptop_EP1"];
    
    if((isPC and (player distance cursorTarget <= 2)) and _canDo) then {
    if (s_player_deploycarepackage < 0) then {
            s_player_deploycarepackage = player addaction[("<t color=""#FFFF00"">" + ("Deploy Carepackage") +"</t>"),"custom\carepackages.sqf","",5,false,true,"", ""];
        };
    } else {
        player removeAction s_player_deploycarepackage;
        s_player_deploycarepackage= -1;
    };   
    
    

    but how exactly would I add that to the script? Something like

    private ["_cost","_positionM","_Marker","_LastUsedTime","_height","_downspeed","_wealth","_distance","_boxtype","_unit","_getPos","_position","_box","_chute","_smoke","_var","_textt","_tools","_items","_walls","_supplies","_weapon","_weapon2","_weapon3","_weapon4","_weapon5","_weapon6","_giveWep","_possibleMags","_mag","_whichBuild","_crateItems","_text","_isPC"];
    
    _cost = 2000;
    _wealth = player getVariable["cashMoney",0];
    _distance = 500;
    _boxtype = "USVehicleBox_EP1";
    _LastUsedTime = 900;
    _height = 100;
    _downspeed = -3;
    _OnlineLimit = 1;
    _unit = player;
    _getPos = getPos _unit;
    _position = [_getPos select 0, (_getPos select 1) - 5, _height];
    _positionM = [_getPos select 0, _getPos select 1];
    _isPC = "Laptop_EP1";
    
    

     

    ????

  5. hm..no.

    i am to far away now for removing all that.

    it works, the only thing is that the rotate function and the scroll menu is missing... and i like to have those scripts too, because there were other nice scripts which using p4l, like doormanagement...

    idk man, next your objects will rotate on restart and not save in the proper direction.. seems to be the common issue. I will say P4L would be handy and that door code is handy too. I know people who have it all working properly but a lot dont for some reason.

  6. Still testing these changes schwede, its a quiet server so it'll take awhile to fully test.. in the mean time.. I noticed that deployables are able to be sold to traders.. is there a way to attach a variable to them or something that would prevent them from being sellable? Seems very exploitable if say a toolbox and a vrotor gets you a mozzie which you can sell and make double your money back.

  7.  

    here you go !

     

    Works with coins and countless other customizations ;)

    private ["_cost","_positionM","_Marker","_LastUsedTime","_height","_downspeed","_wealth","_distance","_boxtype","_unit","_getPos","_position","_box","_chute","_smoke","_var","_textt","_tools","_items","_walls","_supplies","_weapon","_weapon2","_weapon3","_weapon4","_weapon5","_weapon6","_giveWep","_possibleMags","_mag","_whichBuild","_crateItems","_text"];
    
    _cost = 20000;
    _wealth = player getVariable["cashMoney",0];
    _distance = 500;
    _boxtype = "USVehicleBox_EP1";
    _LastUsedTime = 900;
    _height = 100;
    _downspeed = -3;
    _OnlineLimit = 20;
    _unit = player;
    _getPos = getPos _unit;
    _position = [_getPos select 0, (_getPos select 1) - 5, _height];
    _positionM = [_getPos select 0, _getPos select 1];
    
    //item lists
    _tools = ["ItemEtool","ItemKnife","ItemGPS","ItemFishingPole","ItemHatchet_DZE","ItemMatchbox_DZE","ItemCrowbar"];
    _items = ["ItemSodaPepsi","FoodCanCorn","FoodNutmix","ItemSodaClays","FoodCanSardines","ItemKiloHemp"];
    _walls = ["ItemWoodWallGarageDoor","ItemWoodWallWithDoorLg","ItemWoodWallLg","ItemWoodWallGarageDoor","ItemWoodFloor","metal_floor_kit"];
    _supplies = ["CinderBlocks","MortarBucket","ItemTankTrap","PartWoodPlywood","PartWoodLumber","ItemPole","PartGlass"];
    
    
    _giveWep = ["DMR","FHQ_ACR_WDL_TWS_SD","BAF_LRR_scoped","USSR_cheytacM200_sd","m107_DZ","BAF_L85A2_RIS_CWS"] call BIS_fnc_selectRandom;
    _possibleMags = getArray (configfile >> "cfgWeapons" >> _giveWep >> "magazines");
    _mag = _possibleMags select 0;
    
    //select arrays to use
    _crateItems = [_walls,_supplies,_items] call BIS_fnc_selectRandom;
    
    _Time = time - lastpack;
    
    if(_Time < _LastUsedTime) exitWith { // If cooldown is not done then exit script
        cutText [format["please wait %1 before calling in another Air Drop!",(round(_Time - _LastUsedTime))], "PLAIN DOWN"]; //display text at bottom center of screen when players cooldown is not done
    };
    
    if(!(canbuild) || (inSafeZone)) exitWith { cutText ["\n\nYou are in a Safezone and cannot perform that action!" , "PLAIN DOWN"]; };
    if (dayz_combat == 1) exitwith { cutText ["\n\nYou are in combat and cannot perform that action!", "PLAIN DOWN"] };
    
    
    if ((count playableUnits) < _OnlineLimit) exitWith  { cutText [format["Air Drop Failed. Less Than %1 Players online.",_OnlineLimit], "PLAIN DOWN"]; };
    if(_wealth < _cost) exitWith { cutText [format["You need %1 coins to Call an AirDrop.",_cost], "PLAIN DOWN"]; };
    
    player setVariable["cashMoney",(_wealth - _cost),true];
    
    PVDZE_plr_Save = [player,(magazines player),true,true] ;
    publicVariableServer "PVDZE_plr_Save";
    
    deleteMarker "MarkerDrop";
    _null  = createMarker ["MarkerDrop",_positionM];
    "MarkerDrop"  setMarkerText "Air Drop";
    "MarkerDrop"  setMarkerType "mil_objective";
    "MarkerDrop"  setMarkerColor "ColorRed";
    
    lastpack = time;
    
    for "_x" from 1 to 100 do {
        if (_x >= 2) then {cutText [format ["AIR DROP ARRIVING IN %1", 101-_x], "PLAIN DOWN"];};
        uiSleep 1;
    };
    
    _chute = createVehicle ["ParachuteMediumEast", _position, [], 0, "FLY"];
    _chutePos = getPos _chute;
    _box = createVehicle [_boxtype, _chutePos, [], 0, "FLY"];
    _box attachTo [_chute, [0,0,3]];
    _box setVariable ["Mission",1,true];
    _chute setVariable ["Mission",1,true];
    _box setVariable ["ObjectID", ""];
    _chute setVariable ["ObjectID", ""];
    _smoke = "SmokeShellBlue" createVehicle (getPos _box);
    _smoke attachTo [_box, [0,0,0]];
    _var = floor((random 20) + 1);
    
    //display text to alert user
    _textt = format ["\nCarepackage is above you!",10];
    titleText [_textt,"PLAIN DOWN"];
    
    while {getPos _box select 2 > 4} do
    {
     _chute SetVelocity [0,0,_downspeed];
     uiSleep 0.1;
    };
    detach _box;
    while {getPos _box select 2 > 0} do {
    _box setPos [getPos _box select 0, getPos _box select 1, (getPos _box select 2) - .25]
    };
    deleteVehicle _chute;
    _posATL = getPosATL _box;
    deleteVehicle _box;
    _boxx = _boxtype createVehicle _posATL;
    _boxx setVariable ["Mission",1,true];
    _boxx setVariable ["ObjectID", ""];
    
    clearweaponcargoglobal _boxx;
    clearmagazinecargoglobal _boxx;
    
    {_boxx addMagazineCargoGlobal [_x, _var];} forEach _crateItems;
    {_boxx addWeaponCargoGlobal [_x, 1];} forEach _tools;
    _boxx addMagazineCargoGlobal [_mag, _var];
    _boxx addWeaponCargoGlobal [_giveWep, 1];

    nice.. I can add this as a right click option correct?

  8. The bike spawns at [0,0,0] which is in water. For people who have low fps, spawning the bike at [0,0,0] then teleporting it to player position, in scheduled environment gives enough time for the bike to take damage. Although the bike says it is intact, it isn't. This is all theory which I presume to be correct as I had the exact same problem. I had players complaining that the bikes weren't working all the time, but I never had a problem. I on the other hand have a good PC whereas all my players wont. As soon as I changed it from spawning at [0,0,0] the problem was fixed.

    hm interesting!

  9.  

    ok just for my understanding:

    Are the plants stored in the database?

    Are the plants spawned on server restart new and on random directions?

     

    If the plant is not stored in the database, then there is no reason for this code:

    hemp.sqf

    [_objectID,_objectUID] call server_deleteObj;
    

    other then that, its even missing some content and should give some errors.

     

    BTW: Why there is not an option to cancel the farming process when moving? This could come in handy in some situations, just sayin' ^^

     

     

    The missing ; is in line 30 after the last }

    else {Flare attachTo [player,[0,0,0.]];} << here add a ;
    

     I think the way he's using it, they spawn as "missions" around the map. Wouldnt that line of code delete the object after you've harvested it, so you can't continue harvesting the same plant indefinitely?

  10. Where do you define the skills? For example, DZMS has this:

    // Array of AI Skills
    DZMSSkills0 = [
    	["aimingAccuracy",0.10,0.125],
    	["aimingShake",0.45,0.55],
    	["aimingSpeed",0.45,0.55],
    	["endurance",0.40,0.50],
    	["spotDistance",0.30,0.45],
    	["spotTime",0.30,0.45],
    	["courage",0.40,0.60],
    	["reloadSpeed",0.50,0.60],
    	["commanding",0.40,0.50],
    	["general",0.40,0.60]
    ];
    

    Is there something similar for WAI?

    Im not using the same version as you, but for me its in the main config.sqf

  11. both new files you given dont work.

    now i even cant harvest with right click on plant, nor i can smoke it...

    error msg directly appears when i try to right click on hemp or knife

    File mpmissions\__CUR_MP.Chernarus\scripts\smokeshit.sqf, line 31
    Error in expression <else {Flare attachTo [player,[0,0,0]];}
    ppe2 = ppEffectCreate ["chromAberration">
      Error position: <ppe2 = ppEffectCreate ["chromAberration">
      Error Missing ;
    File mpmissions\__CUR_MP.Chernarus\scripts\smokeshit.sqf, line 31 

    idk what you're doing wrong with the hemp.sqf then bud, it works perfectly fine on my server.

    I dont know how to fix the smokeshit.sqf then. I dont use that script and I dont understand where it's missing the ;

  12. 0 = north

    90 = east

    180 = south

    270 = west

    360 = north

    doesn't work

    /*
        DayZ Base Building
        Made for DayZ Epoch please ask permission to use/edit/distrubute email [email protected].
    */
    private ["_location","_dir","_classname","_item","_hasrequireditem","_missing","_hastoolweapon","_cancel","_reason","_started","_finished","_animState","_isMedic","_dis","_sfx","_hasbuilditem","_tmpbuilt","_onLadder","_isWater","_require","_text","_offset","_IsNearPlot","_isOk","_location1","_location2","_counter","_limit","_proceed","_num_removed","_position","_object","_canBuildOnPlot","_friendlies","_nearestPole","_ownerID","_findNearestPoles","_findNearestPole","_distance","_classnametmp","_ghost","_isPole","_needText","_lockable","_zheightchanged","_rotate","_combination_1","_combination_2","_combination_3","_combination_4","_combination","_combination_1_Display","_combinationDisplay","_zheightdirection","_abort","_isNear","_need","_needNear","_vehicle","_inVehicle","_requireplot","_objHDiff","_isLandFireDZ","_isTankTrap"];
    
    if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_40") , "PLAIN DOWN"]; };
    DZE_ActionInProgress = true;
    
    // disallow building if too many objects are found within 30m
    if((count ((getPosATL player) nearObjects ["All",30])) >= DZE_BuildingLimit) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_41"), "PLAIN DOWN"];};
    
    _onLadder =     (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
    _isWater =      dayz_isSwimming;
    _cancel = false;
    _reason = "";
    _canBuildOnPlot = false;
    
    _vehicle = vehicle player;
    _inVehicle = (_vehicle != player);
    
    DZE_Q = false;
    DZE_Z = false;
    
    DZE_Q_alt = false;
    DZE_Z_alt = false;
    
    DZE_Q_ctrl = false;
    DZE_Z_ctrl = false;
    
    DZE_5 = false;
    DZE_4 = false;
    DZE_6 = false;
    
    DZE_cancelBuilding = false;
    
    call gear_ui_init;
    closeDialog 1;
    
    if (_isWater) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_26", "PLAIN DOWN"];};
    if (_inVehicle) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_42"), "PLAIN DOWN"];};
    if (_onLadder) exitWith {DZE_ActionInProgress = false; cutText [localize "str_player_21", "PLAIN DOWN"];};
    if (player getVariable["combattimeout", 0] >= time) exitWith {DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_43"), "PLAIN DOWN"];};
    
    _item = _this;
    
    // Need Near Requirements
    _abort = false;
    _reason = "";
    
    //### BEGIN MODIFIED CODE: player_deploy
    //_needNear =     getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "neednearby");
    private["_index"];
    _index = _this call getDeployableIndex;
    _needNear = _index call getDeployableNeedNearBy;
    //### END MODIFIED CODE: player_deploy
    
    {
        switch(_x) do{
            case "fire":
            {
                _distance = 3;
                _isNear = {inflamed _x} count (getPosATL player nearObjects _distance);
                if(_isNear == 0) then {
                    _abort = true;
                    _reason = "fire";
                };
            };
            case "workshop":
            {
                _distance = 3;
                _isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ","WorkBench_DZ"], _distance]);
                if(_isNear == 0) then {
                    _abort = true;
                    _reason = "workshop";
                };
            };
            case "fueltank":
            {
                _distance = 30;
                _isNear = count (nearestObjects [player, dayz_fuelsources, _distance]);
                if(_isNear == 0) then {
                    _abort = true;
                    _reason = "fuel tank";
                };
            };
        };
    } forEach _needNear;
    
    
    if(_abort) exitWith {
        cutText [format[(localize "str_epoch_player_135"),_reason,_distance], "PLAIN DOWN"];
        DZE_ActionInProgress = false;
    };
    
    //### BEGIN MODIFIED CODE: player_deploy
    //_classname =    getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
    //_classnametmp = _classname;
    //_require =  getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Build" >> "require");
    //_text =         getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
    //_ghost = getText (configFile >> "CfgVehicles" >> _classname >> "ghostpreview");
    _classname      = _index call getDeployableClass;
    _classnametmp   = _classname;
    _require        = [];
    _text           = _index call getDeployableDisplay;
    _ghost          = "";
    //### END MODIFIED CODE: player_deploy
    
    _lockable = 0;
    if(isNumber (configFile >> "CfgVehicles" >> _classname >> "lockable")) then {
        _lockable = getNumber(configFile >> "CfgVehicles" >> _classname >> "lockable");
    };
    
    _requireplot = 1;
    if(isNumber (configFile >> "CfgVehicles" >> _classname >> "requireplot")) then {
        _requireplot = getNumber(configFile >> "CfgVehicles" >> _classname >> "requireplot");
    };
    //### BEGIN MODIFIED CODE: player_deploy
    if(_index call getDeployableRequirePlot) then {_requireplot = 1;} else {_requireplot = 0;};
    //### END MODIFIED CODE: player_deploy
    
    _isAllowedUnderGround = 1;
    if(isNumber (configFile >> "CfgVehicles" >> _classname >> "nounderground")) then {
        _isAllowedUnderGround = getNumber(configFile >> "CfgVehicles" >> _classname >> "nounderground");
    };
    
    _offset =   getArray (configFile >> "CfgVehicles" >> _classname >> "offset");
    if((count _offset) <= 0) then {
        _offset = [0,1.5,0];
    };
    //### BEGIN MODIFIED CODE: player_deploy
    _offset = _index call getDeployableDistanceOffset;
    //### END MODIFIED CODE: player_deploy
    
    _isPole = (_classname == "Plastic_Pole_EP1_DZ");
    _isLandFireDZ = (_classname == "Land_Fire_DZ");
    
    _distance = DZE_PlotPole select 0;
    _needText = localize "str_epoch_player_246";
    
    if(_isPole) then {
        _distance = DZE_PlotPole select 1;
    };
    
    // check for near plot
    _findNearestPoles = nearestObjects [(vehicle player), ["Plastic_Pole_EP1_DZ"], _distance];
    _findNearestPole = [];
    
    {
        if (alive _x) then {
            _findNearestPole set [(count _findNearestPole),_x];
        };
    } count _findNearestPoles;
    
    _IsNearPlot = count (_findNearestPole);
    
    // If item is plot pole && another one exists within 45m
    if(_isPole && _IsNearPlot > 0) exitWith {  DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_44") , "PLAIN DOWN"]; };
    
    private["_exitWith"];
    if(_IsNearPlot == 0) then {
    
        // Allow building of plot
        if(_requireplot == 0 || _isLandFireDZ) then {
            _canBuildOnPlot = true;
        } else {
            _exitWith = (localize "STR_EPOCH_PLAYER_135");
        };
    
    } else {
        // Since there are plots nearby we check for ownership && then for friend status
    
        // check nearby plots ownership && then for friend status
        _nearestPole = _findNearestPole select 0;
    
        // Find owner
        _ownerID = _nearestPole getVariable ["CharacterID","0"];
    
        // diag_log format["DEBUG BUILDING: %1 = %2", dayz_characterID, _ownerID];
    
        // check if friendly to owner
        if(dayz_characterID == _ownerID) then {  //Keep ownership
            // owner can build anything within his plot except other plots
            if(!_isPole) then {
                _canBuildOnPlot = true;
            } else {
                _exitWith = "You can't build a plot within your plot!";
            };
    
        } else {
            // disallow building plot
            if(!_isPole) then {
                _friendlies     = player getVariable ["friendlyTo",[]];
                // check if friendly to owner
                if(_ownerID in _friendlies) then {
                    _canBuildOnPlot = true;
                } else {
                    _exitWith = "You can't build on someone else's plot!";
                };
            };
        };
    };
    
    // _message
    if(!_canBuildOnPlot) exitWith {  DZE_ActionInProgress = false; cutText [format[_exitWith,_needText,_distance] , "PLAIN DOWN"]; };
    
    _missing = "";
    _hasrequireditem = true;
    {
        _hastoolweapon = _x in weapons player;
        if(!_hastoolweapon) exitWith { _hasrequireditem = false; _missing = getText (configFile >> "cfgWeapons" >> _x >> "displayName"); };
    } count _require;
    //### BEGIN MODIFIED CODE player_deploy
        _hastoolweapon = (_index call getDeployableKitClass) in ((weapons player) + (magazines player));
        if(!_hastoolweapon) then { _hasrequireditem = false; _missing = (_index call getDeployableKitDisplay); };
    //### END MODIFIED CODE: player_deploy
    
    //### BEGIN MODIFIED CODE player_deploy
    //_hasbuilditem = _this in magazines player;
    //if (!_hasbuilditem) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]; };
    _hasbuilditem = [player,_index] call getHasDeployableParts;
    if (!_hasbuilditem) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_player_31"),str (_index call getDeployableParts),"build"] , "PLAIN DOWN"]; };
    //### END MODIFIED CODE: player_deploy
    
    if (!_hasrequireditem) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_epoch_player_137"),_missing] , "PLAIN DOWN"]; };
    if (_hasrequireditem) then {
    
    /*REMOVED TO HOPEFULLY FIX UNRIDEABLE ISSUE
        _location = [0,0,0];
    */
    //ADDED TO HOPEFULLY FIX UNRIDEABLE ISSUE
    	_dir = getdir player;
    	_dir = _dir + 180;
    	_location = getPos player;
    	_location = [(_location select 0)+8*sin(_dir),(_location select 1)+8*cos(_dir),0]; //maybe adjust the height? [x,y,z(0)]
    //ADDED TO HOPEFULLY FIX UNRIDEABLE ISSUE	
    	
        _isOk = true;
    
        // get inital players position
        _location1 = getPosATL player;
    	/*REMOVED TO HOPEFULLY FIX UNRIDEABLE ISSUE
        _dir = getDir player;
    	*/
    
        // if ghost preview available use that instead
        if (_ghost != "") then {
            _classname = _ghost;
        };
    
        _object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
        //### BEGIN MODIFIED CODE player_deploy
        _object setVariable["ObjectUID","1",true];
    
        _object attachTo [player,_offset];
        
    	/*REMOVED TO HOPEFULLY FIX UNRIDEABLE ISSUE
        _dir = 0;
    	*/
        _object setDir _dir;
        //### END MODIFIED CODE: player_deploy
    
        _position = getPosATL _object;
    
        cutText [(localize "str_epoch_player_45"), "PLAIN DOWN"];
    
        _objHDiff = 0;
    
        while {_isOk} do {
    
            _zheightchanged = false;
            _zheightdirection = "";
            _rotate = false;
    
            if (DZE_Q) then {
                DZE_Q = false;
                _zheightdirection = "up";
                _zheightchanged = true;
            };
            if (DZE_Z) then {
                DZE_Z = false;
                _zheightdirection = "down";
                _zheightchanged = true;
            };
            if (DZE_Q_alt) then {
                DZE_Q_alt = false;
                _zheightdirection = "up_alt";
                _zheightchanged = true;
            };
            if (DZE_Z_alt) then {
                DZE_Z_alt = false;
                _zheightdirection = "down_alt";
                _zheightchanged = true;
            };
            if (DZE_Q_ctrl) then {
                DZE_Q_ctrl = false;
                _zheightdirection = "up_ctrl";
                _zheightchanged = true;
            };
            if (DZE_Z_ctrl) then {
                DZE_Z_ctrl = false;
                _zheightdirection = "down_ctrl";
                _zheightchanged = true;
            };
            if (DZE_4) then {
                _rotate = true;
                DZE_4 = false;
                //###BEGIN MODIFIED CODE: player deploy
                //_dir = 0;
                _dir = _dir + 30;
                //###END MODIFIED CODE: player deploy
            };
            if (DZE_6) then {
                _rotate = true;
                DZE_6 = false;
                //###BEGIN MODIFIED CODE: player deploy
                //_dir = 180;
                _dir = _dir - 30;
                //###END MODIFIED CODE: player deploy
            };
    
            if(_rotate) then {
                _object setDir _dir;
                _object setPosATL _position;
                //diag_log format["DEBUG Rotate BUILDING POS: %1", _position];
            };
    
            if(_zheightchanged) then {
                detach _object;
    
                _position = getPosATL _object;
    
                if(_zheightdirection == "up") then {
                    _position set [2,((_position select 2)+0.1)];
                    _objHDiff = _objHDiff + 0.1;
                };
                if(_zheightdirection == "down") then {
                    _position set [2,((_position select 2)-0.1)];
                    _objHDiff = _objHDiff - 0.1;
                };
    
                if(_zheightdirection == "up_alt") then {
                    _position set [2,((_position select 2)+1)];
                    _objHDiff = _objHDiff + 1;
                };
                if(_zheightdirection == "down_alt") then {
                    _position set [2,((_position select 2)-1)];
                    _objHDiff = _objHDiff - 1;
                };
    
                if(_zheightdirection == "up_ctrl") then {
                    _position set [2,((_position select 2)+0.01)];
                    _objHDiff = _objHDiff + 0.01;
                };
                if(_zheightdirection == "down_ctrl") then {
                    _position set [2,((_position select 2)-0.01)];
                    _objHDiff = _objHDiff - 0.01;
                };
    
                //###BEGIN MODIFIED CODE: player deploy
                //_object setDir (getDir _object);
                //###END MODIFIED CODE: player deploy
    
                if((_isAllowedUnderGround == 0) && ((_position select 2) < 0)) then {
                    _position set [2,0];
                };
    
                _object setPosATL _position;
    
                //diag_log format["DEBUG Change BUILDING POS: %1", _position];
    
                _object attachTo [player];
    
                //### BEGIN MODIFIED CODE player_deploy
                _object setDir _dir;
                //### END MODIFIED CODE: player_deploy
    
            };
    
            sleep 0.5;
    
            _location2 = getPosATL player;
    
            if(DZE_5) exitWith {
                _isOk = false;
                detach _object;
                _dir = getDir _object;
                _position = getPosATL _object;
                //diag_log format["DEBUG BUILDING POS: %1", _position];
                _object setPos[0,0,0];
                hideObject _object;
                deleteVehicle _object;
            };
    
            if(_location1 distance _location2 > 5) exitWith {
                _isOk = false;
                _cancel = true;
                _reason = "You've moved to far away from where you started building (within 5 meters)";
                detach _object;
                _object setPos[0,0,0];
                hideObject _object;
                deleteVehicle _object;
            };
    
            if(abs(_objHDiff) > 5) exitWith {
                _isOk = false;
                _cancel = true;
                _reason = "Cannot move up || down more than 5 meters";
                detach _object;
                _object setPos[0,0,0];
                hideObject _object;
                deleteVehicle _object;
            };
    
            if (player getVariable["combattimeout", 0] >= time) exitWith {
                _isOk = false;
                _cancel = true;
                _reason = (localize "str_epoch_player_43");
                detach _object;
                _object setPos[0,0,0];
                hideObject _object;
                deleteVehicle _object;
            };
    
            if (DZE_cancelBuilding) exitWith {
                _isOk = false;
                _cancel = true;
                _reason = "Cancelled building.";
                detach _object;
                _object setPos[0,0,0];
                hideObject _object;
                deleteVehicle _object;
            };
        };
    
        //### END MODIFIED CODE: road building
        //No building on roads unless toggled
        //if (!DZE_BuildOnRoads) then {
        if (!(_index call getDeployableBuildOnRoad)) then {
        //### END MODIFIED CODE: road building
            if (isOnRoad [_position select 0, _position select 1, 0]) then { _cancel = true; _reason = "Cannot build on a road."; };
        };
    
        // No building in trader zones
        if(!canbuild) then { _cancel = true; _reason = "Cannot build in a city."; };
    
        if(!_cancel) then {
    
            _classname = _classnametmp;
    
            // Start Build
            _tmpbuilt = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
    
            //### BEGIN MODIFIED CODE: player deploy
           // if (!(_index call getDeployableSimulation)) then {
           //     _tmpbuilt enableSimulation false;
           // };
            _tmpbuilt setVariable ["ObjectUID", "1", true];
            //### END MODIFIED CODE: player deploy
    
            _tmpbuilt setdir _dir;
    
            // Get position based on object
            _location = _position;
    
            if((_isAllowedUnderGround == 0) && ((_location select 2) < 0)) then {
                _location set [2,0];
            };
    
            _tmpbuilt setPosATL _location;
    
    
            cutText [format[(localize "str_epoch_player_138"),_text], "PLAIN DOWN"];
    
            _limit = 3;
    
            if (DZE_StaticConstructionCount > 0) then {
                _limit = DZE_StaticConstructionCount;
            }
            else {
                if (isNumber (configFile >> "CfgVehicles" >> _classname >> "constructioncount")) then {
                    _limit = getNumber(configFile >> "CfgVehicles" >> _classname >> "constructioncount");
                };
            };
    
            _isOk = true;
            _proceed = false;
            _counter = 0;
    
            while {_isOk} do {
    
                [10,10] call dayz_HungerThirst;
                player playActionNow "Medic";
    
                _dis=20;
                _sfx = "repair";
                [player,_sfx,0,false,_dis] call dayz_zombieSpeak;
                [player,_dis,true,(getPosATL player)] spawn player_alertZombies;
    
                r_interrupt = false;
                r_doLoop = true;
                _started = false;
                _finished = false;
    
                while {r_doLoop} do {
                    _animState = animationState player;
                    _isMedic = ["medic",_animState] call fnc_inString;
                    if (_isMedic) then {
                        _started = true;
                    };
                    if (_started && !_isMedic) then {
                        r_doLoop = false;
                        _finished = true;
                    };
                    if (r_interrupt || (player getVariable["combattimeout", 0] >= time)) then {
                        r_doLoop = false;
                    };
                    if (DZE_cancelBuilding) exitWith {
                        r_doLoop = false;
                    };
                    sleep 0.1;
                };
                r_doLoop = false;
    
    
                if(!_finished) exitWith {
                    _isOk = false;
                    _proceed = false;
                };
    
                if(_finished) then {
                    _counter = _counter + 1;
                };
    
                cutText [format[(localize "str_epoch_player_139"),_text, _counter,_limit], "PLAIN DOWN"];
    
                if(_counter == _limit) exitWith {
                    _isOk = false;
                    _proceed = true;
                };
    
            };
    
            if (_proceed) then {
    
                //###BEGIN MODIFIED CODE
                //_num_removed = ([player,_item] call BIS_fnc_invRemove);
                //if(_num_removed == 1) then {
                if([player,_index] call getHasDeployableParts) then {
                    [player,_index] call removeDeployableParts;
                //###BEGIN MODIFIED CODE
    
                    cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
    
                    if (_isPole) then {
                        [] spawn player_plotPreview;
                    };
    
                    _tmpbuilt setVariable ["OEMPos",_location,true];
    
                    if(_lockable > 1) then {
    
                        _combinationDisplay = "";
    
                        switch (_lockable) do {
    
                            case 2: { // 2 lockbox
                                _combination_1 = (floor(random 3)) + 100; // 100=red,101=green,102=blue
                                _combination_2 = floor(random 10);
                                _combination_3 = floor(random 10);
                                _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3];
                                dayz_combination = _combination;
                                if (_combination_1 == 100) then {
                                    _combination_1_Display = "Red";
                                };
                                if (_combination_1 == 101) then {
                                    _combination_1_Display = "Green";
                                };
                                if (_combination_1 == 102) then {
                                    _combination_1_Display = "Blue";
                                };
                                _combinationDisplay = format["%1%2%3",_combination_1_Display,_combination_2,_combination_3];
                            };
    
                            case 3: { // 3 combolock
                                _combination_1 = floor(random 10);
                                _combination_2 = floor(random 10);
                                _combination_3 = floor(random 10);
                                _combination = format["%1%2%3",_combination_1,_combination_2,_combination_3];
                                dayz_combination = _combination;
                                _combinationDisplay = _combination;
                            };
    
                            case 4: { // 4 safe
                                _combination_1 = floor(random 10);
                                _combination_2 = floor(random 10);
                                _combination_3 = floor(random 10);
                                _combination_4 = floor(random 10);
                                _combination = format["%1%2%3%4",_combination_1,_combination_2,_combination_3,_combination_4];
                                dayz_combination = _combination;
                                _combinationDisplay = _combination;
                            };
                        };
    
                        _tmpbuilt setVariable ["CharacterID",_combination,true];
    
    
                        PVDZE_obj_Publish = [_combination,_tmpbuilt,[_dir,_location],_classname];
                        publicVariableServer "PVDZE_obj_Publish";
    
                        cutText [format[(localize "str_epoch_player_140"),_combinationDisplay,_text], "PLAIN DOWN", 5];
    
    
                    } else {
                        //_tmpbuilt setVariable ["CharacterID",dayz_characterID,true];
                        //### BEGIN MODIFIED CODE: player deploy
                        // fire?
                        //if(_tmpbuilt isKindOf "Land_Fire_DZ") then {
                        //    _tmpbuilt spawn player_fireMonitor;
                        //} else {
                        //    PVDZE_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location],_classname];
                        //    publicVariableServer "PVDZE_obj_Publish";
                        //};
                        if (_index call getPermanent) then {
                            _tmpbuilt call fnc_set_temp_deployable_id;
                            if(_index call getDeployableSimulation) then {
                                PVDZE_veh_Publish = [_tmpbuilt,[_dir,_position],(_index call getDeployableClass),true,call fnc_perm_deployable_id];
                                publicVariableServer "PVDZE_veh_Publish";
                            } else {
                                PVDZE_obj_Publish = [call fnc_perm_deployable_id,_tmpbuilt,[_dir,_position],(_index call getDeployableClass)];
                                publicVariableServer "PVDZE_obj_Publish";
                            };
                        } else {
                            _tmpbuilt call fnc_set_temp_deployable_id;
                        };
                        if(_index call getClearCargo) then {
                            clearWeaponCargoGlobal _tmpbuilt;
                            clearMagazineCargoGlobal _tmpbuilt;
                        };
                        if(_index call getDeployableClearAmmo) then {
                            _tmpbuilt setVehicleAmmo 0;
                        };
                        player reveal _tmpbuilt;
                        DZE_DEPLOYING_SUCCESSFUL = true;
                        //### END MODIFIED CODE: player deploy
                    };
                } else {
                    _tmpbuilt setPos[0,0,0];
                    hideObject _tmpbuilt;
                    deleteVehicle _tmpbuilt;
                    cutText [(localize "str_epoch_player_46") , "PLAIN DOWN"];
                };
    
            } else {
                r_interrupt = false;
                if (vehicle player == player) then {
                    [objNull, player, rSwitchMove,""] call RE;
                    player playActionNow "stop";
                };
    
                _tmpbuilt setPos[0,0,0];
                hideObject _tmpbuilt;
                deleteVehicle _tmpbuilt;
    
                cutText [(localize "str_epoch_player_46") , "PLAIN DOWN"];
            };
    
        } else {
            cutText [format[(localize "str_epoch_player_47"),_text,_reason], "PLAIN DOWN"];
        };
    };
    
    DZE_ActionInProgress = false;
    
    

     

    Did I do it incorrectly? It makes absolutely no difference what I set that number to.

×
×
  • Create New...