Files
DayZ-Epoch/dayz_code/actions/salvage.sqf
vbawol 95c8bc5205 1.0.1.2 RC1
+ [FIXED] Prevent player zombies from getting any default loadouts.
+ [FIXED] Bad vehicle type message when using default loadout override
and no backpack.
+ [FIXED] dayz_zedsAttackVehicles logic was reversed fixed now so that
true = attack vehicles.
+ [ADDED] Safes now have a keypad GUI. Simply click on the numbers to
enter your combo and then press #.
https://www.dropbox.com/s/b00fgdpo13wokg9/Untitled-1.jpg
+ [ADDED] Tons of awesome cars by vilas from
http://www.armaholic.com/page.php?id=17447
+ [FIXED] Models needed extra variable to prevent being sunk into the
ground.
+ [CHANGED] Bleeding duration reduced to minimum of 30 sec and max of
330 seconds. Before it was min 100 max 500.
+ [ADDED] When kneeling bleeding per second is reduced by 50%.
+ [ADDED] When crawling bleeding per second is reduced by 75%.
+ [ADDED] When changing locations the locations name will display in the
bottom right.
+ [CHANGED] Replaced m107 with BAF_LRR_scoped.
+ [CHANGED] Replaced as50 with AK_107_PSO. TODO
+ [FIXED] Lock vehicle no longer shows on killed vehicles.
+ [ADDED] Disabled purchased vehicle parachute spawning by default added
variable DZE_TRADER_SPAWNMODE = true; to enable. (Default: false)
+ [CHANGED] Plot pole has changed to another model a "no entry" sign and
can be removed by anyone. When done building take your plot pole with
you, if it isn't yours remove it and put it back down again.
+ [ADDED] Loot positions on top of some tables.
+ [ADDED] Briefcase that can hold up to 10 x 10oz Gold Bars or 100oz.
+ [ADDED] Full moon nights as option with dayz_fullMoonNights = true;
+ [CHANGED] Can no longer Salvage vehicle parts with 0 damage. Fixes
bugged hitpoints and duping.
+ [REMOVED] Remove all crates of toolbelt items. This was just to add
stock to traders and since most servers are now auto stocking them at
the traders its not needed and cumbersome to use.
+ [CHANGED] Generator can only be built within 30m of gas stations that
say "Needs Power".
+ [CHANGED] Moved light bulb to farm loot table as it was to common on
trash loots.
+ [ADDED] Fuel pump can be built near standard fuel source (i.e. rusty
tanks) then powered with a generator to make a refuel station.
+ [CHANGED] R3f realism no more fade to black, changed to use dayz
shaking and knockouts.
+ [ADDED] Reset tiredness when you take painkillers.
+ [ADDED] Reset tiredness when you sleep at a tent.
+ [ADDED] added back fixed rbull soda and added new can orange sherbet
2013-06-20 09:03:48 -05:00

121 lines
3.2 KiB
Plaintext

private ["_vehicle","_part","_hitpoint","_type","_selection","_array","_started","_finished","_animState","_isMedic","_isOK","_brokenPart","_findPercent","_damage","_hasToolbox","_nameType","_namePart"];
if(TradeInprogress) exitWith { cutText ["Salvage already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
//_id = _this select 2;
_array = _this select 3;
_vehicle = _array select 0;
_part = _array select 1;
_hitpoint = _array select 2;
_type = typeOf _vehicle;
_isOK = false;
_brokenPart = false;
//
_hasToolbox = "ItemToolbox" in items player;
// moving this here because we need to know which part needed if we don't have it
_nameType = getText(configFile >> "cfgVehicles" >> _type >> "displayName");
_namePart = getText(configFile >> "cfgMagazines" >> _part >> "displayName");
{_vehicle removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
s_player_repair_crtl = 1;
if (_hasToolbox) then {
player playActionNow "Medic";
[player,"repair",0,false] call dayz_zombieSpeak;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
r_interrupt = false;
_animState = animationState player;
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 and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
if (_finished) then {
_damage = [_vehicle,_hitpoint] call object_getHit;
// _vehicle removeAction _id;
//dont allow removal of damaged parts
if (_damage < 1) then {
_findPercent = (1 - _damage) * 10;
if(ceil (random _findPercent) == 1) then {
_isOK = true;
_brokenPart = true;
} else {
_isOK = [player,_part] call BIS_fnc_invAdd;
_brokenPart = false;
};
if (_isOK) then {
//break the part
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
//vehicle is owned by whoever is in it, so we have to have each client try and fix it
//["dayzSetFix",[_vehicle,_selection,1],_vehicle] call broadcastRpcCallIfLocal;
dayzSetFix = [_vehicle,_selection,1];
publicVariable "dayzSetFix";
if (local _vehicle) then {
dayzSetFix call object_setFixServer;
};
_vehicle setvelocity [0,0,1];
if(_brokenPart) then {
//Failed!
cutText [format["You have destroyed %1 while attempting to remove from %2",_namePart,_nameType], "PLAIN DOWN"];
} else {
//Success!
cutText [format["You have successfully removed %1 from the %2",_namePart,_nameType], "PLAIN DOWN"];
};
} else {
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
};
};
} else {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
cutText ["Canceled Salvage.", "PLAIN DOWN"];
};
} else {
cutText [format["You need %1 to remove this part.",_namePart], "PLAIN DOWN"];
};
dayz_myCursorTarget = objNull;
s_player_repair_crtl = -1;
TradeInprogress = false;