Jump to content
Sign in to follow this  
SryImAnooB

Salvage Vehicle Bug?!

Recommended Posts

Hey guys, got a problem. If i try to salvage a vehicle it shows me the aviable dmaged parts, but when i click on them nothing happens.

After i ran around a bit(seems like the action is canceled then) i get the option again but this time it says: Already Salvaging!.

Someone can confirm or is it me fucked something up?! :D

 

FIXED

Im not quite sure why i have to do this. I use Infistar and maybe thats colliding with eachother. Didnt test it without Infistar, its just a idea.

In salvage.sqf i uncommented this:

{
 if ((_vehicle distance (_x select 0)) < (_x select 1)) exitWith {_cancel = true;};
} count DZE_SafeZonePosArray;
 if (_cancel) exitWith {    (localize "str_salvage_safezone") call dayz_rollingMessages;};

like this:

Spoiler

private ["_array","_vehicle","_part","_hitpoint","_type","_isOK","_brokenPart","_cancel","_started","_finished","_hasToolbox","_nameType","_namePart","_animState","_isMedic","_damage","_BreakableParts","_selection","_wpn","_classname","_ismelee"];

if (dayz_salvageInProgress) exitWith { localize "str_salvage_inprogress" call dayz_rollingMessages; };
dayz_salvageInProgress = true;

_array = _this select 3;
_vehicle =     _array select 0;
_part =    _array select 1;
_hitpoint = _array select 2;
_type = typeOf _vehicle;
_isOK = false;
_brokenPart = false;
_started = false;
_finished = false;
_hasToolbox = "ItemToolbox" in items player;
_cancel = false;

_nameType = getText(configFile >> "cfgVehicles" >> _type >> "displayName");
_namePart = getText(configFile >> "cfgMagazines" >> _part >> "displayName");

{_vehicle removeAction _x} count s_player_repairActions;
s_player_repairActions = [];
s_player_repair_crtl = 1;

if (_hasToolbox) then {
//    {
//        if ((_vehicle distance (_x select 0)) < (_x select 1)) exitWith {_cancel = true;};
//    } count DZE_SafeZonePosArray;
//    if (_cancel) exitWith {    (localize "str_salvage_safezone") call dayz_rollingMessages;};
    player playActionNow "Medic";
    [player,"repair",0,false] call dayz_zombieSpeak;
    [player,50,true,(getPosATL player)] call player_alertZombies;

    // Added Nutrition-Factor for work
    // ["Working",0,[20,40,15,0]] call dayz_NutritionSystem;

    r_interrupt = false;
    _animState = animationState player;
    r_doLoop = true;
    
    while {r_doLoop} do {
        _animState = animationState player;
        _isMedic = ["Medic",_animState] call fnc_inString;
        if (_isMedic) then { _started = true; };
        if (_started and !_isMedic) then { r_doLoop = false; _finished = true; };
        if (r_interrupt) then { r_doLoop = false; };
        uiSleep 0.1;
    };
    r_doLoop = false;

    if (_finished) then {
        //Remove melee magazines (BIS_fnc_invAdd fix)
        false call dz_fn_meleeMagazines;
        _damage = [_vehicle,_hitpoint] call object_getHit;
        if (_damage < 1 && {_damage > 0}) then { //Tempfix for issue where certain hitpoints on some vehicles do not get damaged and allow infinite removal
            _BreakableParts = ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitLGlass","HitRGlass","HitEngine","HitFuel","HitHRotor"];
            if (_hitpoint in _BreakableParts) then {
                if ((random 1) < (_damage * 0.9)) then { //max 90% chance to break
                    _isOK = true;
                    _brokenPart = true;
                } else {
                    _isOK = [player,_part] call BIS_fnc_invAdd;
                    _brokenPart = false;
                };
            } else {                
                _isOK = [player,_part] call BIS_fnc_invAdd;
                _brokenPart = false;
            };
            
            if (_isOK) then {
                _selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
                /*if ((_hitpoint == "HitEngine") or (_hitpoint == "HitFuel")) then {
                    [_vehicle, _selection, 0.89] call fnc_veh_handleDam;
                } else {*/
                    [_vehicle, _selection, 1] call fnc_veh_handleDam;
                //};
                _vehicle call fnc_veh_ResetEH;
                _vehicle setvelocity [0,0,1];
                if(_brokenPart) then {
                    format[localize "str_salvage_destroyed",_namePart,_nameType] call dayz_rollingMessages;
                } else {
                    format[localize "str_salvage_removed",_namePart,_nameType] call dayz_rollingMessages;
                };
            } else {
                localize "str_player_24" call dayz_rollingMessages;
            };
        };
        true call dz_fn_meleeMagazines;
    } else {
        r_interrupt = false;
        if (vehicle player == player) then {
            [objNull, player, rSwitchMove,""] call RE;
            player playActionNow "stop";
        };
        localize "str_salvage_canceled" call dayz_rollingMessages;
    };
} else {
    format[localize "str_salvage_toolbox",_namePart] call dayz_rollingMessages;
};

