Move unused functions to another folder

This commit is contained in:
AirwavesMan
2020-06-10 17:03:31 +02:00
parent 11f10829cb
commit ac79d91ca0
37 changed files with 185 additions and 250 deletions

View File

@@ -1,108 +0,0 @@
private ["_status","_array","_object","_items","_classname","_text","_build","_inside","_location","_nearObjects","_dis","_sfx","_variables","_ghost","_keepOnSlope","_direction","_passcode"];
_array = _this select 3;
_ghost = _array select 0;
_object = nil;
_items = _array select 1;
_classname = _array select 2;
_text = _array select 3;
_build = _array select 4;
_dis = _array select 5;
_sfx = _array select 6;
_uid = getPlayerUID player;
_keepOnSlope = 0 == (getNumber (configFile >> "CfgVehicles" >> _classname >> "canbevertical"));
//_damageArray = (getArray (configFile >> "CfgVehicles" >> _classname >> "damageValues"));
Dayz_constructionContext set [ 4, false ]; // Stop the construction mode, cf. player_build.sqf
//if (count Dayz_constructionContext < 5) then { Dayz_constructionContext set [ 5, false ]; // };
if (_build) then {
_location = getPosATL _ghost;
_direction = getDir _ghost;
_object = createVehicle [_classname, getMarkerpos "respawn_west", [], 0, "NONE"];
_object setDir _direction;
diag_log (Dayz_constructionContext);
if ((Dayz_constructionContext select 5) or (_keepOnSlope)) then {
_object setVectorUp surfaceNormal _location;
_location set [2,0];
} else {
_object setVectorUp [0,0,1];
if (_location select 2 == 0) then { _location set [2, -0.01]; };
};
deleteVehicle _ghost;
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
["Working",0,[20,40,15,0]] call dayz_NutritionSystem; // Added Nutrition-Factor for work
player playActionNow "Medic";
//wait animation end
waitUntil {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "disableWeapons") == 1};
waitUntil {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "disableWeapons") == 0};
_object setPosATL _location;
player reveal _object;
_variables = [];
if (_object iskindof "DZ_buildables") then {
_passcode = [floor(random 10),floor(random 10),floor(random 10),floor(random 10)];
_object setVariable ["ownerArray",[getPlayerUID player],true];
_object setVariable ["dayz_padlockCombination",_passcode,true];
_variables set [ count _variables, ["ownerArray", [getPlayerUID player]]];
_variables set [ count _variables, ["padlockCombination", _passcode]];
//_object removeAllEventHandlers "HandleDamage";
//_object addeventhandler ["HandleDamage",{ [_this,_damageArray] call fnc_Obj_FenceHandleDam; } ];
};
_object setVariable ["characterID",dayz_characterID, true];
if (_object isKindOf "TrapItems") then {
if (getNumber (configFile >> "CfgVehicles" >> typeOf _object >> "initState") > 0) then {
_object setVariable ["armed", true, true];
} else {
_object setVariable ["armed", false, true];
};
_variables set [ count _variables, ["armed", _object getVariable "armed"]];
};
/* //set fuel, Later use Generator
if (typeOf _object == "Generator_DZ") then {
diag_log format["Object: %1, Fuel: %2",_object,fuel _object];
if (local _object) then {
_object setFuel 0;
} else {
PVDZ_send = [_object,"SetFuel",[_object,0]];
publicVariableServer "PVDZ_send";
};
};
*/
_object setVariable ["characterID",dayz_characterID,true];
PVDZ_obj_Publish = [dayz_characterID,_object,[round _direction,_location],_variables,player,dayz_authKey];
publicVariableServer "PVDZ_obj_Publish";
diag_log [diag_ticktime, __FILE__, "New Networked object, request to save to hive. PVDZ_obj_Publish:", PVDZ_obj_Publish];
format[localize "str_build_01",_text] call dayz_rollingMessages;
} else {
if ((!isNil "_ghost") and {(!isNull _ghost)}) then { deleteVehicle _ghost; };
{
if (isClass (configFile >> "CfgMagazines" >> _x)) then {
player addMagazine _x;
};
} foreach _items;
format[localize "str_build_failed_02",_text] call dayz_rollingMessages;
};

View File

