Jump to content

Snowmobil

Member
  • Posts

    88
  • Joined

  • Last visited

Posts posted by Snowmobil

  1. Its in dayz_code\actions\player_build.sqf

    if(_counter >= 50) exitWith {
    

    Copy

    dayz_code\init\compiles.sqf
    dayz_code\actions\player_build.sqf

    to a folder in your mission.pbo. (I named it "custom")

     

    init.sqf

     

    progressLoadingScreen 0.4;

    - call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf"; //Compile regular functions
    + call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile regular functions
    progressLoadingScreen 0.5;

     

    compiles.sqf

    - player_build = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_build.sqf";

    + player_build = compile preprocessFileLineNumbers "custom\player_build.sqf";

  2. private ["_owner_id", "_key_colors", "_index", "_key_number", "_item"];
     
    _owner_id = cursorTarget getVariable ["CharacterID","0"];
     
    if (_ownerID != 0) then {
    _key_colors = ["Green", "Red", "Blue", "Yellow", "Black"]
    _index = floor (_owner_id / 2500)
    _key_number = _owner_id - _index * 2500
    
    _item = format["ItemKey%1%2", _key_colors select _index, _key_number];
    [player, _item, 1] call BIS_fnc_invAdd;
    };

    I think that should work.

  3. From that forum post:

    To implement this in a way that saves resources within the game the mechanic could be set to run daily, where a nightly job calculates all possesion and then updates the loot tables. The loot table files are held on the hive and when the server updates or restarts it queries these numbers and sets them accordingly. This will save resources and ensure that possesion numbers are close enough to the desired numbers. The alternative would be querring the tables each time loot is generated and that would create to much lag.

     

    So fetch all character_data/object_data/traders_data from DB, calculate the total amount of every item in circulation, and update the loot tables accordingly.

    I'd say thats minor tinkering with the loot tables ^^

  4. This closes the menu after every attempt.

     

    You need to copy

    dayz_code\init\compiles.sqf
    dayz_code\compile\player_unlockDoor.sqf

    to your mission.pbo

     

    init.sqf

     

    - call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf"; //Compile regular functions

    + call compile preprocessFileLineNumbers "path\to\compiles.sqf"; //Compile regular functions

     

    compiles.sqf

    - player_unlockDoor = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_unlockDoor.sqf";

    + player_unlockDoor = compile preprocessFileLineNumbers "path\to\player_unlockDoor.sqf";

     

     

    player_unlockDoor.sqf

     

    } else {

            DZE_Lock_Door = "";
            [player,"combo_locked",0,false] call dayz_zombieSpeak;
     
            + [player,20,true,(getPosATL player)] spawn player_alertZombies;
            + _display = findDisplay 41144;
            + _display closeDisplay 3000;
    };
  5. With this you can remove every new modular buildable, except lockable doors, if you are the owner. Unfortunately, right now the ID stored as OwnerID in the database is the CharacterID. Which means after you die you can't remove any buildables that you build before you died. (You could probably write a mysql trigger that updates the characterID once you respawn.)

     

    Lockable doors can be removed by everyone if they are unlocked, because the OwnerID is used to store the combination for the door.

     

    I haven't really tested this thoroughly, so use at your own risk ;)

    Sorry for all the quotes, text color doesn't seem to work with code.

    Instructions:

     

    Copy 

    dayz_code\init\compiles.sqf
    dayz_code\compile\fn_selfActions.sqf
    dayz_code\actions\remove.sqf

    to a folder in your mission.pbo. (I named it "custom")

     

    init.sqf

     

    progressLoadingScreen 0.4;

    - call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf"; //Compile regular functions
    + call compile preprocessFileLineNumbers "custom\compiles.sqf"; //Compile regular functions
    progressLoadingScreen 0.5;

     

    compiles.sqf

     

    fnc_inAngleSector = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inAngleSector.sqf"; //Checks which actions for nearby casualty

    - fnc_usec_selfActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selfActions.sqf"; //Checks which actions for self
    + fnc_usec_selfActions = compile preprocessFileLineNumbers "custom\fn_selfActions.sqf"; //Checks which actions for self
    fnc_usec_unconscious = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_unconscious.sqf";

     

    fn_selfActions.sqf:

     

     

    _isDestructable = _cursorTarget isKindOf "BuiltItems";

    _isWreck = _typeOfCursorTarget in DZE_isWreck;
    _isWreckBuilding = _typeOfCursorTarget in DZE_isWreckBuilding;
    + _isModularItem = _cursorTarget isKindOf "ModularItems" or _cursorTarget isKindOf "Land_DZE_WoodDoor_Base" or _cursorTarget isKindOf "CinderWallDoor_DZ_Base";
    + _isUnlockedDoor = (_cursorTarget isKindOf "Land_DZE_WoodDoorLocked_Base" or _cursorTarget isKindOf "CinderWallDoorLocked_DZ_Base") and {_cursorTarget animationPhase "Open_hinge" == 1};
    _isRemovable = _typeOfCursorTarget in DZE_isRemovable;
    _isDisallowRepair = _typeOfCursorTarget in ["M240Nest_DZ"];

     

     

    //Allow player to delete objects

    - if(_isDestructable or _isWreck or _isRemovable or _isWreckBuilding) then {

    + if(_isDestructable or _isWreck or _isRemovable or _isWreckBuilding or _isModularItem or _isUnlockedDoor) then {

     

     

    if(_player_deleteBuild) then {

    if (s_player_deleteBuild < 0) then {
    s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "\z\addons\dayz_code\actions\remove.sqf",_cursorTarget, 1, true, true, "", ""];
    + s_player_deleteBuild = player addAction [format[localize "str_actions_delete",_text], "custom\remove.sqf",_cursorTarget, 1, true, true, "", ""];
    };

     

    remove.sqf

     

     

    _objOwnerID = _obj getVariable["CharacterID","0"];

    _isOwnerOfObj = (_objOwnerID == dayz_characterID);
     
    + _isModularItem = _obj isKindOf "ModularItems" or _obj isKindOf "Land_DZE_WoodDoor_Base" or _obj isKindOf "CinderWallDoor_DZ_Base";
    + _isLockableDoor = _obj isKindOf "Land_DZE_WoodDoorLocked_Base" or _obj isKindOf "CinderWallDoorLocked_DZ_Base";
    + if(_isModularItem and !_isOwnerOfObj) exitWith {TradeInprogress = false; cutText ["Cannot remove item: You're not the owner.", "PLAIN DOWN"];};
     
    if(_obj getVariable ["GeneratorRunning", false]) exitWith {TradeInprogress = false; cutText ["Cannot remove running generator.", "PLAIN DOWN"];};

     

     

    // Double check that object is not null

    if(!isNull(_obj)) then {
     
    +                if (_isLockableDoor and {_obj animationPhase "Open_hinge" == 0}) exitWith {TradeInprogress = false; cutText ["Cannot remove locked door.", "PLAIN DOWN"];};
     
                     deleteVehicle _obj;
×
×
  • Create New...