dayz_myCursorTarget = objNull;
s_player_repair_crtl = -1;
dayz_salvageInProgress = false;

//adding melee mags back if needed
_wpn = primaryWeapon player;
//diag_log format["Classname: %1, WPN: %2", _classname,_wpn];
_ismelee = (getNumber (configFile >> "CfgWeapons" >> _wpn >> "melee") == 1);
if (_ismelee) then {
    call dayz_meleeMagazineCheck;
};

 

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Similar Content

    • By FG_Trap
      Made this in my free time awhile ago thought id make it public.
      Right Alt is the key to open the menu.
      Install instructions are inside the download.
      https://github.com/NWDZ-Trapxxgods/traps-menu
       
       
      here is a picture of the server menu
       
    • By lordacus
      so i have been making a server between trying to get my provider to update their mods section. after getting this don i found the server with epoch and infistar were conflicting each other such as: when joining i can use infistar but when i press f9 or i to enter my inventory or f10 for the mobile pad it then conflicts (i think) infistar and i can no longer use it. any ideas on how to stop this
       
    • By vbawol
      Open world survival mod set just two years after the mass extinction of billions of people. Those that remain are left with remnants of a once technological society. Try to survive, build, or explore your way through the harsh dynamic environment.
      Features
      Powerful persistence framework for Arma 3 with native Windows and Linux dedicated server support. Fully configurable script based security checks. Base Building re-envisioned for Arma 3 PhysX. Persistent secure and insecure storage devices. Upgradeable locking doors. Barter based economy and trading systems backed a single currency ¤ called "Krypto". Hostile Environment with several different types of antagonists, Air and Water temperature extremes, and Earthquakes. Hunting, Fishing, Tame Dogs, Explore & Loot: Wrecked ships, Abandoned vehicles and buildings, Perform task based missions and more! Open source APL-SA Epoch Survival MP gamemode. Open source APL-SA Modders resource configs and Class List. Assets can be used as a mod dependency on Steam workshop.
    • By Achef
      Greetings!
      So I recently started up in a new host and haven't gotten to make the server run, found that a ca/modules bis_fnc issue is recurring but doesn't affect players when running coop missions like the default arma 2 oa ones, but when trying with Epoch hive won't connect/start despite being configured.
      Hive error
      Meanwhile at line 23...
       
      I'm still bad with Pastebin, sorry.
       
      This error has been chasing me for 2 days now
    • By WeepiestLem0n
      So I've been wanting to create a private ArmA 2 DayZ Epoch server for a bunch of my mates to play on, however I dont have a dedicated machine and want to run it on my PC. So I looked at the server download files on the GitHub page and followed the ReadMe, however I absolutely cannot figure out how to get the MySQL server and DB set up. I have downloaded MySQL Server on my PC and created the admin role, root passwords and ran it as a windows service. I now have no clue how to create the database and am wondering if anyone can help me set this up or let me know if I've done anything wrong. 

      I can add on Steam or Discord if need be for convenience.
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...