Jump to content
  • 0

Anti Salvage??


BrDnzz

Question

13 answers to this question

Recommended Posts

  • 0

Replace this section in fn_selfActions.sqf with the one below: 

//Repairing Vehicles
	 if ((dayz_myCursorTarget != _cursorTarget) and _isVehicle and !_isMan and _hasToolbox and (damage _cursorTarget < 1) and !_isDisallowRepair) then {
        _hasKey = _ownerID in _temp_keys;
        _oldOwner = (_ownerID == dayz_playerUID);
        if (s_player_repair_crtl < 0) then {
            dayz_myCursorTarget = _cursorTarget;
            _menu = dayz_myCursorTarget addAction ["Repair Vehicle", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
            s_player_repairActions set [count s_player_repairActions,_menu];
            if(!locked _cursorTarget) then {
            _menu1 = dayz_myCursorTarget addAction ["Salvage Vehicle", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
            s_player_repairActions set [count s_player_repairActions,_menu1];};
            s_player_repair_crtl = 1;    
        } else {
            {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
            s_player_repair_crtl = -1;
        };
    };
Link to comment
Share on other sites

  • 0

Doesn't appear to work for 1.0.4.1.

 

Previously worked for 1.0.4 though.

 

Try this one for 1.0.4.1, haven't tested it tho it should work.

//Repairing Vehicles
     if ((dayz_myCursorTarget != _cursorTarget) and _isVehicle and !_isMan and _hasToolbox and (damage _cursorTarget < 1) and !_isDisallowRepair) then {
        _hasKey = _ownerID in _temp_keys;
        _oldOwner = (_ownerID == dayz_playerUID);
        if (s_player_repair_crtl < 0) then {
            dayz_myCursorTarget = _cursorTarget;
            _menu = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_REPAIRV", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
            s_player_repairActions set [count s_player_repairActions,_menu];
            if(!locked _cursorTarget) then {
            _menu1 = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_SALVAGEV", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
            s_player_repairActions set [count s_player_repairActions,_menu];
            s_player_repairActions set [count s_player_repairActions,_menu1];};
            s_player_repair_crtl = 1;    
        } else {
            {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
            s_player_repair_crtl = -1;
        };
    };
Link to comment
Share on other sites

  • 0

 

Try this one for 1.0.4.1, haven't tested it tho it should work.

//Repairing Vehicles
     if ((dayz_myCursorTarget != _cursorTarget) and _isVehicle and !_isMan and _hasToolbox and (damage _cursorTarget < 1) and !_isDisallowRepair) then {
        _hasKey = _ownerID in _temp_keys;
        _oldOwner = (_ownerID == dayz_playerUID);
        if (s_player_repair_crtl < 0) then {
            dayz_myCursorTarget = _cursorTarget;
            _menu = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_REPAIRV", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
            s_player_repairActions set [count s_player_repairActions,_menu];
            if(!locked _cursorTarget) then {
            _menu1 = dayz_myCursorTarget addAction [localize "STR_EPOCH_PLAYER_SALVAGEV", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false, "",""];
            s_player_repairActions set [count s_player_repairActions,_menu];
            s_player_repairActions set [count s_player_repairActions,_menu1];};
            s_player_repair_crtl = 1;    
        } else {
            {dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
            s_player_repair_crtl = -1;
        };
    };

Gave it a shot, no go. The menu still comes up to repair or salvage (when vehicle is locked) however when clicking on either option, the list of parts doesn't appear. It produces the same thing when the vehicle is unlocked. On a regular vehicle (non-locked) it does the samething.  I also tried cen's way using the his format, however that failed to even bring up the option for repair or salvage for either lockable or non-lockable vehicles.

Link to comment
Share on other sites

  • 0

Gave it a shot, no go. The menu still comes up to repair or salvage (when vehicle is locked) however when clicking on either option, the list of parts doesn't appear. It produces the same thing when the vehicle is unlocked. On a regular vehicle (non-locked) it does the samething.  I also tried cen's way using the his format, however that failed to even bring up the option for repair or salvage for either lockable or non-lockable vehicles.

I've just given it ago on my local test server and its all working fine. When going up to a locked vehicle it will only show the repair option without having a key for it, then when its unlocked i get both the repair/salvage option. When trying it to vehicles that are spawned on the map (no key) then they work as normal and let you salvage parts.

 

Possibly you might have a script conflicting with it but im no expert at scripting, i've just learnt from trial and error

Link to comment
Share on other sites

  • 0

I haven't tested, but I also haven't heard any complaints from players, so I'm assuming my way still works on 1.0.4.1.

 

Can't see a reason it wouldn't.

 

Like blacksheep25 said, you likely have another issue in fn_selfActions.sqf that is causing it.

Link to comment
Share on other sites

  • 0

I have this working just fine on my 1.0.4.1 server.  I rebuild my compiles and fn_selfaction files every patch using fresh files from the newest client code though.  If you don't rebuild those files (and some others) with the version updates you will likely have issues with lots of stuff.

Link to comment
Share on other sites

  • 0

I had to go into my init\compiles and change my directory for selfactions from 

 

fnc_usec_selfActions = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selfActions.sqf";

 

and change it to:

 

fnc_usec_selfActions = compile preprocessFileLineNumbers "init\fn_selfActions.sqf";

 

Everything works fine now.

Link to comment
Share on other sites

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
  • Advertisement
  • Discord

×
×
  • Create New...