@@ -1,164 +0,0 @@
/*
This script is not part of dayz permission must be given to use. r4z0r49@gmail.com or skype me R4Z0R49.
Simple class system to use this script.
class Upgrade {
requiredTools[] = {"ItemToolbox"};
requiredParts[] = {"equip_crate","PartWoodPile"};
create = "TentStorage1";
};
*/
private ["_objclass","_cursorTarget","_item","_classname","_requiredTools","_requiredParts","_upgrade","_upgradeConfig",
"_upgradeDisplayname","_onLadder","_isWater","_upgradeParts","_startUpgrade","_missingPartsConfig","_textMissingParts","_dis",
"_sfx","_ownerID","_objectID","_objectUID","_dir","_weapons","_magazines","_backpacks",
"_object","_itemName","_vector","_finished"];
_cursorTarget = _this select 0;
if ((isNil "_cursorTarget") or {(isNull _cursorTarget)}) then {
_cursorTarget = nearestObjects [ player modelToWorld [0,1.5,0] , ["Land_Fire_DZ"], 1.5];
_cursorTarget = if (count _cursorTarget == 0) then { objNull } else { _cursorTarget select 0 };
};
if (isNull _cursorTarget) exitWith {};
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
_item = typeof _cursorTarget;
//remove action menu
player removeAction s_player_upgradestorage;
s_player_upgradestorage = -1;
//Not needed
//_itemName = getText (configFile >> "CfgVehicles" >> _item >> "displayName");
////diag_log (str(_itemName));
//Get tools needed
_classname = configFile >> "CfgVehicles" >> _item;
_requiredTools = getArray (_classname >> "Upgrade" >> "requiredTools");
//diag_log (str(_requiredTools));
//get parts needed
_requiredParts = getArray (_classname >> "Upgrade" >> "requiredParts");
//diag_log (str(_requiredParts));
//get item to create
_upgrade = getText (_classname >> "Upgrade" >> "create");
//diag_log (str(_upgrade));
//Display name of upgrade part
_upgradeConfig = configFile >> "CfgVehicles" >> _upgrade;
//diag_log (str(_upgradeConfig));
_upgradeDisplayname = getText (_upgradeConfig >> "displayName");
//diag_log (str(_upgradeDisplayname));
//Normal blocked stuff
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming;
_upgradeParts = [];
_startUpgrade = true;
if(_isWater or _onLadder) exitWith { localize "str_CannotUpgrade" call dayz_rollingMessages; dayz_actionInProgress = false; };
// lets check player has requiredTools for upgrade
{
if (!(_x IN items player)) exitWith {
_missingPartsConfig = configFile >> "CfgVehicles" >> _x;
_textMissingParts = getText (_missingPartsConfig >> "displayName");
//systemChat format["Missing %1 to upgrade storage.", _textMissingParts];
format [localize "str_missing_to_do_this", _textMissingParts] call dayz_rollingMessages;
_startUpgrade = false;
};
} count _requiredTools;
// lets check player has requiredParts for upgrade
{
if (!(_x IN magazines player)) exitWith {
_missingPartsConfig = configFile >> "CfgMagazines" >> _x;
_textMissingParts = getText (_missingPartsConfig >> "displayName");
//systemChat format["Missing %1 to upgrade storage.", _textMissingParts];
format [localize "str_missing_to_do_this", _textMissingParts] call dayz_rollingMessages;
_startUpgrade = false;
};
if (_x IN magazines player) then {
_upgradeParts set [count _upgradeParts, _x];
};
} count _requiredParts;
//Does object have a upgrade option.
if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
_dis = 20;
_sfx = "tentpack";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
//Double check player did not drop required parts
if (!_finished or (isNull _cursorTarget) or ({!(_x in magazines player)} count _upgradeParts > 0)) exitWith {};
// Added Nutrition-Factor for work
["Working",0,[100,15,5,0]] call dayz_NutritionSystem;
//get ownerID from old tent.
_ownerID = _cursorTarget getVariable ["characterID","0"];
_objectID = _cursorTarget getVariable ["ObjectID","0"];
_objectUID = _cursorTarget getVariable ["ObjectUID","0"];
//Get location and direction of old item
_dir = round getDir _cursorTarget;
_vector = [vectorDir _cursorTarget,vectorUp _cursorTarget];
//reset orientation before measuring position, otherwise the new object will be placed incorrectly. -foxy
_cursorTarget setDir 0;
_pos = getPosATL _cursorTarget;
if (abs(((_vector select 1) select 2) - 1) > 0.001) then { _pos set [2,0]; };
//get contents
_magazines = getMagazineCargo _cursorTarget;
deleteVehicle _cursorTarget;
// remove parts from players inventory before creation of new tent.
{
player removeMagazine _x;
_upgradeParts = _upgradeParts - [_x];
} count _upgradeParts;
//create new tent
_object = createVehicle [_upgrade, getMarkerpos "respawn_west", [], 0, "CAN_COLLIDE"];
//reseting orientation to make sure the object goes where it's supposed to -foxy
_object setDir 0;
_object setPosATL _pos;
_object setVectorDirAndUp _vector;
//set ownerID from old tent.
_object setVariable ["characterID",_ownerID];
//Make sure player knows about the new object
player reveal _object;
[[],_magazines,[],_object] call fn_addCargo;
//Light fire
[_object,true] call dayz_inflame;
_object spawn player_fireMonitor;
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir,_pos],[[[],[]],_magazines,[[],[]]],player,dayz_authKey];
publicVariableServer "PVDZ_obj_Publish";
diag_log [diag_ticktime, __FILE__, "New Networked object, request to save to hive. PVDZ_obj_Publish:", PVDZ_obj_Publish];
localize "str_upgradeDone" call dayz_rollingMessages;
/*
} else {
localize "str_upgradeNoOption" call dayz_rollingMessages;
*/
};
dayz_actionInProgress = false;

View File

