Replace forEach with Count

Use count where you do not need _forEachIndex variable, it's quicker
than forEach.
This commit is contained in:
icomrade
2014-05-27 15:37:57 -04:00
parent 91d246e64e
commit e54b9983dd
210 changed files with 890 additions and 890 deletions

View File

@@ -13,7 +13,7 @@ _magazines = getArray (configFile >> "cfgWeapons" >> _weapon >> "magazines");
if (_ammoType == "") then {_ammoType = _x;};
if (!(_ammoType in _text)) then {_text set [count _text,_ammoType];};
if (_x in magazines player) exitWith {_ammo = _x;};
} forEach _magazines;
} count _magazines;
if (_ammo != "") then {
_vehicle removeMagazineTurret [_ammo,_turret];
_vehicle addMagazineTurret [_ammo,_turret];

View File

@@ -13,7 +13,7 @@ _hastinitem = false;
_hastinitem = true;
};
} forEach boil_tin_cans;
} count boil_tin_cans;
_bottletext = getText (configFile >> "CfgMagazines" >> "ItemWaterbottle" >> "displayName");
_tin1text = getText (configFile >> "CfgMagazines" >> "TrashTinCan" >> "displayName");
@@ -24,7 +24,7 @@ if (!_hastinitem) exitWith {DZE_ActionInProgress = false; cutText [format[(local
_removed = 0;
if (_hasbottleitem and _hastinitem) then {
if (_hasbottleitem && _hastinitem) then {
_qty = {_x == "ItemWaterbottle"} count magazines player;
if ("ItemWaterbottle" in magazines player) then {

View File

@@ -12,22 +12,22 @@ _maxWeapons = getNumber (configFile >> "CfgVehicles" >> _class >> "transportMaxW
// Get max backpack count
_maxBackpacks = getNumber (configFile >> "CfgVehicles" >> _class >> "transportmaxbackpacks");
// Count and show magazines available space
// Count && show magazines available space
_magazineCount_raw = getMagazineCargo _vehicle;
// Count and show weapons available space
// Count && show weapons available space
_weaponsCount_raw = getWeaponCargo _vehicle;
// Count and show backpacks available space
// Count && show backpacks available space
_backpackCount_raw = getBackpackCargo _vehicle;
// Count and show magazines available space
// Count && show magazines available space
_magazineCount = (_magazineCount_raw select 1) call vehicle_gear_count;
// Count and show weapons available space
// Count && show weapons available space
_weaponsCount = (_weaponsCount_raw select 1) call vehicle_gear_count;
// Count and show weapons available space
// Count && show weapons available space
_backpackCount = (_backpackCount_raw select 1) call vehicle_gear_count;
cutText [format[(localize "str_epoch_player_1"),_magazineCount,_maxMagazines,_weaponsCount,_maxWeapons,_backpackCount,_maxBackpacks], "PLAIN DOWN"];

View File

@@ -43,7 +43,7 @@ _cookedmeat = meatcooked;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -74,7 +74,7 @@ _cookedmeat = meatcooked;
cutText [format[(localize "str_epoch_player_130"),_textraw], "PLAIN DOWN"];
};
};
} forEach _rawmeat;
} count _rawmeat;
s_player_cook = -1;
DZE_ActionInProgress = false;

View File

@@ -7,7 +7,7 @@ if (_dikCode in[0x02,0x03,0x04,0x58,0x57,0x44,0x43,0x42,0x41,0x40,0x3F,0x3E,0x3D
_handled = true;
};
if ((_dikCode == 0x3E or _dikCode == 0x0F or _dikCode == 0xD3)) then {
if ((_dikCode == 0x3E || _dikCode == 0x0F || _dikCode == 0xD3)) then {
if(diag_tickTime - dayz_lastCheckBit > 10) then {
dayz_lastCheckBit = diag_tickTime;
call dayz_forceSave;
@@ -31,9 +31,9 @@ if (_dikCode in actionKeys "Surrender") then {
_vehicle = vehicle player;
_inVehicle = (_vehicle != player);
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder and !_inVehicle);
_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder && !_inVehicle);
if (_canDo and !DZE_Surrender and !(player isKindOf "PZombie_VB")) then {
if (_canDo && !DZE_Surrender && !(player isKindOf "PZombie_VB")) then {
DZE_Surrender = true;
_dropPrimary = false;
_dropSecondary = false;
@@ -45,10 +45,10 @@ if (_dikCode in actionKeys "Surrender") then {
if ((getNumber (configFile >> "CfgWeapons" >> _x >> "Type")) == 2) exitWith {
_secondaryWeapon = _x;
};
} forEach (weapons player);
} count (weapons player);
if (_secondaryWeapon != "") then {_dropSecondary = true;};
if (_dropPrimary or _dropSecondary) then {
if (_dropPrimary || _dropSecondary) then {
player playActionNow "PutDown";
_iPos = getPosATL player;
_radius = 1;
@@ -85,15 +85,15 @@ if (_dikCode in actionKeys "MoveRight") exitWith {r_interrupt = true; if (DZE_Su
if (_dikCode in actionKeys "MoveBack") exitWith {r_interrupt = true; if (DZE_Surrender) then {call dze_surrender_off};};
//Prevent exploit of drag body
if ((_dikCode in actionKeys "Prone") and r_drag_sqf) exitWith { force_dropBody = true; };
if ((_dikCode in actionKeys "Crouch") and r_drag_sqf) exitWith { force_dropBody = true; };
if ((_dikCode in actionKeys "Prone") && r_drag_sqf) exitWith { force_dropBody = true; };
if ((_dikCode in actionKeys "Crouch") && r_drag_sqf) exitWith { force_dropBody = true; };
_shift = _this select 2;
_ctrl = _this select 3;
_alt = _this select 4;
//diag_log format["Keypress: %1", _this];
if ((_dikCode in actionKeys "Gear") and (vehicle player != player) and !_shift and !_ctrl and !_alt && !dialog) then {
if ((_dikCode in actionKeys "Gear") && (vehicle player != player) && !_shift && !_ctrl && !_alt && !dialog) then {
createGearDialog [player, "RscDisplayGear"];
_handled = true;
};
@@ -117,59 +117,59 @@ if (_dikCode in (actionKeys "GetOver")) then {
};
};
//if (_dikCode == 57) then {_handled = true}; // space
//if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
//if (_dikCode in actionKeys 'MoveForward' || _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
if (_dikCode == 210) then {
_nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
};
if (_dikCode in actionKeys "ForceCommandingMode") then {_handled = true};
if (_dikCode in actionKeys "PushToTalk" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
if (_dikCode in actionKeys "PushToTalk" && (diag_tickTime - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = diag_tickTime;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "VoiceOverNet" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
if (_dikCode in actionKeys "VoiceOverNet" && (diag_tickTime - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = diag_tickTime;
[player,50,true,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "PushToTalkDirect" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
if (_dikCode in actionKeys "PushToTalkDirect" && (diag_tickTime - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = diag_tickTime;
[player,15,false,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "Chat" and (diag_tickTime - dayz_lastCheckBit > 10)) then {
if (_dikCode in actionKeys "Chat" && (diag_tickTime - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = diag_tickTime;
[player,15,false,(getPosATL player)] spawn player_alertZombies;
};
if (_dikCode in actionKeys "User20" and (diag_tickTime - dayz_lastCheckBit > 5)) then {
if (_dikCode in actionKeys "User20" && (diag_tickTime - dayz_lastCheckBit > 5)) then {
dayz_lastCheckBit = diag_tickTime;
_nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
};
// numpad 8 0x48 now pgup 0xC9 1
if ((_dikCode == 0xC9 and (!_alt or !_ctrl)) or (_dikCode in actionKeys "User15")) then {
if ((_dikCode == 0xC9 && (!_alt || !_ctrl)) || (_dikCode in actionKeys "User15")) then {
DZE_Q = true;
};
// numpad 2 0x50 now pgdn 0xD1
if ((_dikCode == 0xD1 and (!_alt or !_ctrl)) or (_dikCode in actionKeys "User16")) then {
if ((_dikCode == 0xD1 && (!_alt || !_ctrl)) || (_dikCode in actionKeys "User16")) then {
DZE_Z = true;
};
// numpad 8 0x48 now pgup 0xC9 0.1
if ((_dikCode == 0xC9 and (_alt and !_ctrl)) or (_dikCode in actionKeys "User13")) then {
if ((_dikCode == 0xC9 && (_alt && !_ctrl)) || (_dikCode in actionKeys "User13")) then {
DZE_Q_alt = true;
};
// numpad 2 0x50 now pgdn 0xD1
if ((_dikCode == 0xD1 and (_alt and !_ctrl)) or (_dikCode in actionKeys "User14")) then {
if ((_dikCode == 0xD1 && (_alt && !_ctrl)) || (_dikCode in actionKeys "User14")) then {
DZE_Z_alt = true;
};
// numpad 8 0x48 now pgup 0xC9 0.01
if ((_dikCode == 0xC9 and (!_alt and _ctrl)) or (_dikCode in actionKeys "User7")) then {
if ((_dikCode == 0xC9 && (!_alt && _ctrl)) || (_dikCode in actionKeys "User7")) then {
DZE_Q_ctrl = true;
};
// numpad 2 0x50 now pgdn 0xD1
if ((_dikCode == 0xD1 and (!_alt and _ctrl)) or (_dikCode in actionKeys "User8")) then {
if ((_dikCode == 0xD1 && (!_alt && _ctrl)) || (_dikCode in actionKeys "User8")) then {
DZE_Z_ctrl = true;
};
@@ -177,15 +177,15 @@ if ((_dikCode == 0xD1 and (!_alt and _ctrl)) or (_dikCode in actionKeys "User8")
// numpad 4 0x4B now Q 0x10
if (_dikCode == 0x10 or (_dikCode in actionKeys "User17")) then {
if (_dikCode == 0x10 || (_dikCode in actionKeys "User17")) then {
DZE_4 = true;
};
// numpad 6 0x4D now E 0x12
if (_dikCode == 0x12 or (_dikCode in actionKeys "User18")) then {
if (_dikCode == 0x12 || (_dikCode in actionKeys "User18")) then {
DZE_6 = true;
};
// numpad 5 0x4C now space 0x39
if (_dikCode == 0x39 or (_dikCode in actionKeys "User19")) then {
if (_dikCode == 0x39 || (_dikCode in actionKeys "User19")) then {
DZE_5 = true;
};

View File

@@ -18,7 +18,7 @@ switch (_type) do {
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
_removed = _removed + ([player,_x] call BIS_fnc_invRemove);
};
} forEach magazines player;
} count magazines player;
if(_removed == _countIn) then {
_handle setFSMVariable ["_hunger",0];
player removeAction s_player_feeddog;

View File

@@ -6,7 +6,7 @@ _handle setFSMVariable ["_command","stay"];
_watchDog = _handle getFSMVariable "_watchDog";
_anim = animationState _dog;
if (_anim == "Dog_SitDown" and _watchDog) then {
if (_anim == "Dog_SitDown" && _watchDog) then {
//[objNull, _dog, rSwitchMove,"Dog_SitUp"] call RE;
//sleep 0.5;
[objNull, _dog, rSwitchMove,"Dog_LieDown"] call RE;

View File

@@ -12,7 +12,7 @@ _handle setFSMVariable ["_watchDog",_watchDog];
_warn = {
private ["_watchDog","_dog","_nearby","_senseSkill","_handle"];
_handle = _this select 0;
while {_watchDog and alive _dog} do {
while {_watchDog && alive _dog} do {
_watchDog = _handle getFSMVariable "_watchDog";
_senseSkill = _handle getFSMVariable "_senseSkill";
if (_watchDog) then {

View File

@@ -9,7 +9,7 @@ _vehicleSrc = _this select 3;
if(!(isNull _vehicleSrc)) then {
_isVehicle = ((_vehicleSrc isKindOf "AllVehicles") and !(_vehicleSrc isKindOf "Man"));
_isVehicle = ((_vehicleSrc isKindOf "AllVehicles") && !(_vehicleSrc isKindOf "Man"));
// If fuel source is vehicle get actual capacity
_configSrcVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicleSrc);
_capacitySrc = getNumber(_configSrcVeh >> "fuelCapacity");
@@ -21,10 +21,10 @@ _findNearestVehicles = nearestObjects [player, ["AllVehicles"], 30];
_findNearestVehicle = [];
{
//diag_log ("FILL = " + str(_x) + " = " + str(_vehicleSrc));
if (alive _x and !(_x == _vehicleSrc) and !(_x isKindOf "Man")) exitWith {
if (alive _x && !(_x == _vehicleSrc) && !(_x isKindOf "Man")) exitWith {
_findNearestVehicle set [(count _findNearestVehicle),_x];
};
} foreach _findNearestVehicles;
} count _findNearestVehicles;
_IsNearVehicle = count (_findNearestVehicle);
@@ -67,7 +67,7 @@ if(_IsNearVehicle >= 1) then {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};

View File

@@ -29,7 +29,7 @@ while {r_doLoop} do {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -50,9 +50,9 @@ if(!_finished) then {
};
if (_finished) then {
// take jerry can and replace with empty
// take jerry can && replace with empty
if(!(_vehicle getVariable ["GeneratorFilled", false]) and ("ItemJerrycan" in magazines player)) then {
if(!(_vehicle getVariable ["GeneratorFilled", false]) && ("ItemJerrycan" in magazines player)) then {
if(([player,"ItemJerrycan"] call BIS_fnc_invRemove) == 1) then {
player addMagazine "ItemJerrycanEmpty";

View File

@@ -14,7 +14,7 @@ dayz_hasLight = true;
_text = getText (configFile >> "CfgAmmo" >> (typeOf _flare) >> "displayName");
s_player_dropflare = player addAction [format[localize "str_actions_medical_16",_text], "\z\addons\dayz_code\actions\flare_drop.sqf",_flare, 1, false, true, "", ""];
while {(alive _flare) and dayz_hasLight} do {
while {(alive _flare) && dayz_hasLight} do {
sleep 0.1;
};
if (dayz_hasLight) then {

View File

@@ -13,7 +13,7 @@ _type = typeOf _item;
_hasHarvested = _item getVariable["meatHarvested",false];
_config = configFile >> "CfgSurvival" >> "Meat" >> _type;
if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
if ((_hasKnife || _hasKnifeBlunt) && !_hasHarvested) then {
//Get Animal Type
_isListed = isClass (_config);
_text = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
@@ -37,7 +37,7 @@ if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -60,7 +60,7 @@ if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
_hasHarvested = _item getVariable["meatHarvested",false];
if(_finished and !_hasHarvested) then {
if(_finished && !_hasHarvested) then {
_item setVariable["meatHarvested",true,true];

View File

@@ -13,7 +13,7 @@ _type = typeOf _item;
_hasHarvested = _item getVariable["meatHarvested",false];
//_config = configFile >> "CfgSurvival" >> "Meat" >> _type;
if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
if ((_hasKnife || _hasKnifeBlunt) && !_hasHarvested) then {
//Get Animal Type
//_loop = true;
//_isListed = isClass (_config);
@@ -38,7 +38,7 @@ if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -61,7 +61,7 @@ if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
_hasHarvested = _item getVariable["meatHarvested",false];
if(_finished and !_hasHarvested) then {
if(_finished && !_hasHarvested) then {
_item setVariable["meatHarvested",true,true];

View File

@@ -4,7 +4,7 @@ _vehicle = _this select 3;
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_32") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;
{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
{player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
s_player_lockUnlock_crtl = 1;
_removed = ([player,"ItemHotwireKit",1] call BIS_fnc_invRemove);

View File

@@ -12,10 +12,10 @@ _abort = false;
_fuelCans = [];
{
if(_x == "ItemJerrycanEmpty" or _x == "ItemFuelBarrelEmpty") then {
if(_x == "ItemJerrycanEmpty" || _x == "ItemFuelBarrelEmpty") then {
_fuelCans set [(count _fuelCans),_x];
};
} forEach magazines player;
} count magazines player;
_qty = count _fuelCans;
@@ -29,7 +29,7 @@ _qty = count _fuelCans;
[1,1] call dayz_HungerThirst;
// force animation
player playActionNow "Medic";
// Play sound and alert zombies
// Play sound && alert zombies
_dis=10;
_sfx = "refuel";
@@ -48,7 +48,7 @@ _qty = count _fuelCans;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -85,7 +85,7 @@ _qty = count _fuelCans;
sleep 1;
if(_abort) exitWith {};
} forEach _fuelCans;
} count _fuelCans;
s_player_fillfuel = -1;
DZE_ActionInProgress = false;

View File

@@ -4,7 +4,7 @@ _vehicle = _this select 3;
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_37") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;
{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
{player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
s_player_lockUnlock_crtl = 1;
PVDZE_veh_Lock = [_vehicle,true];

View File

@@ -1,4 +1,4 @@
//Code developed by Axe Cop - Massiv improvments and performance tunes by Skaronator
//Code developed by Axe Cop - Massiv improvments && performance tunes by Skaronator
private ["_missing","_missingQty","_proceed","_itemIn","_countIn","_qty","_num_removed","_uniqueID","_removed","_removed_total","_tobe_removed_total","_obj","_objectID","_objectUID","_classname","_location","_dir","_objectCharacterID","_object","_temp_removed_array","_textMissing","_target","_objectClasses","_range","_objects","_requirements","_count","_cost","_itemText","_option"];
if (DZE_ActionInProgress) exitWith { cutText [(localize "STR_EPOCH_ACTIONS_2") , "PLAIN DOWN"]; };
@@ -21,7 +21,7 @@ _objects_filtered = [];
if (damage _x >= DZE_DamageBeforeMaint) then {
_objects_filtered set [count _objects_filtered, _x];
};
} forEach _objects;
} count _objects;
_objects = _objects_filtered;
// TODO dynamic requirements based on used building parts?
@@ -66,7 +66,7 @@ switch _option do {
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} forEach _requirements;
} count _requirements;
if (_proceed) then {
player playActionNow "Medic";
@@ -91,8 +91,8 @@ switch _option do {
_temp_removed_array set [count _temp_removed_array,_x];
};
};
} forEach magazines player;
} forEach _requirements;
} count magazines player;
} count _requirements;
// all required items removed from player gear
if (_tobe_removed_total == _removed_total) then {
@@ -100,7 +100,7 @@ switch _option do {
PVDZE_maintainArea = [player,1,_target];
publicVariableServer "PVDZE_maintainArea";
} else {
{player addMagazine _x;} forEach _temp_removed_array;
{player addMagazine _x;} count _temp_removed_array;
cutText [format[(localize "STR_EPOCH_ACTIONS_5"),_removed_total,_tobe_removed_total], "PLAIN DOWN"];
};
} else {
@@ -115,10 +115,10 @@ switch _option do {
_countIn = _x select 1;
_itemText = getText(configFile >> "CfgMagazines" >> _itemIn >> "displayName");
if (_cost != "") then {
_cost = _cost + " and ";
_cost = _cost + " && ";
};
_cost = _cost + (str(_countIn) + " of " + _itemText);
} forEach _requirements;
} count _requirements;
cutText [format[(localize "STR_EPOCH_ACTIONS_7"), _count, _cost], "PLAIN DOWN"];
};
};

View File

@@ -80,7 +80,7 @@ _needNear = getArray (configFile >> "CfgMagazines" >> _item >> "ItemActions" >>
};
};
};
} forEach _needNear;
} count _needNear;
if(_abort) exitWith {
@@ -132,24 +132,24 @@ _findNearestPole = [];
if (alive _x) then {
_findNearestPole set [(count _findNearestPole),_x];
};
} foreach _findNearestPoles;
} count _findNearestPoles;
_IsNearPlot = count (_findNearestPole);
// If item is plot pole and another one exists within 45m
if(_isPole and _IsNearPlot > 0) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_44") , "PLAIN DOWN"]; };
// If item is plot pole && another one exists within 45m
if(_isPole && _IsNearPlot > 0) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_44") , "PLAIN DOWN"]; };
if(_IsNearPlot == 0) then {
// Allow building of plot
if(_requireplot == 0 or _isLandFireDZ) then {
if(_requireplot == 0 || _isLandFireDZ) then {
_canBuildOnPlot = true;
};
} else {
// Since there are plots nearby we check for ownership and then for friend status
// Since there are plots nearby we check for ownership && then for friend status
// check nearby plots ownership and then for friend status
// check nearby plots ownership && then for friend status
_nearestPole = _findNearestPole select 0;
// Find owner
@@ -184,7 +184,7 @@ _hasrequireditem = true;
{
_hastoolweapon = _x in weapons player;
if(!_hastoolweapon) exitWith { _hasrequireditem = false; _missing = getText (configFile >> "cfgWeapons" >> _x >> "displayName"); }
} forEach _require;
} count _require;
_hasbuilditem = _this in magazines player;
if (!_hasbuilditem) exitWith {DZE_ActionInProgress = false; cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]; };
@@ -301,7 +301,7 @@ if (_hasrequireditem) then {
_object setDir (getDir _object);
if((_isAllowedUnderGround == 0) and ((_position select 2) < 0)) then {
if((_isAllowedUnderGround == 0) && ((_position select 2) < 0)) then {
_position set [2,0];
};
@@ -337,7 +337,7 @@ if (_hasrequireditem) then {
if(abs(_objHDiff) > 5) exitWith {
_isOk = false;
_cancel = true;
_reason = "Cannot move up or down more than 5 meters";
_reason = "Cannot move up || down more than 5 meters";
detach _object;
deleteVehicle _object;
};
@@ -379,7 +379,7 @@ if (_hasrequireditem) then {
// Get position based on object
_location = _position;
if((_isAllowedUnderGround == 0) and ((_location select 2) < 0)) then {
if((_isAllowedUnderGround == 0) && ((_location select 2) < 0)) then {
_location set [2,0];
};
@@ -424,11 +424,11 @@ if (_hasrequireditem) then {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt or (player getVariable["combattimeout", 0] >= time)) then {
if (r_interrupt || (player getVariable["combattimeout", 0] >= time)) then {
r_doLoop = false;
};
if (DZE_cancelBuilding) exitWith {

View File

@@ -21,7 +21,7 @@ _findNearestPole = [];
if (alive _x) then {
_findNearestPole set [(count _findNearestPole),_x];
};
} foreach _findNearestPoles;
} count _findNearestPoles;
_IsNearPlot = count (_findNearestPole);
@@ -31,7 +31,7 @@ if(_IsNearPlot == 0) then {
_canBuildOnPlot = true;
} else {
// check nearby plots ownership and then for friend status
// check nearby plots ownership && then for friend status
_nearestPole = _findNearestPole select 0;
// Find owner
@@ -110,7 +110,7 @@ if ((count _upgrade) > 0) then {
if (_abortInvAdd) exitWith {};
} forEach _refund;
} count _refund;
// all parts added proceed
if(_i != 0) then {
@@ -150,7 +150,7 @@ if ((count _upgrade) > 0) then {
cutText [format[(localize "str_epoch_player_143"), _i,(getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName"))], "PLAIN DOWN"];
{
[player,(_x select 0),(_x select 1)] call BIS_fnc_invRemove;
} forEach _addedItems;
} count _addedItems;
};

View File

@@ -45,7 +45,7 @@ _proceed = true;
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} forEach _requirements;
} count _requirements;
if (_proceed) then {
[1,1] call dayz_HungerThirst;
@@ -73,9 +73,9 @@ if (_proceed) then {
};
};
} forEach magazines player;
} count magazines player;
} forEach _requirements;
} count _requirements;
// all parts removed proceed
if (_tobe_removed_total == _removed_total) then {
@@ -86,7 +86,7 @@ if (_proceed) then {
} else {
{player addMagazine _x;} forEach _temp_removed_array;
{player addMagazine _x;} count _temp_removed_array;
cutText [format[(localize "str_epoch_player_145"),_removed_total,_tobe_removed_total], "PLAIN DOWN"];
};

View File

@@ -42,7 +42,7 @@ while {r_doLoop} do {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};

View File

@@ -1,6 +1,6 @@
/*
count player magazines with ammo count
value = call player_countMagazines; //must be called from a spawned thread (or use spawn)
value = call player_countMagazines; //must be called from a spawned thread (|| use spawn)
return all player magazines with ammo count
Modified to save backpack magazine count by icomrade - Base for fix by Ziellos2k
*/

View File

@@ -1,6 +1,6 @@
/*
DayZ Epoch Crafting 0.3
Made for DayZ Epoch and Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
Made for DayZ Epoch && Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
Thanks to thevisad for help with the spawn call fixes.
USAGE EXAMPLE:
@@ -9,7 +9,7 @@ class ItemActions
class Crafting
{
text = "Craft Tent";
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; // [Class of itemaction,CfgMagazines or CfgWeapons, item]
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; // [Class of itemaction,CfgMagazines || CfgWeapons, item]
neednearby[] = {"workshop","fire"};
requiretools[] = {"ItemToolbox","ItemKnife"}; // (cfgweapons only)
output[] = {{"ItemTent",1}}; // (CfgMagazines, qty)
@@ -39,7 +39,7 @@ _reason = "";
_waterLevel = 0;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
// Need Near Requirements
_needNear = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "neednearby");
@@ -95,7 +95,7 @@ if (_canDo) then {
{
_hastoolweapon = _x in weapons player;
if(!_hastoolweapon) exitWith { _craft_doLoop = false; _missingTools = true; _missing = _x; };
} forEach _selectedRecipeTools;
} count _selectedRecipeTools;
if(!_missingTools) then {
@@ -111,7 +111,7 @@ if (_canDo) then {
if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} forEach _selectedRecipeInput;
} count _selectedRecipeInput;
};
// If all parts proceed
@@ -137,7 +137,7 @@ if (_canDo) then {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -173,7 +173,7 @@ if (_canDo) then {
};
};
};
} forEach magazines player;
} count magazines player;
{
_configParent = configName(inheritsFrom(configFile >> "cfgMagazines" >> _x));
@@ -194,9 +194,9 @@ if (_canDo) then {
_temp_removed_array set [count _temp_removed_array,_x];
};
};
} forEach magazines player;
} count magazines player;
} forEach _selectedRecipeInput;
} count _selectedRecipeInput;
//diag_log format["removed: %1 of: %2", _removed, _tobe_removed_total];
@@ -205,7 +205,7 @@ if (_canDo) then {
_num_removed_weapons = 0;
{
_num_removed_weapons = _num_removed_weapons + ([player,_x] call BIS_fnc_invRemove);
} forEach _inputWeapons;
} count _inputWeapons;
if (_num_removed_weapons == (count _inputWeapons)) then {
if(_randomOutput == 1) then {
_outputWeapons = [];
@@ -223,7 +223,7 @@ if (_canDo) then {
};
{
player addWeapon _x;
} forEach _outputWeapons;
} count _outputWeapons;
{
_itemOut = _x select 0;
@@ -250,14 +250,14 @@ if (_canDo) then {
// sleep here
sleep 1;
} forEach _selectedRecipeOutput;
} count _selectedRecipeOutput;
_tradeComplete = _tradeComplete+1;
};
} else {
// Refund parts since we failed
{player addMagazine _x;} forEach _temp_removed_array;
{player addMagazine _x;} count _temp_removed_array;
cutText [format[(localize "str_epoch_player_151"),_removed_total,_tobe_removed_total], "PLAIN DOWN"];
};

View File

@@ -19,7 +19,7 @@ _invehicle = false;
_config = configFile >> "CfgMagazines" >> _itemorignal;
_text = getText (_config >> "displayName");
//getting type of sfx (now just drink od soda open and drink)
//getting type of sfx (now just drink od soda open && drink)
_sfx = getText (_config >> "sfx");
if (!_hasdrinkitem) exitWith {cutText [format[(localize "str_player_31"),_text,"drink"] , "PLAIN DOWN"]};
@@ -35,14 +35,14 @@ if (vehicle player != player) then {
sleep 1;
if (["ItemWaterbottle",_itemorignal] call fnc_inString) then {
//low alert and sound radius
//low alert && sound radius
_dis=5;
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
player addMagazine "ItemWaterbottleUnfilled";
};
if (["ItemSoda",_itemorignal] call fnc_inString) then {
//higher alert and sound radius
//higher alert && sound radius
_dis=10;
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
@@ -71,7 +71,7 @@ if (_hasoutput && _invehicle) then {
};
//add infection chance for "ItemWaterbottle",
if ((random 15 < 1) and (_itemorignal == "ItemWaterbottle")) then {
if ((random 15 < 1) && (_itemorignal == "ItemWaterbottle")) then {
r_player_infected = true;
player setVariable["USEC_infected",true,true];
};

View File

@@ -70,12 +70,12 @@ if (_hasoutput && _invehicle) then {
(vehicle player) addMagazineCargoGlobal [_itemtodrop,1];
};
if (_rawfood and !_rawexceptions and (random 15 < 1)) then {
if (_rawfood && !_rawexceptions && (random 15 < 1)) then {
r_player_infected = true;
player setVariable["USEC_infected",true,true];
};
if (_badfood and (random 2 < 1)) then {
if (_badfood && (random 2 < 1)) then {
r_player_infected = true;
player setVariable["USEC_infected",true,true];
};

View File

@@ -21,4 +21,4 @@ _findNearestlight = [];
};
};
} foreach nearestObjects [([player] call FNC_getPos), [], 20];
} count nearestObjects [([player] call FNC_getPos), [], 20];

View File

@@ -31,7 +31,7 @@ r_interrupt = false;
while {_isOk} do {
if (r_interrupt or (player getVariable["combattimeout", 0] >= time)) then {
if (r_interrupt || (player getVariable["combattimeout", 0] >= time)) then {
_isOk = false;
cutText [(localize "str_epoch_player_68"), "PLAIN DOWN"];
} else {

View File

@@ -39,7 +39,7 @@ _findNearestTree = [];
};
};
} foreach nearestObjects [([player] call FNC_getPos), [], 10];
} count nearestObjects [([player] call FNC_getPos), [], 10];
//diag_log format["DEBUG TREES: %1", _findNearestTree];
@@ -68,7 +68,7 @@ if (count(_findNearestTree) >= 1) then {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
[player,"chopwood",0,false] call dayz_zombieSpeak;

View File

@@ -38,7 +38,7 @@ while {r_doLoop} do {
_height = (_posL select 2) - (_posC select 2);
/*
if(_height < 20) then {
if(((abs((_posL select 0) - (_posC select 0))) < 10) and ((abs((_posL select 1) - (_posC select 1))) < 10)) then {
if(((abs((_posL select 0) - (_posC select 0))) < 10) && ((abs((_posL select 1) - (_posC select 1))) < 10)) then {
_moved = true;
};
} else {
@@ -57,7 +57,7 @@ while {r_doLoop} do {
r_doLoop = false;
_finished = true;
};
if (r_interrupt or _moved or (typeName _attached == "OBJECT") or (typeName _hasAttached == "OBJECT")) then {
if (r_interrupt || _moved || (typeName _attached == "OBJECT") || (typeName _hasAttached == "OBJECT")) then {
r_doLoop = false;
};
sleep 0.1;
@@ -90,10 +90,10 @@ if(_finished) then {
player playActionNow "stop";
cutText [format["the lift heli moved to much from the vehicle that was being lifted!"], "PLAIN DOWN"]; //display text at bottom center of screen on interrupt
} else {
if((typeName _attached == "OBJECT") or (typeName _hasAttached == "OBJECT")) then {
if((typeName _attached == "OBJECT") || (typeName _hasAttached == "OBJECT")) then {
player switchMove "";
player playActionNow "stop";
cutText [format["Another vehicle was attached or the vehicle was attached to another heli!"], "PLAIN DOWN"]; //display text at bottom center of screen on interrupt
cutText [format["Another vehicle was attached || the vehicle was attached to another heli!"], "PLAIN DOWN"]; //display text at bottom center of screen on interrupt
} else {
r_interrupt = false;
player switchMove "";

View File

@@ -91,10 +91,10 @@ _qtynew_create_mags_full = floor(_qtynew_create_ammo/_create_magsize);
_qtynew_consume_ammo_rest = _qtynew_consume_ammo - (_qtynew_consume_mags_full*_consume_magsize);
_qtynew_create_ammo_rest = _qtynew_create_ammo - (_qtynew_create_mags_full*_create_magsize);
// abort if no complete mags or partial mag is less than 15% full
if(_qtynew_create_ammo_rest > 0 and _qtynew_create_ammo_rest < (_create_magsize*0.85)) exitWith { cutText [(localize "str_epoch_player_81"), "PLAIN DOWN"]; };
// abort if no complete mags || partial mag is less than 15% full
if(_qtynew_create_ammo_rest > 0 && _qtynew_create_ammo_rest < (_create_magsize*0.85)) exitWith { cutText [(localize "str_epoch_player_81"), "PLAIN DOWN"]; };
//remove all _consume and _create mags (we already have total ammo count)
//remove all _consume && _create mags (we already have total ammo count)
player removeMagazines _consume;
player removeMagazines _create;

View File

@@ -22,7 +22,7 @@ _findNearestPole = [];
if (alive _x) then {
_findNearestPole set [(count _findNearestPole),_x];
};
} foreach _findNearestPoles;
} count _findNearestPoles;
_IsNearPlot = count (_findNearestPole);
@@ -32,7 +32,7 @@ if(_IsNearPlot == 0) then {
_canBuildOnPlot = true;
} else {
// check nearby plots ownership and then for friend status
// check nearby plots ownership && then for friend status
_nearestPole = _findNearestPole select 0;
// Find owner
@@ -95,7 +95,7 @@ if ((count _upgrade) > 0) then {
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} forEach _requirements;
} count _requirements;
if (_proceed) then {
[1,1] call dayz_HungerThirst;
@@ -123,9 +123,9 @@ if ((count _upgrade) > 0) then {
};
};
} forEach magazines player;
} count magazines player;
} forEach _requirements;
} count _requirements;
// all parts removed proceed
if (_tobe_removed_total == _removed_total) then {
@@ -171,7 +171,7 @@ if ((count _upgrade) > 0) then {
} else {
{player addMagazine _x;} forEach _temp_removed_array;
{player addMagazine _x;} count _temp_removed_array;
cutText [format[(localize "str_epoch_player_145"),_removed_total,_tobe_removed_total], "PLAIN DOWN"];
};

View File

@@ -10,7 +10,7 @@ if (!isNull cursorTarget) then {
if(player distance _ent < 5) then {
if (_ent isKindOf "Animal" or _isZombie) then {
if (_ent isKindOf "Animal" || _isZombie) then {
_ent setDamage 1;
} else {
/* PVS/PVC - Skaronator */

View File

@@ -69,7 +69,7 @@ if(!(alive _item)) then {
[player,"eat",0,false] call dayz_zombieSpeak;
// todo: dump loot on ground and then remove
// todo: dump loot on ground && then remove
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';

View File

@@ -18,7 +18,7 @@ _index = 0;
_NV set [_index,(_NV select _index) + _x];
_index =_index + 1;
} forEach _increase;
} count _increase;
// set rgb + m
player setVariable [_NVx, _NV];

View File

@@ -16,7 +16,7 @@ _nameText = getText(_configVeh >> "displayName");
// _availableCansEmpty = ["ItemJerrycanEmpty","ItemFuelBarrelEmpty"];
_availableCans = ["ItemJerrycan","ItemFuelBarrel"];
// Loop to find containers that can could hold fuel and fill them
// Loop to find containers that can could hold fuel && fill them
{
_configCan = configFile >> "CfgMagazines" >> _x;
@@ -61,7 +61,7 @@ _availableCans = ["ItemJerrycan","ItemFuelBarrel"];
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -146,6 +146,6 @@ _availableCans = ["ItemJerrycan","ItemFuelBarrel"];
// exit if abort flag was set
if(_abort) exitWith {};
} forEach magazines player;
} count magazines player;
DZE_ActionInProgress = false;

View File

@@ -47,7 +47,7 @@ else {
_findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], 30];
_findNearestPole = [];
{if (alive _x) then {_findNearestPole set [(count _findNearestPole),_x];};} foreach _findNearestPoles;
{if (alive _x) then {_findNearestPole set [(count _findNearestPole),_x];};} count _findNearestPoles;
_IsNearPlot = count (_findNearestPole);
@@ -109,7 +109,7 @@ while {_isOk} do {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
_sfx = "repair";
@@ -131,7 +131,7 @@ while {_isOk} do {
if(_finished) then {
_counter = _counter + 1;
// 10% chance to break a required tool each pass
if((_isDestructable or _isRemovable) and !_isOwnerOfObj) then {
if((_isDestructable || _isRemovable) && !_isOwnerOfObj) then {
if((random 10) <= 1) then {
_brokenTool = true;
};
@@ -217,7 +217,7 @@ if (_proceed) then {
};
// give refund items
if((count _selectedRemoveOutput) > 0 and !_preventRefund) then {
if((count _selectedRemoveOutput) > 0 && !_preventRefund) then {
_item = createVehicle ["WeaponHolder", _iPos, [], _radius, "CAN_COLLIDE"];
{
_itemOut = _x select 0;
@@ -226,7 +226,7 @@ if (_proceed) then {
_countOut = round((random (_countOut select 1)) + (_countOut select 0));
};
_item addMagazineCargoGlobal [_itemOut,_countOut];
} forEach _selectedRemoveOutput;
} count _selectedRemoveOutput;
_item setposATL _iPos;

View File

@@ -20,7 +20,7 @@ _namePart = getText(configFile >> "cfgMagazines" >> _part >> "displayName");
s_player_repair_crtl = 1;
if (_section and _hasToolbox) then {
if (_section && _hasToolbox) then {
[1,1] call dayz_HungerThirst;
player playActionNow "Medic";
@@ -42,7 +42,7 @@ if (_section and _hasToolbox) then {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -70,7 +70,7 @@ if (_section and _hasToolbox) then {
//Fix 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
//vehicle is owned by whoever is in it, so we have to have each client try && fix it
PVDZE_veh_SFix = [_vehicle,_selection,0];
publicVariable "PVDZE_veh_SFix";
if (local _vehicle) then {
@@ -99,7 +99,7 @@ if (_section and _hasToolbox) then {
cutText [format[(localize "str_epoch_player_167"),_namePart], "PLAIN DOWN"];
};
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
dayz_myCursorTarget = objNull;
//check if repaired fully
@@ -110,7 +110,7 @@ _allFixed = true;
if (_damage > 0) exitWith {
_allFixed = false;
};
} forEach _hitpoints;
} count _hitpoints;
//update if repaired
if (_allFixed) then {

View File

@@ -1,4 +1,4 @@
private [];
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
s_player_repair_crtl = -1;
dayz_myCursorTarget = objNull;

View File

@@ -2,7 +2,7 @@ private ["_part","_cancel","_color","_allFixed","_percent","_string","_handle","
_vehicle = _this select 3;
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
// dayz_myCursorTarget = _vehicle;
_allFixed = true;
@@ -53,7 +53,7 @@ _hitpoints = _vehicle call vehicle_getHitpoints;
s_player_repairActions set [count s_player_repairActions,_handle];
};
} forEach _hitpoints;
} count _hitpoints;
if (_allFixed) then {
_vehicle setDamage 0;
};

View File

@@ -20,7 +20,7 @@ _hasToolbox = "ItemToolbox" in items player;
_nameType = getText(configFile >> "cfgVehicles" >> _type >> "displayName");
_namePart = getText(configFile >> "cfgMagazines" >> _part >> "displayName");
{_vehicle removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
{_vehicle removeAction _x} count s_player_repairActions;s_player_repairActions = [];
s_player_repair_crtl = 1;
if (_hasToolbox) then {
@@ -43,7 +43,7 @@ if (_hasToolbox) then {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -77,7 +77,7 @@ if (_hasToolbox) 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
//vehicle is owned by whoever is in it, so we have to have each client try && fix it
//["PVDZE_veh_SFix",[_vehicle,_selection,1],_vehicle] call broadcastRpcCallIfLocal;
PVDZE_veh_SFix = [_vehicle,_selection,1];

View File

@@ -2,7 +2,7 @@ private ["_part","_cancel","_color","_percent","_string","_handle","_damage","_c
_vehicle = _this select 3;
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
{dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = [];
// dayz_myCursorTarget = _vehicle;
// _allFixed = true;
@@ -40,10 +40,10 @@ _hitpoints = _vehicle call vehicle_getHitpoints;
};
// allow removal of any lightly damaged parts
if (_damage < 1 and _damage > 0) then {
if (_damage < 1 && _damage > 0) then {
// Do not allow removal of engine or fueltanks
if( _part == "PartGlass" or _part == "PartWheel" ) then {
// Do not allow removal of engine || fueltanks
if( _part == "PartGlass" || _part == "PartWheel" ) then {
_color = "color='#ffff00'"; //yellow
if (_damage >= 0.5) then {_color = "color='#ff8800'";}; //orange
@@ -57,7 +57,7 @@ _hitpoints = _vehicle call vehicle_getHitpoints;
};
};
} forEach _hitpoints;
} count _hitpoints;
if(count _hitpoints > 0 ) then {

View File

@@ -18,7 +18,7 @@ TraderCatList = [];
private ["_index", "_x"];
_index = lbAdd [TraderDialogCatList, _x select 0];
TraderCatList set [count TraderCatList, _x select 1];
} forEach _trader_data;
} count _trader_data;
waitUntil { !dialog };
TraderCurrentCatIndex = -1;
TraderCatList = -1;

View File

@@ -16,7 +16,7 @@ _nameText = getText(_configVeh >> "displayName");
_availableCansEmpty = ["ItemJerrycanEmpty","ItemFuelBarrelEmpty"];
// _availableCans = ["ItemJerrycan","ItemFuelBarrel"];
// Loop to find containers that can could hold fuel and fill them
// Loop to find containers that can could hold fuel && fill them
{
_configCanEmpty = configFile >> "CfgMagazines" >> _x;
//diag_log format["Looking for: %1", _x];
@@ -70,7 +70,7 @@ _availableCansEmpty = ["ItemJerrycanEmpty","ItemFuelBarrelEmpty"];
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -153,6 +153,6 @@ _availableCansEmpty = ["ItemJerrycanEmpty","ItemFuelBarrelEmpty"];
// exit if abort flag was set
if(_abort) exitWith {};
} forEach magazines player;
} count magazines player;
DZE_ActionInProgress = false;

View File

@@ -29,7 +29,7 @@ while {r_doLoop} do {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -51,7 +51,7 @@ if(!_finished) then {
if (_finished) then {
// find sound and delete
// find sound && delete
_soundObject = _vehicle getVariable "GeneratorSound";
deleteVehicle _soundObject;

View File

@@ -28,7 +28,7 @@ _selected = "";
_removed = _removed + ([player,_x] call BIS_fnc_invRemove);
};
if(_removed == 1) exitWith { _selected = _x; };
} forEach magazines player;
} count magazines player;
// Only proceed if removed count matches
if(_removed == _countIn) then {

View File

@@ -29,7 +29,7 @@ _objectsPond = nearestObjects [_playerPos, [], 10];
_isOk = true;
};
};
} forEach _objectsPond;
} count _objectsPond;
//diag_log ("Pitch Tent: " + str(_isok) );

View File

@@ -16,12 +16,12 @@ _allowedSize = _towTruckSize-(_towTruckSize/3);
_findNearestVehicles = nearestObjects [_towTruck, ["Car","Motorcycle"], 10];
_findNearestVehicle = [];
{
if (alive _x and _towTruck != _x) then {
if (alive _x && _towTruck != _x) then {
if([_x,_towTruck] call fnc_isInsideBuilding2) then {
_findNearestVehicle set [(count _findNearestVehicle),_x];
};
};
} foreach _findNearestVehicles;
} count _findNearestVehicles;
_IsNearVehicle = count (_findNearestVehicle);
@@ -54,7 +54,7 @@ if(_IsNearVehicle >= 1) then {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -78,7 +78,7 @@ if(_IsNearVehicle >= 1) then {
if (_finished) then {
if((sizeOf typeOf _vehicle) <= _allowedSize) then {
if([_vehicle,_towTruck] call fnc_isInsideBuilding2 and ((vectorUp _vehicle) select 2) > 0.5) then {
if([_vehicle,_towTruck] call fnc_isInsideBuilding2 && ((vectorUp _vehicle) select 2) > 0.5) then {
if(typeOf _towTruck == "TOW_DZE" ) then {
_vehicle attachTo [_towTruck,[1.3,-2,2.3]];
_towTruck setVariable ["DZEinTow", true, true];

View File

@@ -43,7 +43,7 @@ if(_inTow) then {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};

View File

@@ -43,7 +43,7 @@ while {r_doLoop} do {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -184,10 +184,10 @@ if (_finished) then {
_tireDmg = _tireDmg + _damage;
_tires = _tires + 1;
};
} forEach _hitpoints;
} count _hitpoints;
// find average tire damage
if(_tireDmg > 0 and _tires > 0) then {
if(_tireDmg > 0 && _tires > 0) then {
if((_tireDmg / _tires) > 0.75) then {
_okToSell = false;
};
@@ -198,7 +198,7 @@ if (_finished) then {
_notSetup = (_objectID == "0" && _objectUID == "0");
if(local _obj and !isNull _obj and alive _obj and !_notSetup) then {
if(local _obj && !isNull _obj && alive _obj && !_notSetup) then {
if(_okToSell) then {

View File

@@ -49,7 +49,7 @@ if (_qty >= _qty_in) then {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -143,10 +143,10 @@ if (_qty >= _qty_in) then {
_tireDmg = _tireDmg + _damage;
_tires = _tires + 1;
};
} forEach _hitpoints;
} count _hitpoints;
// find average tire damage
if(_tireDmg > 0 and _tires > 0) then {
if(_tireDmg > 0 && _tires > 0) then {
if((_tireDmg / _tires) > 0.75) then {
_okToSell = false;
};
@@ -155,7 +155,7 @@ if (_qty >= _qty_in) then {
if(_okToSell) then {
if(!isNull _obj and alive _obj) then {
if(!isNull _obj && alive _obj) then {
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
@@ -179,7 +179,7 @@ if (_qty >= _qty_in) then {
};
};
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
{player removeAction _x} count s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;
} else {

View File

@@ -43,7 +43,7 @@ while {r_doLoop} do {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -134,7 +134,7 @@ if (_finished) then {
waitUntil {!isNil "_isOk"};
if (_isOk and _isKeyOK) then {
if (_isOk && _isKeyOK) then {
_done = [[[_part_in,_qty_in]],0] call epoch_returnChange;
if (_done) then {
@@ -193,7 +193,7 @@ if (_finished) then {
_notSetup = (_objectID == "0" && _objectUID == "0");
if(local _obj and !isNull _obj and alive _obj and !_notSetup) then {
if(local _obj && !isNull _obj && alive _obj && !_notSetup) then {
PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer];
publicVariableServer "PVDZE_obj_Delete";

View File

@@ -50,7 +50,7 @@ if (_qty >= _qty_in) then {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -112,7 +112,7 @@ if (_qty >= _qty_in) then {
_config = _keySelected;
_isOk = [player,_config] call BIS_fnc_invAdd;
waitUntil {!isNil "_isOk"};
if (_isOk and _isKeyOK) then {
if (_isOk && _isKeyOK) then {
_removed = ([player,_part_in,_qty_in] call BIS_fnc_invRemove);
if(_removed == _qty_in) then {
@@ -152,7 +152,7 @@ if (_qty >= _qty_in) then {
_okToSell = false;
};
if(_okToSell and !isNull _obj and alive _obj) then {
if(_okToSell && !isNull _obj && alive _obj) then {
for "_x" from 1 to _qty_out do {
player addMagazine _part_out;
@@ -172,7 +172,7 @@ if (_qty >= _qty_in) then {
};
};
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
{player removeAction _x} count s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;
} else {

View File

@@ -43,7 +43,7 @@ while {r_doLoop} do {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -134,7 +134,7 @@ if (_finished) then {
waitUntil {!isNil "_isOk"};
if (_isOk and _isKeyOK) then {
if (_isOk && _isKeyOK) then {
_done = [[[_part_in,_qty_in]],0] call epoch_returnChange;
if (_done) then {
@@ -205,10 +205,10 @@ if (_finished) then {
_tireDmg = _tireDmg + _damage;
_tires = _tires + 1;
};
} forEach _hitpoints;
} count _hitpoints;
// find average tire damage
if(_tireDmg > 0 and _tires > 0) then {
if(_tireDmg > 0 && _tires > 0) then {
if((_tireDmg / _tires) > 0.75) then {
_okToSell = false;
};
@@ -220,7 +220,7 @@ if (_finished) then {
_notSetup = (_objectID == "0" && _objectUID == "0");
if(local _obj and !isNull _obj and alive _obj and !_notSetup) then {
if(local _obj && !isNull _obj && alive _obj && !_notSetup) then {
if(_okToSell) then {
@@ -240,7 +240,7 @@ if (_finished) then {
[_activatingPlayer,_x] call BIS_fnc_invRemove;
};
};
} forEach (items _activatingPlayer);
} count (items _activatingPlayer);
// payout
_canAfford = [[[_part_out,_qty_out]],1] call epoch_returnChange;

View File

@@ -43,7 +43,7 @@ while {r_doLoop} do {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -182,10 +182,10 @@ if (_finished) then {
_tireDmg = _tireDmg + _damage;
_tires = _tires + 1;
};
} forEach _hitpoints;
} count _hitpoints;
// find average tire damage
if(_tireDmg > 0 and _tires > 0) then {
if(_tireDmg > 0 && _tires > 0) then {
if((_tireDmg / _tires) > 0.75) then {
_okToSell = false;
};
@@ -196,7 +196,7 @@ if (_finished) then {
_notSetup = (_objectID == "0" && _objectUID == "0");
if(local _obj and !isNull _obj and alive _obj and !_notSetup) then {
if(local _obj && !isNull _obj && alive _obj && !_notSetup) then {
if(_okToSell) then {

View File

@@ -54,7 +54,7 @@ if (_qty >= _qty_in) then {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -120,7 +120,7 @@ if (_qty >= _qty_in) then {
_config = _keySelected;
_isOk = [player,_config] call BIS_fnc_invAdd;
waitUntil {!isNil "_isOk"};
if (_isOk and _isKeyOK) then {
if (_isOk && _isKeyOK) then {
_removed = ([player,_part_in,_qty_in] call BIS_fnc_invRemove);
if(_removed == _qty_in) then {
@@ -170,16 +170,16 @@ if (_qty >= _qty_in) then {
_tireDmg = _tireDmg + _damage;
_tires = _tires + 1;
};
} forEach _hitpoints;
} count _hitpoints;
// find average tire damage
if(_tireDmg > 0 and _tires > 0) then {
if(_tireDmg > 0 && _tires > 0) then {
if((_tireDmg / _tires) > 0.75) then {
_okToSell = false;
};
};
if(local _obj and !isNull _obj and alive _obj) then {
if(local _obj && !isNull _obj && alive _obj) then {
if(_okToSell) then {
@@ -206,7 +206,7 @@ if (_qty >= _qty_in) then {
};
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
{player removeAction _x} count s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;
} else {

View File

@@ -40,7 +40,7 @@ while {r_doLoop} do {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};

View File

@@ -48,7 +48,7 @@ if (_qty >= _qty_in) then {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -117,7 +117,7 @@ if (_qty >= _qty_in) then {
cutText [format[(localize "str_epoch_player_186"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
{player removeAction _x} count s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;
} else {

View File

@@ -1,3 +1,3 @@
private [];
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
{player removeAction _x} count s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;

View File

@@ -81,7 +81,7 @@ while {r_autoTrade} do {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};

View File

@@ -71,7 +71,7 @@ for "_x" from 1 to _total_trades do {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};

View File

@@ -56,7 +56,7 @@ for "_x" from 1 to _total_trades do {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};

View File

@@ -3,7 +3,7 @@ private ["_buy","_metals_conversion","_cancel"];
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_103") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
{player removeAction _x} count s_player_parts;s_player_parts = [];
s_player_parts_crtl = 1;
_metals_conversion = [
@@ -18,7 +18,7 @@ _metals_conversion = [
_buy = player addAction [format["Trade %1 %2 for %3 %4",(_x select 3),(_x select 5),(_x select 2),(_x select 6)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6)], (_x select 7), true, true, "",""];
s_player_parts set [count s_player_parts,_buy];
} forEach _metals_conversion;
} count _metals_conversion;
_cancel = player addAction ["Cancel", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
s_player_parts set [count s_player_parts,_cancel];

View File

@@ -33,14 +33,14 @@ if(_buy_o_sell == "sell") then {
_abort = (!(_configName in (weapons player)));
if(_isToolBelt or _isBinocs) then {
if(_isToolBelt || _isBinocs) then {
_msg = "Need the item on your toolbelt before you can sell it.";
};
} else {
// buying item type must NOT exist if rifle or pistol
_msg = "Drop or sell your current weapon before you can buy a new one.";
// buying item type must NOT exist if rifle || pistol
_msg = "Drop || sell your current weapon before you can buy a new one.";
_config = (configFile >> "CfgWeapons" >> _part_out);
_configName = configName(_config);
_wepType = getNumber(_config >> "Type");
@@ -59,12 +59,12 @@ if(_buy_o_sell == "sell") then {
if ((getNumber (configFile >> "CfgWeapons" >> _x >> "Type")) == 2) exitWith {
_secondaryWeapon = _x;
};
} forEach (weapons player);
} count (weapons player);
_abort = (_secondaryWeapon != "");
};
if(_isToolBelt or _isBinocs) then {
if(_isToolBelt || _isBinocs) then {
_abort = (_configName in (weapons player));
_msg = "Drop or sell your current toolbelt item before you can buy a new one.";
_msg = "Drop || sell your current toolbelt item before you can buy a new one.";
};
};
@@ -91,7 +91,7 @@ while {r_doLoop} do {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};

View File

@@ -49,7 +49,7 @@ if (_qty >= _qty_in) then {
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
if (_started && !_isMedic) then {
r_doLoop = false;
_finished = true;
};
@@ -107,7 +107,7 @@ if (_qty >= _qty_in) then {
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
{player removeAction _x} count s_player_parts;s_player_parts = [];
s_player_parts_crtl = -1;
} else {

View File

@@ -5,7 +5,7 @@ _key = (_this select 3) select 1;
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_37") , "PLAIN DOWN"]; };
DZE_ActionInProgress = true;
{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
{player removeAction _x} count s_player_lockunlock;s_player_lockunlock = [];
s_player_lockUnlock_crtl = 1;
PVDZE_veh_Lock = [_vehicle,false];

View File

@@ -8,7 +8,7 @@ dayz_combination = "";
if(!isNull dayz_selectedVault) then {
if ((typeOf dayz_selectedVault) == "VaultStorageLocked" or (typeOf dayz_selectedVault) == "VaultStorage") then {
if ((typeOf dayz_selectedVault) == "VaultStorageLocked" || (typeOf dayz_selectedVault) == "VaultStorage") then {
_ok = createdialog "SafeKeyPad";
} else {
_ok = createdialog "KeypadUI";

View File

@@ -101,7 +101,7 @@ _objectsPond = nearestObjects [_playerPos, [], 10];
_isOk = true;
};
};
} forEach _objectsPond;
} count _objectsPond;
deleteVehicle _tmpvault;

View File

@@ -1,6 +1,6 @@
/*
Created exclusively for ArmA2:OA - DayZMod and DayZ Epoch. Script by icomrade.
permission is required to use, alter and/or distribute from the author or project leader.
Created exclusively for ArmA2:OA - DayZMod && DayZ Epoch. Script by icomrade.
permission is required to use, alter &&/|| distribute from the author || project leader.
*/
private ["_array","_count","_action","_driver","_vehicle","_vehicleType","_emptySeat","_emptyGun"];
_array = _this select 3;
@@ -14,7 +14,7 @@ _emptyGun = ((_vehicle emptyPositions "Gunner") - _count);
switch _action do {
case "MoveToPilot": {
if (((_vehicle emptyPositions "Driver") == 0) and (!alive _driver)) then {
if (((_vehicle emptyPositions "Driver") == 0) && (!alive _driver)) then {
_driver action ["EJECT", _vehicle];
sleep 0.5; //wait for ejection
};

View File

@@ -29,7 +29,7 @@ if (!_canFill) then {
//Check for Well
_isWell = ["_well",str(_x),false] call fnc_inString;
if (_isWell) then {_canFill = true};
} forEach _objectsWell;
} count _objectsWell;
};
if (!_canFill) then {
@@ -43,7 +43,7 @@ if (!_canFill) then {
_canFill = true;
};
};
} forEach _objectsPond;
} count _objectsPond;
};
if (_canFill) then {