@@ -1,288 +0,0 @@
private ["_classType","_item","_action","_missingTools","_missingItem","_emergingLevel","_isClass","_classname","_requiredTools",
"_requiredParts","_ghost","_text","_onLadder","_isWater","_object","_actionBuildHidden","_getBeams",
"_o","_offset","_rot","_r","_p","_bn","_bb","_h","_bx","_by","_minElevation","_maxElevation",
"_check","_min","_max","_objColliding","_a","_beams","_best","_b","_d","_checkNotBuried","_elevation","_position","_delta","_overElevation",
"_maxplanting","_safeDistance","_dir","_angleRef","_tmp","_actionCancel","_sfx","_actionBuild","_keepOnSlope","_msg",
"_ok","_missing","_upgradeParts","_posReference"];
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
call gear_ui_init;
closeDialog 1;
_item = _this select 0;
_action = _this select 1;
_classType = "ItemActions";
if (count _this > 2) then {
_classType = _this select 2;
};
_emergingLevel = 1.1;
_isClass = switch (1==1) do {
case (isClass (configFile >> "CfgMagazines" >> _item)): {"CfgMagazines"};
case (isClass (configFile >> "CfgWeapons" >> _item)): {"CfgWeapons"};
};
//need to swap all build systems to this "ItemActions"
_classname = getText (configFile >> _isClass >> _item >> _classType >> _action >> "create");
_requiredTools = getArray (configFile >> _isClass >> _item >> _classType >> _action >> "require");
_requiredParts = getArray (configFile >> _isClass >> _item >> _classType >> _action >> "consume");
_ghost = getText (configFile >> _isClass >> _item >> _classType >> _action >> "ghost");
if (_ghost == "") then { _ghost = _classname; };
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
_keepOnSlope = 0 == (getNumber (configFile >> "CfgVehicles" >> _classname >> "canbevertical"));
_onLadder = {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder") == 1};
_isWater = {(surfaceIsWater (getPosATL _object)) or dayz_isSwimming};
if (0 != count Dayz_constructionContext) exitWith {
dayz_actionInProgress = false;
localize "str_already_building" call dayz_rollingMessages;
};
_posReference = [player] call FNC_GetPos;
_canBuild = [_posReference, _item, false] call DZE_BuildChecks;
if !(_canBuild select 0) exitWith {dayz_actionInProgress = false;};
// lets check player has requiredTools for upgrade
_ok = true;
_missing = "";
{
if (!(_x IN items player)) exitWith {
//systemchat("Missing tools for upgrade." +str());
_missing = getText (configFile >> "CfgWeapons" >> _x >> "displayName");
_ok = false;
};
} count _requiredTools;
if (!_ok) exitWith {
dayz_actionInProgress = false;
//cutText [format [localize "str_player_31_missingtools",_text,_missing] , "PLAIN DOWN"];
_msg = format [localize "str_player_31_missingtools",_text,_missing];
_msg call dayz_rollingMessages;
};
// lets check player has requiredParts for upgrade
_ok = true;
_upgradeParts = [];
{
if (!(_x IN magazines player)) exitWith {
_missing = getText (configFile >> "CfgMagazines" >> _x >> "displayName");
_ok = false;
};
if (_x IN magazines player) then {
_upgradeParts set [count _upgradeParts, _x];
player removeMagazine _x;
};
} count _requiredParts;
if (!_ok) exitWith {
{ player addMagazine _x; } foreach _upgradeParts;
dayz_actionInProgress = false;
// cutText [format [localize "str_player_31", _missing, localize "str_player_31_build"] , "PLAIN DOWN"];
_msg = format [localize "str_player_31", _missing, localize "str_player_31_build"];
_msg call dayz_rollingMessages;
};
_msg = localize "str_player_build_rotate";
_msg call dayz_rollingMessages;
//Get fence beams based on model
_getBeams = {
private [ "_p", "_r", "_bn", "_bb", "_bx", "_by" ];
_o = _this select 0;
_offset = _this select 1;
_rot = _this select 2;
_r = [];
for "_bn" from 1 to 4 do {
_p = _o selectionPosition Format [ "beam%1", _bn ];
if (_p distance [0,0,0] == 0) exitWith {
if (_bn == 1) then { // no memory points defined
_bb = boundingBox _o;
_h = _offset + ((_o worldToModel (getPosATL _o)) select 2);
_p = [ (_bb select 0) select 0, 0, _h ];
_r set [ 0, _o modelToWorld _p];
_p = [ (_bb select 1) select 0, 0, _h ];
_r set [ 1, _o modelToWorld _p];
};
};
if (_rot != 0) then {
_bx = _p select 0;
_by = _p select 1;
_p set [0, (_bx * cos _rot) - (_by * sin _rot)];
_p set [1, (_bx * sin _rot) + (_by * cos _rot)];
};
_p set [2, (_p select 2) + _offset];
_r set [ count _r, _o modelToWorld _p];
};
_r
};
_minElevation = {
private "_r";
_r = 400;
{ _r = _r min (_x select 2); } count _this;
_r
};
_maxElevation = {
private "_r";
_r = -400;
{ _r = _r max (_x select 2); } count _this;
_r
};
_checkNotBuried = {
// lift up the object so that any beams are buried, but also don't lift further the planting level (straight placement only)
_elevation = _position select 2;
_delta = 0;
_overElevation = 0;
_beams = [_object, 0,0] call _getBeams;
if (_elevation < 0) then { _delta = -_elevation; }
else {
_overElevation = _beams call _minElevation;
if (_overElevation>0.05) then { // bury the object so that posATL is still positif and all beams are above the ground
_delta = - (_overElevation min _elevation);
};
if (_overElevation < -0.05) then { // lift up the object because a beam is burried
_delta = - _overElevation + 0.10;
};
};
_position set [ 2, _elevation + _delta ];
_maxplanting = _beams call _maxElevation;
// _maxplanting is the height of the emerging foundations, must not be so high because we don't want some "floating" foundations
};
_object = _ghost createVehicleLocal getMarkerpos "respawn_west";
_safeDistance = 0.5 + (sizeOf _ghost) * 0.5; // beware of hedgehogs
_dir = getDir player;
_object setDir _dir;
// ghost, angle, previous camera, build view on/off, continue on/off, slope on/off
Dayz_constructionContext = [_object, round (_dir/5)*5, cameraView, false, true, _keepOnSlope];
_posReference = getPosATL player;
_objColliding = objNull;
_best = [50,[0,0,0],[0,0,0]];
_maxplanting = 10;
_position = getPosATL _object;
_actionBuildHidden = true;
_actionCancel = player addAction [localize "str_player_build_cancel", "\z\addons\dayz_code\actions\object_build.sqf", [_object, _requiredParts, _classname, _text, false, 0, "none"], 1, true, true, "", "0 != count Dayz_constructionContext"];
while {Dayz_constructionContext select 4} do {
//Reset colliding Status
_objColliding = objNull;
// force the angle so that the ghost is showing always the same side
_angleRef=Dayz_constructionContext select 1;
_dir = _angleRef - (getDir player);
if (_dir > 180) then {_dir = _dir - 360};
if (_dir < -180) then {_dir = _dir + 360};
if (_dir < -75) then {
_angleRef = ceil(((getDir player) - 75)/5)*5;
Dayz_constructionContext set [ 1, _angleRef];
};
if (_dir > 75) then {
_angleRef = floor(((getDir player) + 75)/5)*5;
Dayz_constructionContext set [ 1, _angleRef];
};
// move object according to player position
if ((abs(([_object, player] call BIS_fnc_distance2D) - _safeDistance) > (if (_best select 0 < 0.50) then {0.50} else {0.05})) or (abs([player, _object] call BIS_fnc_relativeDirTo) > (if (_best select 0 < 0.50) then {5} else {1})) or (r_interrupt)) then {
r_interrupt = false;
_object setDir _angleRef;
_tmp = player modelToWorld [0, _safeDistance,0];
if ((Dayz_constructionContext select 5) or (_keepOnSlope)) then {
_tmp set [2, 0];
_object setVectorUp surfaceNormal _tmp;
} else {
_tmp set [2, _position select 2];
_object setVectorUp [0,0,1];
};
_position = +(_tmp);
_object setPosATL _position;
};
if (_best select 0 < 0.50) then {
_position = [
(_position select 0) + ((_best select 2) select 0) - ((_best select 1) select 0),
(_position select 1) + ((_best select 2) select 1) - ((_best select 1) select 1),
_position select 2
];
_object setPosATL _position;
};
if (Dayz_constructionContext select 5 or _keepOnSlope) then {
_maxplanting = 0;
_position set [2, 0];
} else {
// adjust the elevation of the object according to slope and beams to keep them visible (straight placement only)
call _checkNotBuried;
};
_object setPosATL _position;
if ((((vehicle player) != player or _posReference distance player > 20 or 0 != player getVariable["startcombattimer",0]) or {(!alive player)}) or {((call _onLadder) or {(call _isWater)})}) exitWith {
[[],[],[],[_object, _requiredParts , _classname, _text, false, 0, "none"]] call object_build;
};
//Quick Fix stop Tents/sandbags/tanktraps/wire being placed near an fence you dont own.
{
//Is Placeable closer then 5 to the fence.
if (_x distance _object < 5) exitWith {
//if player does not own fence set to block placeable.
if(_x getVariable ["ownerArray", [""]] select 0 != getPlayerUID player) then {
_objColliding = _x;
};
};
} foreach (nearestObjects [_object, ["DZ_buildables"], 6]);
if ((isNull _objColliding) and (_maxplanting <= _emergingLevel)) then {
if (_actionBuildHidden) then {
//Remove actions
_actionBuildHidden = false;
player removeAction _actionCancel;
_sfx = if (_object isKindOf "Land_A_tent") then {"tentunpack"} else {"repair"};
// placement is fine, enable "Build" in the menu
_actionBuild = player addAction [localize "str_player_build_complete", "\z\addons\dayz_code\actions\object_build.sqf", [_object, _requiredParts , _classname, _text, true, 20, _sfx], 1, true, true, "", "0 != count Dayz_constructionContext"];
_actionCancel = player addAction [localize "str_player_build_cancel", "\z\addons\dayz_code\actions\object_build.sqf", [_object, _requiredParts , _classname, _text, false, 0, "none"], 1, true, true, "", "0 != count Dayz_constructionContext"];
};
} else {
if (!_actionBuildHidden) then {
_actionBuildHidden = true;
player removeAction _actionBuild;
};
};
uiSleep 0.03;
};
if (!_actionBuildHidden) then { // player can't build until all is fine
_actionBuildHidden = true;
player removeAction _actionBuild;
};
player removeAction _actionCancel;
if (Dayz_constructionContext select 3) then {
// "build" camera was on, switch it off
call fn_buildCamera;
};
Dayz_constructionContext = [];
dayz_actionInProgress = false;
//systemChat "Dayz_constructionContext reset";

View File

@@ -1,386 +0,0 @@
// (c) facoptere@gmail.com, licensed to DayZMod for the community
private ["_classType","_item","_action","_missingTools","_missingItem","_emergingLevel","_isClass","_classname","_requiredTools",
"_requiredParts","_ghost","_placement","_text","_onLadder","_isWater","_object","_string","_actionBuildHidden","_getBeams",
"_o","_offset","_rot","_r","_p","_bn","_bb","_h","_bx","_by","_minElevation","_maxElevation","_insideCheck","_building",
"_unit","_bbb","_ubb","_check","_min","_max","_myX","_myY","_checkBuildingCollision","_objColliding","_inside","_checkOnRoad",
"_roadCollide","_checkBeam2Magnet","_a","_beams","_best","_b","_d","_checkNotBuried","_elevation","_position","_delta","_overElevation",
"_maxplanting","_safeDistance","_dir","_angleRef","_tmp","_actionCancel","_sfx","_actionBuild","_byPassChecks","_keepOnSlope","_msg",
"_isCollisionBypass","_ok","_missing","_upgradeParts","_ownerID","_posReference"];
/*
Needs a full rewrite to keep up with the demand of everything we plan to add.
*/
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
call gear_ui_init;
closeDialog 1;
_item = _this select 0;
_action = _this select 1;
_classType = "ItemActions";
//diag_log (_item);
if (count _this > 2) then {
_classType = _this select 2;
};
_emergingLevel = 1.1;
_isClass = switch (1==1) do {
case (isClass (configFile >> "CfgMagazines" >> _item)): {"CfgMagazines"};
case (isClass (configFile >> "CfgWeapons" >> _item)): {"CfgWeapons"};
};
//need to swap all build systems to this "ItemActions"
_classname = getText (configFile >> _isClass >> _item >> _classType >> _action >> "create");
_requiredTools = getArray (configFile >> _isClass >> _item >> _classType >> _action >> "require");
_requiredParts = getArray (configFile >> _isClass >> _item >> _classType >> _action >> "consume");
_ghost = getText (configFile >> _isClass >> _item >> _classType >> _action >> "ghost");
if (_ghost == "") then { _ghost = _classname; };
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
_keepOnSlope = 0 == (getNumber (configFile >> "CfgVehicles" >> _classname >> "canbevertical"));
_onLadder = {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder") == 1};
_isWater = {(surfaceIsWater (getPosATL _object)) or dayz_isSwimming};
if (0 != count Dayz_constructionContext) exitWith {
dayz_actionInProgress = false;
localize "str_already_building" call dayz_rollingMessages;
};
// item is missin - this really is pointless but it aint broke so dont fix it
if (isClass (configFile >> _isClass >> _item)) then {
if ((!(_item IN magazines player))) exitWith {
_string = switch true do {
case (_item isKindOf "Land_A_tent"): {"str_player_31_pitch"};
default {"str_player_31_build"};
};
//cutText [format [localize "str_player_31",_text,(localize _string)] , "PLAIN DOWN"];
_msg = format [localize "str_player_31",_text,(localize _string)];
_msg call dayz_rollingMessages;
//diag_log(format["player_build: item:%1 require:%2 Player items:%3 magazines:%4", _item, _requiredTools, (items player), (magazines player)]);
};
};
_posReference = [player] call FNC_GetPos;
_canBuild = [_posReference, _item, false] call DZE_BuildChecks;
if !(_canBuild select 0) exitWith {dayz_actionInProgress = false;};
// lets check player has requiredTools for upgrade
_ok = true;
_missing = "";
{
if (!(_x IN items player)) exitWith {
//systemchat("Missing tools for upgrade." +str());
_missing = getText (configFile >> "CfgWeapons" >> _x >> "displayName");
_ok = false;
};
} count _requiredTools;
if (!_ok) exitWith {
dayz_actionInProgress = false;
//cutText [format [localize "str_player_31_missingtools",_text,_missing] , "PLAIN DOWN"];
_msg = format [localize "str_player_31_missingtools",_text,_missing];
_msg call dayz_rollingMessages;
};
// lets check player has requiredParts for upgrade
_ok = true;
_upgradeParts = [];
{
if (!(_x IN magazines player)) exitWith {
_missing = getText (configFile >> "CfgMagazines" >> _x >> "displayName");
_ok = false;
};
if (_x IN magazines player) then {
_upgradeParts set [count _upgradeParts, _x];
player removeMagazine _x;
};
} count _requiredParts;
if (!_ok) exitWith {
{ player addMagazine _x; } foreach _upgradeParts;
dayz_actionInProgress = false;
// cutText [format [localize "str_player_31", _missing, localize "str_player_31_build"] , "PLAIN DOWN"];
_msg = format [localize "str_player_31", _missing, localize "str_player_31_build"];
_msg call dayz_rollingMessages;
};
_msg = localize "str_player_build_rotate";
_msg call dayz_rollingMessages;
//Get fence beams based on model
_getBeams = {
private [ "_p", "_r", "_bn", "_bb", "_bx", "_by" ];
_o = _this select 0;
_offset = _this select 1;
_rot = _this select 2;
_r = [];
for "_bn" from 1 to 4 do {
_p = _o selectionPosition Format [ "beam%1", _bn ];
if (_p distance [0,0,0] == 0) exitWith {
if (_bn == 1) then { // no memory points defined
_bb = boundingBox _o;
_h = _offset + ((_o worldToModel (getPosATL _o)) select 2);
_p = [ (_bb select 0) select 0, 0, _h ];
_r set [ 0, _o modelToWorld _p];
_p = [ (_bb select 1) select 0, 0, _h ];
_r set [ 1, _o modelToWorld _p];
};
};
if (_rot != 0) then {
_bx = _p select 0;
_by = _p select 1;
_p set [0, (_bx * cos _rot) - (_by * sin _rot)];
_p set [1, (_bx * sin _rot) + (_by * cos _rot)];
};
_p set [2, (_p select 2) + _offset];
_r set [ count _r, _o modelToWorld _p];
};
_r
};
_minElevation = {
private "_r";
_r = 400;
{ _r = _r min (_x select 2); } count _this;
_r
};
_maxElevation = {
private "_r";
_r = -400;
{ _r = _r max (_x select 2); } count _this;
_r
};
#define COLLIDABLE_OBJECT_MIN_SIZE 8
//check if building being placed and objects around placement is free to be built on.
//Fence owners must build all the foundations by one player anyone can still upgrade (pending lock build level)
_checkBuildingCollision =
{
scopeName "root";
_objColliding = objNull;
local _count = getNumber (configFile >> "CfgVehicles" >> _ghost >> "buildCollisionPoints");
if (_count == 0) exitWith {};
local _wall = _object isKindOf "DZ_buildables";
//Make sure no one can build within 6 meters of someone elses walls. Also block placement from anyone from the model origin.
if (_wall && {
local _result = false;
{
if (_x != _object && { _x distance _object < 1.5 || { _x getVariable ["ownerArray", [""]] select 0 != getPlayerUID player } } ) exitWith
{ _objColliding = _x; _result = true; };
} foreach (nearestObjects [_object, ["DZ_buildables"], 6]);
_result
}) exitWith {};
//Load object collision points
local _points = [];
_points resize _count;
for "_i" from 0 to _count - 1 do
{ _points set [_i, ATLtoASL (_object modelToWorld (_object selectionPosition format ["buildCollision%1", _i]))]; };
//Trace paths
{
local _p2 = _x select 0; //[0,1,3,2,0,3]
for "_i" from 1 to count _x - 1 do
{
local _p1 = _p2;
_p2 = _x select _i;
{
if (!_wall || { !(_x isKindOf "DZ_buildables" && { _x getVariable ["ownerArray", [""]] select 0 == getPlayerUID player }) }) then
{
local _type = typeof _x;
if (_type != "" && { sizeof _type >= COLLIDABLE_OBJECT_MIN_SIZE }) then
{
_objColliding = _x;
breakTo "root";
};
};
} foreach lineIntersectsWith [_points select _p1, _points select _p2, _object, player];
};
} foreach getArray (configFile >> "CfgVehicles" >> _ghost >> "buildCollisionPaths");
};
//Is placement on a road?
_checkOnRoad = {
_roadCollide = false;
{
_x set [2,0];
if (isOnRoad _x) exitWith { _roadCollide = true; };
} forEach ([_object, 0,0] call _getBeams);
_roadCollide
};
//Make the object attach to beams if it can
_checkBeam2Magnet = {
_a = [];
{
if ((!isNull _x) and (_x != _object)) then { _a = _a + ([_x, 0,0] call _getBeams); };
} forEach (nearestObjects [getPosATL _object, ["DZ_buildables"], 15]);
_beams = [_object, 0,0] call _getBeams;
_best = [50,[0,0,0],[0,0,0]];
{
_b = _x;
{
_d = [_x, _b] call BIS_fnc_distance2D;
if (_d < _best select 0) then {
_best = [_d,_b,_x];
};
} forEach _a;
} count _beams;
// _best contains the best beam to dock to. [ distance, coor of beam found around, coor of beam of ghost object ]
};
_checkNotBuried = {
// lift up the object so that any beams are buried, but also don't lift further the planting level (straight placement only)
_elevation = _position select 2;
_delta = 0;
_overElevation = 0;
_beams = [_object, 0,0] call _getBeams;
if (_elevation < 0) then { _delta = -_elevation; }
else {
_overElevation = _beams call _minElevation;
if (_overElevation>0.05) then { // bury the object so that posATL is still positif and all beams are above the ground
_delta = - (_overElevation min _elevation);
};
if (_overElevation < -0.05) then { // lift up the object because a beam is burried
_delta = - _overElevation + 0.10;
};
};
_position set [ 2, _elevation + _delta ];
_maxplanting = _beams call _maxElevation;
// _maxplanting is the height of the emerging foundations, must not be so high because we don't want some "floating" foundations
};
_object = _ghost createVehicleLocal getMarkerpos "respawn_west";
_safeDistance = 0.5 + (sizeOf _ghost) * 0.5; // beware of hedgehogs
_dir = getDir player;
_object setDir _dir;
Dayz_constructionContext = [_object, round (_dir/5)*5, cameraView, false, true, _keepOnSlope];
// ghost, angle, previous camera, build view on/off, continue on/off, slope on/off
_posReference = getPosATL player;
_objColliding = objNull;
_best = [50,[0,0,0],[0,0,0]];
_maxplanting = 10;
_position = getPosATL _object;
_actionBuildHidden = true;
_actionCancel = player addAction [localize "str_player_build_cancel", "\z\addons\dayz_code\actions\object_build.sqf", [_object, _requiredParts, _classname, _text, false, 0, "none"], 1, true, true, "", "0 != count Dayz_constructionContext"];
while {Dayz_constructionContext select 4} do {
// force the angle so that the ghost is showing always the same side
_angleRef=Dayz_constructionContext select 1;
_dir = _angleRef - (getDir player);
if (_dir > 180) then {_dir = _dir - 360};
if (_dir < -180) then {_dir = _dir + 360};
if (_dir < -75) then {
_angleRef = ceil(((getDir player) - 75)/5)*5;
Dayz_constructionContext set [ 1, _angleRef];
};
if (_dir > 75) then {
_angleRef = floor(((getDir player) + 75)/5)*5;
Dayz_constructionContext set [ 1, _angleRef];
};
// move object according to player position
if ((abs(([_object, player] call BIS_fnc_distance2D) - _safeDistance) > (if (_best select 0 < 0.50) then {0.50} else {0.05}))
or (abs([player, _object] call BIS_fnc_relativeDirTo) > (if (_best select 0 < 0.50) then {5} else {1})) or (r_interrupt)) then {
r_interrupt = false;
_object setDir _angleRef;
_tmp = player modelToWorld [0, _safeDistance,0];
if ((Dayz_constructionContext select 5) or (_keepOnSlope)) then {
_tmp set [2, 0];
_object setVectorUp surfaceNormal _tmp;
}
else {
_tmp set [2, _position select 2];
_object setVectorUp [0,0,1];
};
_position = +(_tmp);
_object setPosATL _position;
};
//Need to add config based bypass checks array.
call _checkBuildingCollision;
// try to dock a beam from current ghost to another beams nearby
call _checkBeam2Magnet;
if (_best select 0 < 0.50) then {
_position = [
(_position select 0) + ((_best select 2) select 0) - ((_best select 1) select 0),
(_position select 1) + ((_best select 2) select 1) - ((_best select 1) select 1),
_position select 2
];
_object setPosATL _position;
};
if (Dayz_constructionContext select 5 or _keepOnSlope) then {
_maxplanting = 0;
_position set [2, 0];
} else {
// adjust the elevation of the object according to slope and beams to keep them visible (straight placement only)
call _checkNotBuried;
};
_object setPosATL _position;
if ((((vehicle player) != player or _posReference distance player > 20 or 0 != player getVariable["startcombattimer",0]) or {(!alive player)}) or {((call _onLadder) or {(call _isWater)})}) exitWith {
[[],[],[],[_object, _requiredParts , _classname, _text, false, 0, "none"]] call object_build;
};
if (isNull _objColliding and _maxplanting <= _emergingLevel and !(call _checkOnRoad)) then {
// placement is fine, enable "Build" in the menu
if (_actionBuildHidden) then {
_actionBuildHidden = false;
player removeAction _actionCancel;
_sfx = if (_object isKindOf "Land_A_tent") then {"tentunpack"} else {"repair"};
_actionBuild = player addAction [localize "str_player_build_complete", "\z\addons\dayz_code\actions\object_build.sqf", [_object, _requiredParts , _classname, _text, true, 20, _sfx], 1, true, true, "", "0 != count Dayz_constructionContext"];
_actionCancel = player addAction [localize "str_player_build_cancel", "\z\addons\dayz_code\actions\object_build.sqf", [_object, _requiredParts , _classname, _text, false, 0, "none"], 1, true, true, "", "0 != count Dayz_constructionContext"];
};
} else {
if (!_actionBuildHidden) then {
_actionBuildHidden = true;
player removeAction _actionBuild;
};
};
uiSleep 0.03;
};
if (!_actionBuildHidden) then { // player can't build until all is fine
_actionBuildHidden = true;
player removeAction _actionBuild;
};
player removeAction _actionCancel;
if (Dayz_constructionContext select 3) then { // "build" camera was on, switch it off
call fn_buildCamera;
};
Dayz_constructionContext = [];
dayz_actionInProgress = false;
//systemChat "Dayz_constructionContext reset";

View File

@@ -1,71 +0,0 @@
/*
Created by Alby exclusively for DayZMod.
Please request permission to use/alter from Alby.
*/
private ["_items","_counts","_config","_isRecipe","_item","_index","_amount","_count","_entry","_input","_array","_overwrite","_i","_inputIndex","_inputItems"];
disableSerialization;
_array = _this select 0;
_items = _array select 0;
_counts = _array select 1;
_overwrite = [];
_config = configFile >> "CfgCrafting";
//diag_log (str(_this));
//diag_log format["Items: %1 Counts: %2 Config: %3", _items, _counts, _config];
for "_i" from 0 to ((count _config) - 1) do {
_entry = _config select _i;
_input = getArray (_entry >> "input");
//diag_log format["Recipe: %1 Input: %2", _entry, _input];
if (count _input > 0) then {
_isRecipe = true;
_inputIndex = 0;
{
//Check to see if _x is array of arrays
_inputItems = _x;
if (typeName (_x select 0) != "ARRAY") then {
_inputItems = [_x];
};
//Handles OR type of input
{
_item = _x select 0;
_index = _items find _item;
//diag_log format["Item: %1 Index: %2", _item, _index];
if (_index > -1) then {
_amount = _x select 2;
_count = _counts select _index;
//diag_log format["Amount: %1 Count: %2", _amount, _count];
if (_count >= _amount) then {
if (count _inputItems > 1) then {
_overwrite set [count _overwrite,[_inputIndex, [_item, _x select 1, _amount]]];
};
_isRecipe = true;
} else {
_isRecipe = false;
};
} else {
_isRecipe = false;
};
if (_isRecipe) exitWith {};
}forEach _inputItems;
if (!_isRecipe) exitWith {};
_inputIndex = _inputIndex + 1;
}forEach _input;
if (_isRecipe) exitWith {
//diag_log format["Items: %1 Recipe: %2", _this, _entry];
[_entry, _overwrite] call player_craftItemGUI;
};
};
};
//diag_log format["Exited with Items: %1", _array];

View File

@@ -1,193 +0,0 @@
/*
Created by r4z0r49 exclusively for DayZMod.
craft from rightclick options.
text = "Wooden Plank";
script = "spawn player_craftItem;";
requiretools[] = {"ItemHatchet"};
output[] = {{"ItemPlank","CfgMagazines",2}};
input[] = {{"ItemLog","CfgMagazines",1}};
failChance = 1;
*/
//diag_log("crafting system");
private ["_config","_input","_output","_required","_failChance","_hasInput","_availabeSpace","_classname","_isClass","_onLadder","_hasTools","_avail","_selection","_item","_amount","_itemName","_freeSlots","_slotType","_i","_j","_dis","_sfx","_finished"];
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
//diag_log(str(isnil "r_player_crafting"));
//Process has started
if( (animationState player) IN [ "ainvpknlmstpslaywrfldnon_medic" ]) exitwith {dayz_actionInProgress = false;};
//Config class of right click item
_classname = _this;
//diag_log (str(_classname));
//Check what class the item is.
_isClass = switch (1==1) do {
case (isClass (configFile >> "CfgMagazines" >> _classname)): {"CfgMagazines"};
case (isClass (configFile >> "CfgWeapons" >> _classname)): {"CfgWeapons"};
};
_config = (configFile >> _isClass >> _classname >> "ItemActions" >> "Crafting");
//Check for normal blocked systems
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if(!r_drag_sqf and !r_player_unconscious and !_onLadder) then {
_input = getArray (_config >> "input");
//diag_log (str(_input));
_output = getArray (_config >> "output");
//diag_log (str(_output));
_required = getArray (_config >> "requiretools");
//diag_log (str(_required));
_failChance = getNumber (_config >> "failChance");
//diag_log (str(_failChance));
// lets check player has requiredTools for upgrade
_hasTools = true;
{
if (_x == "ItemHatchet") then {
if (!("MeleeHatchet" in weapons player)) then {
if (!(DayZ_onBack == "MeleeHatchet")) then {
if (!(_x IN items player)) then {
systemChat format[localize "str_missing_to_do_this", _x];
_hasTools = false;
};
};
};
};
} count _required;
if (!_hasTools) exitwith {};
_hasInput = true;
{
private ["_avail"];
_selection = _x select 1;
_item = _x select 0;
_amount = _x select 2;
switch (_selection) do {
case "CfgWeapons":
{
_avail = {_x == _item} count weapons player;
};
case "CfgMagazines":
{
_avail = {_x == _item} count magazines player;
};
};
if (_avail < _amount) exitWith {
_hasInput = false;
_itemName = getText(configFile >> _selection >> _item >> "displayName");
format[localize "str_crafting_missing",(_amount - _avail),_itemName] call dayz_rollingMessages;
};
} forEach (_input);
if (_hasInput) then {
//Remove melee magazines (BIS_fnc_invAdd and BIS_fnc_invSlotsEmpty fix)
false call dz_fn_meleeMagazines;
_freeSlots = [player] call BIS_fnc_invSlotsEmpty;
{
_item = _x select 0;
_amount = _x select 2;
_slotType = [_item] call BIS_fnc_invSlotType;
for "_i" from 1 to _amount do {
for "_j" from 1 to (count _slotType) do {
if ((_slotType select _j) > 0) then {
_freeSlots set[_j, ((_freeSlots select _j) + (_slotType select _j))];
};
};
};
} forEach _input;
_availabeSpace = true;
{
_item = _x select 0;
_amount = _x select 2;
_slotType = [_item] call BIS_fnc_invSlotType;
for "_i" from 1 to _amount do {
for "_j" from 1 to (count _slotType) do {
if ((_slotType select _j) > 0) then {
_freeSlots set[_j, ((_freeSlots select _j) - (_slotType select _j))];
if (_freeSlots select _j < 0) exitWith {
_availabeSpace = false;
localize "str_crafting_space" call dayz_rollingMessages;
};
};
};
};
} forEach _output;
//uiSleep 1;
true call dz_fn_meleeMagazines;
if (_availabeSpace) then {
//player playActionNow "PutDown";
call gear_ui_init;
closeDialog 1;
_dis=20;
_sfx = if (_classname == "equip_rope") then {"bandage"} else {"chopwood"};
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (!_finished) exitWith {};
{
_item = _x select 0;
_amount = _x select 2;
for "_i" from 1 to _amount do {
_selection = _x select 1;
switch (_selection) do {
case "CfgWeapons":
{
player removeWeapon _item;
};
case "CfgMagazines":
{
player removeMagazine _item;
};
};
//uiSleep 0.1;
};
} forEach _input;
{
_item = _x select 0;
_selection = _x select 1;
_amount = _x select 2;
_itemName = getText(configFile >> _selection >> _item >> "displayName");
for "_i" from 1 to _amount do {
if (random 1 > _failChance) then {
switch (_selection) do {
case "CfgWeapons":
{
player addWeapon _item;
};
case "CfgMagazines":
{
player addMagazine _item;
};
case "CfgVehicles":
{
player addBackpack _item;
};
};
format[localize "str_crafting_success",_itemName] call dayz_rollingMessages;
//uiSleep 2;
} else {
format[localize "str_crafting_failed",_itemName] call dayz_rollingMessages;
//uiSleep 2;
};
};
} forEach _output;
};
};
};
dayz_actionInProgress = false;

View File

@@ -1,167 +0,0 @@
/*
Created by Alby exclusively for DayZMod.
Please request permission to use/alter from Alby.
*/
private ["_config","_input","_output","_required","_failChance","_hasInput","_availabeSpace","_overwrite","_nearByPile","_index","_entry","_nearByTable","_weaps","_mags","_objMagTypes","_objMagQty","_i","_obj","_return","_inArray","_avail","_selection","_item","_amount","_itemName","_freeSlots","_slotType","_j"];
disableSerialization;
["close"] call fn_updateCraftUI;
_config = _this select 0;
_overwrite = _this select 1;
_input = getArray (_config >> "input");
_output = getArray (_config >> "output");
_required = getArray (_config >> "required");
_failChance = getNumber (_config >> "failChance");
_nearByPile = nearestObjects [getPosATL player, ["SmallCraftTable_dz"], 3];
//diag_log (str(_this));
if (count _overwrite > 0) then {
{
_index = _x select 0;
_entry = _x select 1;
_input set [_index, _entry];
}forEach _overwrite;
};
if (count _nearByPile > 0) then {
//done from craftingtable (ground)
//diag_log ("Table");
_nearByTable = nearestObjects [getPosATL player, ["SmallCraftTable_dz"], 3];
if (count _nearByTable > 0) then {
_weaps = getWeaponCargo (_nearByTable select 0);
_mags = getMagazineCargo (_nearByTable select 0);
//Add Magazines
_objMagTypes = _mags select 0;
_objMagQty = _mags select 1;
//diag_log format["%1, %2",_objMagTypes,_objMagQty];
for "_i" from 0 to (count _objMagTypes - 1) do {
_obj = _objMagTypes select _i;
_index = [_return, _obj] call _inArray;
//diag_log format["MagName: %1, %2",_obj,_index];
};
_hasInput = true;
};
} else {
//done from player inventory
_hasInput = true;
{
private ["_avail"];
_selection = _x select 1;
_item = _x select 0;
_amount = _x select 2;
switch (_selection) do {
case "CfgWeapons":
{
_avail = {_x == _item} count weapons player;
};
case "CfgMagazines":
{
_avail = {_x == _item} count magazines player;
};
};
if (_avail < _amount) exitWith {
_hasInput = false;
_itemName = getText(configFile >> _selection >> _item >> "displayName");
format[localize "str_crafting_missing",(_amount - _avail),_itemName] call dayz_rollingMessages;
};
} forEach (_input + _required);
if (_hasInput) then {
//Remove melee magazines (BIS_fnc_invAdd and BIS_fnc_invSlotsEmpty fix)
false call dz_fn_meleeMagazines;
_freeSlots = [player] call BIS_fnc_invSlotsEmpty;
{
_item = _x select 0;
_amount = _x select 2;
_slotType = [_item] call BIS_fnc_invSlotType;
for "_i" from 1 to _amount do {
for "_j" from 1 to (count _slotType) do {
if ((_slotType select _j) > 0) then {
_freeSlots set[_j, ((_freeSlots select _j) + (_slotType select _j))];
};
};
};
} forEach _input;
_availabeSpace = true;
{
_item = _x select 0;
_amount = _x select 2;
_slotType = [_item] call BIS_fnc_invSlotType;
for "_i" from 1 to _amount do {
for "_j" from 1 to (count _slotType) do {
if ((_slotType select _j) > 0) then {
_freeSlots set[_j, ((_freeSlots select _j) - (_slotType select _j))];
if (_freeSlots select _j < 0) exitWith {
_availabeSpace = false;
localize "str_crafting_space" call dayz_rollingMessages;
};
};
};
};
} forEach _output;
true call dz_fn_meleeMagazines;
//uiSleep 1;
if (_availabeSpace) then {
player playActionNow "PutDown";
{
_item = _x select 0;
_amount = _x select 2;
for "_i" from 1 to _amount do {
_selection = _x select 1;
switch (_selection) do {
case "CfgWeapons":
{
player removeWeapon _item;
};
case "CfgMagazines":
{
player removeMagazine _item;
};
};
//uiSleep 0.1;
};
} forEach _input;
{
_item = _x select 0;
_selection = _x select 1;
_amount = _x select 2;
_itemName = getText(configFile >> _selection >> _item >> "displayName");
for "_i" from 1 to _amount do {
if (random 1 > _failChance) then {
switch (_selection) do {
case "CfgWeapons":
{
player addWeapon _item;
};
case "CfgMagazines":
{
player addMagazine _item;
};
case "CfgVehicles":
{
player addBackpack _item;
};
};
format[localize "str_crafting_success",_itemName] call dayz_rollingMessages;
//uiSleep 2;
} else {
format[localize "str_crafting_failed",_itemName] call dayz_rollingMessages;
//uiSleep 2;
};
};
} forEach _output;
};
};
};

View File

@@ -1,33 +0,0 @@
private ["_qty_quivers","_control","_qty_quiverarrows","_empty","_emptymagslotcount"];
disableSerialization;
call gear_ui_init;
_qty_quivers = {_x == "12Rnd_Quiver_Wood"} count magazines player;
_control = uiNamespace getVariable 'uiControl';
_qty_quiverarrows = gearSlotAmmoCount _control;
//Remove melee magazines (BIS_fnc_invAdd fix) (add new melee ammo to array if needed)
{player removeMagazines _x} forEach ["Hatchet_Swing","Crowbar_Swing","Machete_Swing","Fishing_Swing"];
_empty = [player] call BIS_fnc_invSlotsEmpty;
_emptymagslotcount = _empty select 4; //empty magazines slots
if (_qty_quivers > 1) exitWith { localize "str_quiver_reachlimit" call dayz_rollingMessages;};
if (_qty_quiverarrows == 2) then { //remove 12Rnd_Quiver_Wood - add 2 arrows
if (_emptymagslotcount > 0) then {
player removeMagazine "12Rnd_Quiver_Wood";
player addMagazine "1Rnd_Arrow_Wood";
player addMagazine "1Rnd_Arrow_Wood";
} else {
localize "str_player_24" call dayz_rollingMessages; //Error
};
} else {
if (_emptymagslotcount > 0) then {
player removeMagazine "12Rnd_Quiver_Wood";
player addMagazine "1Rnd_Arrow_Wood";
player addMagazine ["12Rnd_Quiver_Wood",_qty_quiverarrows-1];
} else {
localize "str_player_24" call dayz_rollingMessages; //Error
};
};