Minor formatting cleanup

This commit is contained in:
ebaydayz
2016-03-21 17:58:23 -04:00
parent 286f405e67
commit e2e6e79394
76 changed files with 319 additions and 330 deletions

View File

@@ -8,7 +8,7 @@ scriptName "Functions\misc\fn_damageActions.sqf";
- [] call fnc_usec_damageActions;
************************************************************/
if (DZE_ActionInProgress) exitWith {};
private ["_action","_weaponName","_turret","_weapons","_assignedRole","_driver","_action1","_action2","_vehicle","_unit","_vehType","_vehClose","_hasVehicle","_unconscious","_lowBlood","_injured","_inPain","_legsBroke","_armsBroke","_charID","_friendlies","_playerMagazines","_hasBandage","_hasEpi","_hasMorphine","_hasBlood","_hasPainkillers","_unconscious_crew","_patients","_crew","_menClose","_hasPatient","_inVehicle","_isClose","_transfuse"];
private ["_action","_weaponName","_turret","_weapons","_assignedRole","_driver","_action1","_action2","_vehicle","_unit","_vehType","_vehClose","_hasVehicle","_unconscious","_lowBlood","_injured","_inPain","_legsBroke","_armsBroke","_charID","_friendlies","_playerMagazines","_hasBandage","_hasEpi","_hasMorphine","_hasPainkillers","_unconscious_crew","_patients","_crew","_menClose","_hasPatient","_inVehicle","_isClose","_transfuse"];
_menClose = cursorTarget;
_hasPatient = alive _menClose;
@@ -135,7 +135,7 @@ if (isPlayer cursorTarget) then {
if (_hasPatient) then {
//Allow player to drag
if(_unconscious) then {
if (_unconscious) then {
r_action = true;
_action1 = _unit addAction [localize "STR_UI_GEAR", "\z\addons\dayz_code\actions\openGear.sqf",_unit, 0, true, true];
_action2 = _unit addAction [localize "str_actions_medical_01", "\z\addons\dayz_code\medical\drag.sqf",_unit, 0, true, true];
@@ -161,43 +161,43 @@ if (isPlayer cursorTarget) then {
r_player_actions set [count r_player_actions,_action];
};
//Allow player to bandage
if(_injured && _hasBandage) then {
if (_injured && _hasBandage) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_04", "\z\addons\dayz_code\medical\bandage.sqf",[_unit,"ItemBandage"], 0, true, true, "", "'ItemBandage' in magazines player"];
r_player_actions set [count r_player_actions,_action];
};
//Sepsis
if(_hasSepsis && _hasSepsisBandage) then {
if (_hasSepsis && _hasSepsisBandage) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_04", "\z\addons\dayz_code\medical\bandage.sqf",[_unit,"ItemSepsisBandage"], 0, true, true, "", "'ItemBandage' in magazines player"];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to give Epinephrine
if(_unconscious && _hasEpi) then {
if (_unconscious && _hasEpi) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_05", "\z\addons\dayz_code\medical\epinephrine.sqf",[_unit], 0, true, true];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to give Morphine
if((_legsBroke or _armsBroke) && _hasMorphine) then {
if ((_legsBroke or _armsBroke) && _hasMorphine) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_06", "\z\addons\dayz_code\medical\brokeBones.sqf",[_unit,"ItemMorphine"], 0, true, true, "", "'ItemMorphine' in magazines player"];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to give equip_woodensplint
if((_legsBroke or _armsBroke) && _hasSplint) then {
if ((_legsBroke or _armsBroke) && _hasSplint) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_06_splint", "\z\addons\dayz_code\medical\brokeBones.sqf",[_unit,"equip_woodensplint"], 0, true, true, "", "'equip_woodensplint' in magazines player"];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to give Painkillers
if(_inPain && _hasPainkillers) then {
if (_inPain && _hasPainkillers) then {
r_action = true;
_action = _unit addAction [localize "str_actions_medical_07", "\z\addons\dayz_code\medical\painkiller.sqf",[_unit], 0, true, true, "", "'ItemPainkiller' in magazines player"];
r_player_actions set [count r_player_actions,_action];
};
//Allow player to transfuse blood
if(_lowBlood && _hasBlood) then {
if (_lowBlood && _hasBloodBag) then {
_transfuse = if (DZE_UseBloodTypes) then {"\z\addons\dayz_code\medical\transfusion.sqf"} else {"\z\addons\dayz_code\medical\transfusion_NoBloodTypes.sqf"};
r_action = true;
_action = _unit addAction [localize "str_actions_medical_08",_transfuse,[_unit], 0, true, true];

View File

@@ -8,7 +8,7 @@ if ((vehicle player) == player) then {
_dis = if (_cTarget isKindOf "USEC_ch53_E" || _cTarget isKindOf "MV22") then {25} else {12};
if ((locked _cTarget) && {(_cTarget isKindOf "LandVehicle") or {_cTarget isKindOf "Air"} or {_cTarget isKindOf "Ship"}} && {(player distance _cTarget) < _dis}) then {
cutText [(localize "str_epoch_player_7"),"PLAIN DOWN"];
cutText [localize "str_epoch_player_7","PLAIN DOWN"];
_display closeDisplay 1;
};
@@ -16,7 +16,7 @@ if ((vehicle player) == player) then {
_friendlies = player getVariable ["friendlies",[]];
_rcharID = _cTarget getVariable ["CharacterID","0"];
if (!canbuild && {_cTarget isKindOf "Man"} && {alive _cTarget} && {!((typeOf _cTarget) in serverTraders)} && {!(_rcharID in _friendlies)} && {(player distance _cTarget) < 12}) then {
cutText [(localize "STR_EPOCH_PLAYER_316"),"PLAIN DOWN"];
cutText [localize "STR_EPOCH_PLAYER_316","PLAIN DOWN"];
_display closeDisplay 1;
};
};

View File

@@ -4,19 +4,18 @@ _objects = _this select 0;
_range = _this select 1;
_error = _this select 2;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
_nearByObjects = nearestObjects [player,_objects,_range];
if (count _nearByObjects == 0) exitWith {
cutText [(localize _error), "PLAIN DOWN"];
cutText [localize _error,"PLAIN DOWN"];
};
_targetObject = _nearByObjects select 0;
if (!isNull _targetObject && _canDo) then {
[0,1,2,_targetObject] spawn player_removeObject;
} else {
cutText [(localize _error), "PLAIN DOWN"];
cutText [localize _error,"PLAIN DOWN"];
};

View File

@@ -39,31 +39,31 @@ if(_activated) then {
// this method is said to be faster than switch, lets try it.
call {
if (DZE_AntiWallCounter == DZE_AntiWallLimit) exitWith {
cutText [(localize "str_epoch_player_9"), "PLAIN DOWN"];
cutText [localize "str_epoch_player_9","PLAIN DOWN"];
_id = [player,"crushed"] spawn player_death;
};
if ((_vehicle emptyPositions "driver") > 0) exitWith {
cutText [(localize "STR_EPOCH_ACTIONS_15"), "PLAIN DOWN"];
cutText [localize "STR_EPOCH_ACTIONS_15","PLAIN DOWN"];
player moveInDriver _vehicle;
DZE_AntiWallCounter = DZE_AntiWallCounter + 1;
};
if ((_vehicle emptyPositions "gunner") > 0) exitWith {
cutText [(localize "STR_EPOCH_ACTIONS_15"), "PLAIN DOWN"];
cutText [localize "STR_EPOCH_ACTIONS_15","PLAIN DOWN"];
player moveInGunner _vehicle;
DZE_AntiWallCounter = DZE_AntiWallCounter + 1;
};
if ((_vehicle emptyPositions "commander") > 0) exitWith {
cutText [(localize "STR_EPOCH_ACTIONS_15"), "PLAIN DOWN"];
cutText [localize "STR_EPOCH_ACTIONS_15","PLAIN DOWN"];
player moveInCommander _vehicle;
DZE_AntiWallCounter = DZE_AntiWallCounter + 1;
};
if ((_vehicle emptyPositions "cargo") > 0) exitWith {
cutText [(localize "STR_EPOCH_ACTIONS_15"), "PLAIN DOWN"];
cutText [localize "STR_EPOCH_ACTIONS_15","PLAIN DOWN"];
player moveInCargo _vehicle;
DZE_AntiWallCounter = DZE_AntiWallCounter + 1;
};
// kill player if none of the above are matched
cutText [(localize "str_epoch_player_9"), "PLAIN DOWN"];
cutText [localize "str_epoch_player_9","PLAIN DOWN"];
_id = [player,"crushed"] spawn player_death;
};

View File

@@ -45,12 +45,12 @@ if ((_ammo isKindOf "SmokeShell") or (_ammo isKindOf "GrenadeHandTimedWest") or
if (isNull group _x) then {
_group = _x;
};
_isLocal = (local _x);
_isLocal = local _x;
_x reveal [_projectile,4];
_localtargets = _group getVariable ["localtargets",[]];
_remotetargets = _group getVariable ["remotetargets",[]];
_targets = _localtargets + _remotetargets;
if (!(_projectile in _targets)) then {
if !(_projectile in _targets) then {
switch (_isLocal) do {
case false: {
_remotetargets set [count _remotetargets,_projectile];
@@ -64,31 +64,28 @@ if ((_ammo isKindOf "SmokeShell") or (_ammo isKindOf "GrenadeHandTimedWest") or
};
} forEach (_pos nearEntities ["zZombie_Base",50]);
} else {
while { alive _projectile } do {
while {alive _projectile} do {
_pos = getPosATL _projectile;
uiSleep 0.01;
};
{
_x setVariable ["myDest",_pos]; // removed networked var. targets should be enough
} forEach (_pos nearEntities ["zZombie_Base",50]);
} count (_pos nearEntities ["zZombie_Base",50]);
};
};
} else {
[_unit,_distance,true,(getPosATL player)] call player_alertZombies;
[_unit,_distance,true,getPosATL player] call player_alertZombies;
//Check if need to place arrow
if (_ammo isKindOf "Bolt") then {
[_this] spawn player_crossbowBolt;
};
if (_ammo isKindOf "GrenadeHand") then {
if (_ammo isKindOf "ThrownObjects") then {
[_this] spawn player_throwObject;
};
if (_ammo isKindOf "RoadFlare") then {
//hint str(_ammo);
_projectile = nearestObject [_unit, "RoadFlare"];
[_projectile,0] spawn object_roadFlare;
PVDZ_obj_RoadFlare = [_projectile,0];

View File

@@ -1,6 +1,5 @@
private ["_inventory","_wpns","_mags","_idc","_isOK","_typedBags"];
private "_idc";
_inventory = _this;
_typedBags = ["bloodBagANEG", "bloodBagAPOS", "bloodBagBNEG", "bloodBagBPOS", "bloodBagONEG", "bloodBagOPOS","wholeBloodBagANEG", "wholeBloodBagAPOS", "wholeBloodBagBNEG", "wholeBloodBagBPOS", "wholeBloodBagONEG", "wholeBloodBagOPOS"];
if (count _inventory > 0) then {
_wpns = _inventory select 0;
_mags = _inventory select 1;
@@ -24,13 +23,11 @@ if (count _inventory > 0) then {
if (DZE_UseBloodTypes) then {
if (_item == "ItemBloodbag") then { _item = "bloodBagONEG" }; // Convert ItemBloodbag into universal blood type/rh bag
} else {
if (_item in _typedBags) then {_item = "ItemBloodbag"};
if (_item in DZE_typedBags) then { _item = "ItemBloodbag" };
};
if (_item == "ItemTent") then { _item = "ItemTentOld" };
//Is item legal?
_isOK = isClass(configFile >> "CfgMagazines" >> _item);
if (_isOK) then {
if (isClass(configFile >> "CfgMagazines" >> _item)) then {
if (_val != -1) then {
player addMagazine [_item,_val];
} else {
@@ -39,15 +36,15 @@ if (count _inventory > 0) then {
};
_idc = _idc + 1;
} count _mags;
//Add weapons
{
if(_x in (DZE_REPLACE_WEAPONS select 0)) then {
if (_x in (DZE_REPLACE_WEAPONS select 0)) then {
_x = (DZE_REPLACE_WEAPONS select 1) select ((DZE_REPLACE_WEAPONS select 0) find _x);
};
//Is item legal?
_isOK = isClass(configFile >> "CfgWeapons" >> _x);
if (_isOK) then {
if (isClass(configFile >> "CfgWeapons" >> _x)) then {
player addWeapon _x;
};
} count _wpns;

View File

@@ -1,8 +1,6 @@
private ["_object","_change","_humanity","_wait"];
//Set Variables
private ["_object","_change","_wait","_humanity","_model","_isMen","_isMenH","_isMenB","_isWomen","_isWomenH","_isWomenB"];
_object = _this select 0;
_change = _this select 1;
_humanity = 0;
_wait = if (count _this > 2) then { _this select 2 } else { 0 };
if (_object == player) then {
@@ -16,7 +14,7 @@ if (_object == player) then {
private ["_endtime","_wait"];
_wait = _this select 0;
_endTime = diag_tickTime + _wait;
waitUntil { uisleep 1; diag_tickTime > _endTime };
waitUntil { uiSleep 1; diag_tickTime > _endTime };
player setVariable ["FTcounter",((player getVariable ["FTcounter",0]) - _wait)];
if ((player getVariable ["FTcounter",0]) <= 0) then {
player setVariable ["FTcounter",0];
@@ -25,4 +23,53 @@ if (_object == player) then {
};
};
};
/* Humanity morphing disabled on Epoch to avoid loss of purchased clothing
//add humanity cap both ways
//if (_humanity < 500000) then { player setVariable["humanity",-500000,true]; }; //Hive adds/removes diffrence
//if (_humanity > 500000) then { player setVariable["humanity",500000,true]; }; //Hive adds/removes diffrence
_model = typeOf player;
//if model will not be changed by humanity
if !(_model in ["Survivor1_DZ","Survivor2_DZ","Survivor3_DZ","SurvivorW2_DZ","SurvivorW3_DZ","Bandit1_DZ","BanditW1_DZ"]) exitWith {};
//Not sure if this will work needs testing
_isMen = _model == "Survivor1_DZ" || _model == "Survivor2_DZ";
_isMenH = _model == "Survivor3_DZ";
_isMenB = _model == "Bandit1_DZ";
_isWomen = _model == "SurvivorW2_DZ";
_isWomenH = _model == "SurvivorW3_DZ"; //TODO
_isWomenB = _model == "BanditW1_DZ";
// Bandit
if (_humanity <= -2000) then {
if (_isMen || _isMenH) then {
[dayz_playerUID,dayz_characterID,"Bandit1_DZ"] spawn player_humanityMorph;
};
if (_isWomen || _isWomenH) then {
[dayz_playerUID,dayz_characterID,"BanditW1_DZ"] spawn player_humanityMorph;
};
};
//Survivor
if (_humanity > -2000 && _humanity <= 5000) then {
if (_isMenH || _isMenB) then {
[dayz_playerUID,dayz_characterID,"Survivor2_DZ"] spawn player_humanityMorph;
};
if (_isWomenH || _isWomenB) then {
[dayz_playerUID,dayz_characterID,"SurvivorW2_DZ"] spawn player_humanityMorph;
};
};
// Hero
if (_humanity > 5000) then {
if (_isMen || _isMenB) then {
[dayz_playerUID,dayz_characterID,"Survivor3_DZ"] spawn player_humanityMorph;
};
if (_isWomenB) then {
[dayz_playerUID,dayz_characterID,"SurvivorW2_DZ"] spawn player_humanityMorph;
};
};
*/
};

View File

@@ -2,10 +2,9 @@ private ["_charID","_newmodel","_old","_updates","_humanity","_medical","_worlds
//_playerUID = _this select 0;
_charID = _this select 1;
_model = _this select 2;
_old = player;
player allowDamage false;
player allowDamage false;
player removeEventHandler ["FiredNear",eh_player_killed];
player removeEventHandler ["HandleDamage",mydamage_eh1];
player removeEventHandler ["Killed",mydamage_eh3];
@@ -23,8 +22,8 @@ _zombieKills = player getVariable ["zombieKills",0];
_headShots = player getVariable ["headShots",0];
_humanKills = player getVariable ["humanKills",0];
_banditKills = player getVariable ["banditKills",0];
_achievements = player getVariable ["Achievements",[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];
_friendlies = player getVariable ["friendlies",[]];
//Switch
_switch = _model spawn player_switchModel;
@@ -35,7 +34,7 @@ waitUntil { scriptDone _switch };
//set medical values
if (count _medical > 0) then {
player setVariable["USEC_isDead",(_medical select 0),true];
player setVariable["NORRN_unconscious", (_medical select 1), true];
player setVariable["NORRN_unconscious",(_medical select 1), true];
player setVariable["USEC_infected",(_medical select 2),true];
player setVariable["USEC_injured",(_medical select 3),true];
player setVariable["USEC_inPain",(_medical select 4),true];
@@ -43,7 +42,6 @@ if (count _medical > 0) then {
player setVariable["USEC_lowBlood",(_medical select 6),true];
player setVariable["USEC_BloodQty",(_medical select 7),true];
player setVariable["unconsciousTime",(_medical select 10),true];
player setVariable["blood_type",(_medical select 11),true];
player setVariable["rh_factor",(_medical select 12),true];
player setVariable["messing",(_medical select 13),true];
@@ -57,13 +55,12 @@ if (count _medical > 0) then {
publicVariable "PVDZ_hlt_Bleed";
} forEach (_medical select 8);
//Add fractures
_fractures = (_medical select 9);
_fractures = _medical select 9;
// player setVariable ["hit_legs",(_fractures select 0),true];
// player setVariable ["hit_hands",(_fractures select 1),true];
[player,"legs", (_fractures select 0)] call object_setHit;
[player,"hands", (_fractures select 1)] call object_setHit;
[player,"legs",(_fractures select 0)] call object_setHit;
[player,"hands",(_fractures select 1)] call object_setHit;
} else {
//Reset Fractures
player setVariable ["hit_legs",0,true];
@@ -72,7 +69,6 @@ if (count _medical > 0) then {
player setVariable ["USEC_inPain",false,true];
};
//General Stats
player setVariable["humanity",_humanity,true];
player setVariable["zombieKills",_zombieKills,true];
@@ -82,25 +78,19 @@ player setVariable["banditKills",_banditKills,true];
player setVariable["characterID",_charID,true];
player setVariable["worldspace",_worldspace];
player setVariable["Achievements",_achievements];
player setVariable["CharacterID",_charID,true];
player setVariable["worldspace",_worldspace,true];
player setVariable["friendlies",_friendlies,true];
player setVariable["tagList",_tagList,true];
PVDZ_serverStoreVar = [player,"Achievements",_achievements];
publicVariableServer "PVDZ_serverStoreVar";
call dayz_resetSelfActions;
eh_player_killed = player addeventhandler ["FiredNear",{_this call player_weaponFiredNear;} ];
eh_player_killed = player addeventhandler ["FiredNear",{_this call player_weaponFiredNear;}];
[player] call fnc_usec_damageHandle;
player allowDamage true;
player addWeapon "Loot";
uiSleep 0.1;
//melee check
call dayz_meleeMagazineCheck;
uiSleep 0.1;
if !(isNull _old) then {deleteVehicle _old;};
if !(isNull _old) then {deleteVehicle _old;};

View File

@@ -5,7 +5,7 @@
*/
private ["_objectID","_objectUID","_obj","_ownerID","_dir","_pos","_holder","_weapons","_magazines","_backpacks","_alreadyPacking","_lockedClass","_text","_playerNear"];
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_10") , "PLAIN DOWN"]; };
if (DZE_ActionInProgress) exitWith {cutText [localize "str_epoch_player_10","PLAIN DOWN"];};
DZE_ActionInProgress = true;
player removeAction s_player_lockvault;
@@ -15,7 +15,7 @@ _obj = _this;
_objType = typeOf _obj;
_lockedClass = getText (configFile >> "CfgVehicles" >> _objType >> "lockedClass");
_text = getText (configFile >> "CfgVehicles" >> _objType >> "displayName");
_text = getText (configFile >> "CfgVehicles" >> _objType >> "displayName");
// Silently exit if object no longer exists
if(isNull _obj) exitWith { DZE_ActionInProgress = false; };
@@ -26,11 +26,11 @@ uiSleep 1;
uiSleep 5;
_playerNear = _obj call dze_isnearest_player;
if(_playerNear) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_11") , "PLAIN DOWN"]; };
if (_playerNear) exitWith {DZE_ActionInProgress = false; cutText [localize "str_epoch_player_11","PLAIN DOWN"];};
_ownerID = _obj getVariable["CharacterID","0"];
_objectID = _obj getVariable["ObjectID","0"];
_objectUID = _obj getVariable["ObjectUID","0"];
_objectID = _obj getVariable["ObjectID","0"];
_objectUID = _obj getVariable["ObjectUID","0"];
if((_ownerID != dayz_combination) && (_ownerID != dayz_playerUID)) exitWith {DZE_ActionInProgress = false; s_player_lockvault = -1; cutText [format[(localize "str_epoch_player_115"),_text], "PLAIN DOWN"]; };
@@ -41,7 +41,7 @@ _obj setVariable["packing",1];
_dir = direction _obj;
_pos = _obj getVariable["OEMPos",(getposATL _obj)];
if(!isNull _obj) then {
if (!isNull _obj) then {
dze_waiting = nil;
PVDZE_log_lockUnlock = [player, _obj,true];
publicVariableServer "PVDZE_log_lockUnlock";
@@ -59,9 +59,9 @@ if(!isNull _obj) then {
_holder setVariable["ObjectUID",_objectUID,true];
_holder setVariable ["OEMPos", _pos, true];
_weapons = getWeaponCargo _obj;
_magazines = getMagazineCargo _obj;
_backpacks = getBackpackCargo _obj;
_weapons = getWeaponCargo _obj;
_magazines = getMagazineCargo _obj;
_backpacks = getBackpackCargo _obj;
// remove vault
deleteVehicle _obj;

View File

@@ -1,6 +1,5 @@
private ["_sound","_num","_length","_pause"];
while {!r_player_dead} do {
_num = floor(random 37);
_num = round(random 37);
_sound = "z_suspense_" + str(_num);
_length = getNumber(configFile >> "cfgMusic" >> _sound >> "Duration");
_pause = ((random 5) + 2) + _length;

View File

@@ -9,10 +9,9 @@ _btnAbort = _display displayCtrl 104;
_btnRespawn ctrlEnable false;
_btnAbort ctrlEnable false;
_btnAbortText = ctrlText _btnAbort;
_timeOut = 0;
_timeMax = diag_tickTime+10;
_isPZombie = player isKindOf "PZombie_VB";
if(r_fracture_legs && !r_player_dead) then {_btnRespawn ctrlEnable true;};
if (r_fracture_legs) then {_btnRespawn ctrlEnable true;};
dayz_lastCheckSave = time;
//force gear save
@@ -20,38 +19,31 @@ if (time - dayz_lastCheckSave > 10) then {
call player_forceSave;
};
while {(!isNull _display) and !r_player_dead} do {
while {(!isNull _display) && !r_player_dead} do {
_timeout = 30;
_timeout = player getVariable["combattimeout", 0];
_inCombat = if (_timeout >= diag_tickTime) then { true } else { false };
_playerCheck = if ({isPlayer _x} count (player nearEntities ["AllVehicles", 5]) > 1) then { true } else { false };
//_zedCheck = if (count (player nearEntities ["zZombie_Base", 10]) > 0) then { true } else { false };
_inCombat = if (_timeout >= diag_tickTime) then {true} else {false};
_playerCheck = if ({isPlayer _x} count (player nearEntities ["AllVehicles",5]) > 1) then {true} else {false};
_zedCheck = if ((count (player nearEntities ["zZombie_Base",10]) > 0) && !_isPZombie) then {true} else {false};
Switch true do {
switch true do {
case (_playerCheck) : {
_btnAbort ctrlEnable false;
_btnAbort ctrlSetText format["%1 (in 30)", _btnAbortText];
cutText [localize "str_abort_playerclose", "PLAIN DOWN"];
};
case (isInTraderCity) : {
_btnAbort ctrlEnable false;
cutText [(localize "str_epoch_player_12"), "PLAIN DOWN"];
_sleep = 1;
};
/*case (_zedCheck) : {
case (_zedCheck) : {
_btnAbort ctrlEnable false;
_btnAbort ctrlSetText format["%1 (in 10)", _btnAbortText];
cutText [localize "str_abort_zedsclose", "PLAIN DOWN"];
};*/
case (_inCombat and !_playerCheck) : {
};
case (_inCombat && !_zedCheck && !_playerCheck) : {
_btnAbort ctrlEnable false;
_btnAbort ctrlSetText format["%1 (in %2)", _btnAbortText, ceil (_timeout - diag_tickTime)];
};
case (_timeOut < _timeMax) : {
case (isInTraderCity) : {
_btnAbort ctrlEnable false;
_btnAbort ctrlSetText format["%1 (in %2)", _btnAbortText, (ceil ((_timeMax - diag_tickTime)*10)/10)];
cutText ["", "PLAIN DOWN"];
_sleep = 0.1;
cutText [localize "str_epoch_player_12","PLAIN DOWN"];
};
default {
_btnAbort ctrlEnable true;
@@ -61,5 +53,4 @@ while {(!isNull _display) and !r_player_dead} do {
uiSleep 1;
};
if (r_player_dead) exitWith {_btnAbort ctrlEnable true;};
if (r_player_dead) exitWith {_btnAbort ctrlEnable true;};

View File

@@ -1,7 +1,7 @@
/*
[_obj] call player_packTent;
*/
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_13") , "PLAIN DOWN"]; };
if (DZE_ActionInProgress) exitWith {cutText [localize "str_epoch_player_13","PLAIN DOWN"];};
DZE_ActionInProgress = true;
_obj = _this;
@@ -20,9 +20,9 @@ s_player_packtent = -1;
player removeAction s_player_packtentinfected;
s_player_packtentinfected = -1;
if(_objectID == "0" && _objectUID == "0") exitWith {DZE_ActionInProgress = false; s_player_packtent = -1; cutText [(localize "str_epoch_player_14"), "PLAIN DOWN"];};
if (_objectID == "0" && _objectUID == "0") exitWith {DZE_ActionInProgress = false; s_player_packtent = -1; cutText [localize "str_epoch_player_14","PLAIN DOWN"];};
if(_ownerID != dayz_characterID) exitWith {DZE_ActionInProgress = false; s_player_packtent = -1; cutText [localize "str_fail_tent_pack", "PLAIN DOWN"];};
if (_ownerID != dayz_characterID) exitWith {DZE_ActionInProgress = false; s_player_packtent = -1; cutText [localize "str_fail_tent_pack", "PLAIN DOWN"];};
_alreadyPacking = _obj getVariable["packing",0];
@@ -31,7 +31,7 @@ if (_alreadyPacking == 1) exitWith {DZE_ActionInProgress = false; s_player_packt
_campitems = ["IC_DomeTent","IC_Tent"];
if (_ownerID == dayz_characterID or (typeOf _obj in _campitems)) then { _pickup = true; };
if(_pickup) then {
if (_pickup) then {
_obj setVariable["packing",1];
_dir = direction _obj;

View File

@@ -3,7 +3,7 @@
*/
private ["_activatingPlayer","_obj","_ownerID","_objectID","_objectUID","_alreadyPacking","_location1","_location2","_dir","_pos","_bag","_holder","_weapons","_magazines","_backpacks","_objWpnTypes","_objWpnQty","_countr","_packedClass","_text","_playerNear"];
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_15") , "PLAIN DOWN"]; };
if (DZE_ActionInProgress) exitWith {cutText [localize "str_epoch_player_15","PLAIN DOWN"];};
DZE_ActionInProgress = true;
_activatingPlayer = player;
@@ -19,7 +19,7 @@ if(isNull _obj || !(alive _obj)) exitWith { DZE_ActionInProgress = false; };
_playerNear = _obj call dze_isnearest_player;
if(_playerNear) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_16") , "PLAIN DOWN"]; };
if(_playerNear) exitWith {DZE_ActionInProgress = false; cutText [localize "str_epoch_player_16","PLAIN DOWN"];};
_ownerID = _obj getVariable["CharacterID","0"];
_objectID = _obj getVariable["ObjectID","0"];

View File

@@ -18,7 +18,7 @@ if ((_hasRawMeat) && (_hasdog == "false")) then {
_target removeAction _id;
player setvariable ["dogid", _fsmid];
} else {
cutText [(localize "str_epoch_player_18"), "PLAIN DOWN"];
cutText [localize "str_epoch_player_18","PLAIN DOWN"];
};
//handle publicVariables here later.

View File

@@ -205,7 +205,7 @@ TraderDialogBuy = {
private ["_index", "_item", "_data"];
_index = _this select 0;
if (_index < 0) exitWith {
cutText [(localize "str_epoch_player_6"), "PLAIN DOWN"];
cutText [localize "str_epoch_player_6","PLAIN DOWN"];
};
_item = TraderItemList select _index;
_data = [_item select 0, _item select 3, 1, _item select 2, "buy", _item select 4, _item select 1, _item select 8];
@@ -217,7 +217,7 @@ TraderDialogSell = {
private ["_index", "_item", "_data"];
_index = _this select 0;
if (_index < 0) exitWith {
cutText [(localize "str_epoch_player_6"), "PLAIN DOWN"];
cutText [localize "str_epoch_player_6","PLAIN DOWN"];
};
_item = TraderItemList select _index;
_data = [_item select 6, _item select 0, _item select 5, 1, "sell", _item select 1, _item select 7, _item select 8];

View File

@@ -193,7 +193,7 @@ TraderDialogBuy = {
private ["_index", "_item", "_data"];
_index = _this select 0;
if (_index < 0) exitWith {
cutText [(localize "str_epoch_player_6"), "PLAIN DOWN"];
cutText [localize "str_epoch_player_6","PLAIN DOWN"];
};
_item = TraderItemList select _index;
_data = [_item select 0, _item select 3, 1, _item select 2, "buy", _item select 4, _item select 1, _item select 8];
@@ -205,7 +205,7 @@ TraderDialogSell = {
private ["_index", "_item", "_data"];
_index = _this select 0;
if (_index < 0) exitWith {
cutText [(localize "str_epoch_player_6"), "PLAIN DOWN"];
cutText [localize "str_epoch_player_6","PLAIN DOWN"];
};
_item = TraderItemList select _index;
_data = [_item select 6, _item select 0, _item select 5, 1, "sell", _item select 1, _item select 7, _item select 8];

View File

@@ -5,37 +5,32 @@
*/
private ["_display","_obj","_objectCharacterID"];
if(!isNil "DZE_DYN_UnlockDoorInprogress") exitWith { cutText [(localize "str_epoch_player_21") , "PLAIN DOWN"]; };
if (!isNil "DZE_DYN_UnlockDoorInprogress") exitWith {cutText [localize "str_epoch_player_21","PLAIN DOWN"];};
DZE_DYN_UnlockDoorInprogress = true;
if(!isNull dayz_selectedDoor) then {
if (!isNull dayz_selectedDoor) then {
if (!isNil 'KeyCodeTryTimer') then {
if(diag_tickTime > KeyCodeTryTimer) then {
if (diag_tickTime > KeyCodeTryTimer) then {
KeyCodeTry = nil;
KeyCodeTryTimer = nil;
};
};
// our target
_obj = dayz_selectedDoor;
_obj = dayz_selectedDoor; // our target
_notNearestPlayer = _obj call dze_isnearest_player;
if (_notNearestPlayer) then {
// close display since another player is closer
_display = findDisplay 41144;
_display closeDisplay 3000;
cutText [(localize "STR_EPOCH_ACTIONS_16"), "PLAIN DOWN"];
cutText [localize "STR_EPOCH_ACTIONS_16","PLAIN DOWN"];
} else {
// get object combination
_objectCharacterID = _obj getVariable ["CharacterID","0"];
// Check combination
if (DZE_Lock_Door == _objectCharacterID) then {
[player,"combo_unlock",0,false] call dayz_zombieSpeak;
// close display
@@ -43,43 +38,34 @@ if(!isNull dayz_selectedDoor) then {
_display closeDisplay 3000;
// unlock if locked
if(_obj animationPhase "Open_hinge" == 0) then {
if (_obj animationPhase "Open_hinge" == 0) then {
_obj animate ["Open_hinge", 1];
};
if(_obj animationPhase "Open_latch" == 0) then {
if (_obj animationPhase "Open_latch" == 0) then {
_obj animate ["Open_latch", 1];
};
KeyCodeTry = nil;
} else {
[10,10] call dayz_HungerThirst;
DZE_Lock_Door = "";
[player,"combo_locked",0,false] call dayz_zombieSpeak;
[player,20,true,(getPosATL player)] spawn player_alertZombies;
if (isNil 'KeyCodeTry') then {KeyCodeTry = 0;};
KeyCodeTry = KeyCodeTry + 1;
if (!isNil 'KeyCodeTryTimer') then {KeyCodeTryTimer = diag_tickTime+10;};
if(KeyCodeTry >= ((round(random 4)) + 4)) then {
if (isNil 'KeyCodeTryTimer') then {KeyCodeTryTimer = diag_tickTime+10;};
cutText [(localize "str_epoch_player_19"), "PLAIN DOWN"];
if (KeyCodeTry >= ((round(random 4)) + 4)) then {
if (isNil 'KeyCodeTryTimer') then {KeyCodeTryTimer = diag_tickTime+10;};
cutText [localize "str_epoch_player_19","PLAIN DOWN"];
_display = findDisplay 41144;
_display closeDisplay 3000;
};
};
};
} else {
// close display since no target
_display = findDisplay 41144;
_display closeDisplay 3000;
};
DZE_DYN_UnlockDoorInprogress = nil;
DZE_DYN_UnlockDoorInprogress = nil;

View File

@@ -5,28 +5,29 @@
*/
private ["_objectID","_objectUID","_obj","_ownerID","_dir","_pos","_holder","_weapons","_magazines","_backpacks","_objWpnTypes","_objWpnQty","_countr","_alreadyPacking","_playerNear","_playerID","_claimedBy","_unlockedClass","_text","_nul","_objType"];
if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_21") , "PLAIN DOWN"]; };
if (DZE_ActionInProgress) exitWith {cutText [localize "str_epoch_player_21","PLAIN DOWN"];};
DZE_ActionInProgress = true;
{player removeAction _x} count s_player_combi;s_player_combi = [];
{player removeAction _x} count s_player_combi;
s_player_combi = [];
s_player_unlockvault = 1;
_obj = _this;
_objType = typeOf _obj;
if (!(_objType in DZE_LockedStorage)) exitWith {
if !(_objType in DZE_LockedStorage) exitWith {
s_player_unlockvault = -1;
DZE_ActionInProgress = false;
};
_playerNear = _obj call dze_isnearest_player;
if(_playerNear) exitWith { DZE_ActionInProgress = false; cutText [(localize "str_epoch_player_20") , "PLAIN DOWN"]; };
if (_playerNear) exitWith {DZE_ActionInProgress = false; cutText [localize "str_epoch_player_20","PLAIN DOWN"];};
// Silently exit if object no longer exists || alive
if(isNull _obj || !(alive _obj)) exitWith { DZE_ActionInProgress = false; };
if (isNull _obj || !(alive _obj)) exitWith { DZE_ActionInProgress = false; };
_unlockedClass = getText (configFile >> "CfgVehicles" >> _objType >> "unlockedClass");
_text = getText (configFile >> "CfgVehicles" >> _objType >> "displayName");
_text = getText (configFile >> "CfgVehicles" >> _objType >> "displayName");
_alreadyPacking = _obj getVariable["packing",0];
_claimedBy = _obj getVariable["claimed","0"];
@@ -48,9 +49,9 @@ if ((_ownerID == dayz_combination) || (_ownerID == dayz_playerUID)) then {
};
_dir = direction _obj;
_pos = _obj getVariable["OEMPos",(getposATL _obj)];
_objectID = _obj getVariable["ObjectID","0"];
_objectUID = _obj getVariable["ObjectUID","0"];
_pos = _obj getVariable["OEMPos",getPosATL _obj];
_objectID = _obj getVariable["ObjectID","0"];
_objectUID = _obj getVariable["ObjectUID","0"];
_claimedBy = _obj getVariable["claimed","0"];
@@ -66,9 +67,9 @@ if ((_ownerID == dayz_combination) || (_ownerID == dayz_playerUID)) then {
_obj setVariable["packing",1];
[1,1] call dayz_HungerThirst;
_weapons = _obj getVariable["WeaponCargo",[]];
_magazines = _obj getVariable["MagazineCargo",[]];
_backpacks = _obj getVariable["BackpackCargo",[]];
_weapons = _obj getVariable["WeaponCargo",[]];
_magazines = _obj getVariable["MagazineCargo",[]];
_backpacks = _obj getVariable["BackpackCargo",[]];
player playActionNow "Medic";
uiSleep 1;
[player,"tentpack",0,false] call dayz_zombieSpeak;
@@ -88,8 +89,8 @@ if ((_ownerID == dayz_combination) || (_ownerID == dayz_playerUID)) then {
if (count _weapons > 0) then {
//Add weapons
_objWpnTypes = _weapons select 0;
_objWpnQty = _weapons select 1;
_objWpnTypes = _weapons select 0;
_objWpnQty = _weapons select 1;
_countr = 0;
{
_holder addweaponcargoGlobal [_x,(_objWpnQty select _countr)];
@@ -103,7 +104,7 @@ if ((_ownerID == dayz_combination) || (_ownerID == dayz_playerUID)) then {
_objWpnQty = _magazines select 1;
_countr = 0;
{
if( _x != "CSGAS" ) then
if (_x != "CSGAS") then
{
_holder addmagazinecargoGlobal [_x,(_objWpnQty select _countr)];
_countr = _countr + 1;

View File

@@ -4,13 +4,13 @@
*/
private ["_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_removed","_tobe_removed_total","_textMissing","_num_removed","_removed_total","_temp_removed_array","_countr","_objectID","_objectUID","_location","_dir","_objectCharacterID","_weapons","_magazines","_backpacks","_classname","_object","_holder","_objWpnTypes","_objWpnQty","_newclassname","_requirements","_upgrade","_vehicle","_findNearestVehicles","_findNearestVehicle","_IsNearVehicle"];
if(DZE_ActionInProgress) exitWith { cutText [(localize "STR_EPOCH_PLAYER_52") , "PLAIN DOWN"]; };
if (DZE_ActionInProgress) exitWith {cutText [localize "STR_EPOCH_PLAYER_52","PLAIN DOWN"];};
DZE_ActionInProgress = true;
// This is used to find correct upgrade based what upgrades was called allows multiple upgrades per vehicle.
_upgrade = _this;
if (vehicle player != player) exitWith {DZE_ActionInProgress = false; cutText [(localize "STR_EPOCH_ACTIONS_18"), "PLAIN DOWN"]};
if (vehicle player != player) exitWith {DZE_ActionInProgress = false; cutText [localize "STR_EPOCH_ACTIONS_18","PLAIN DOWN"]};
// look for nearest empty vehicle
_findNearestVehicles = player nearEntities [["LandVehicle"],10];
@@ -113,7 +113,7 @@ if (_IsNearVehicle >= 1) then {
_objectUID = _vehicle getVariable ["ObjectUID","0"];
if(_objectID == "0" && _objectUID == "0") then {
cutText [(localize "str_epoch_player_50"), "PLAIN DOWN"];
cutText [localize "str_epoch_player_50","PLAIN DOWN"];
}
else {
// Get position
@@ -128,7 +128,7 @@ if (_IsNearVehicle >= 1) then {
PVDZE_veh_Upgrade = [_vehicle,[_dir,_location],_newclassname,true,_objectCharacterID,player];
publicVariableServer "PVDZE_veh_Upgrade";
cutText [(localize "STR_EPOCH_VEHUP_SUCCESS"), "PLAIN DOWN"];
cutText [localize "STR_EPOCH_VEHUP_SUCCESS","PLAIN DOWN"];
{player reveal _x;} count (player nearEntities [["LandVehicle"],10]);
};
}
@@ -144,15 +144,15 @@ if (_IsNearVehicle >= 1) then {
};
}
else {
cutText [(localize "str_epoch_player_82"), "PLAIN DOWN"];
cutText [localize "str_epoch_player_82","PLAIN DOWN"];
};
}
else {
cutText [(localize "str_epoch_player_245"), "PLAIN DOWN"];
cutText [localize "str_epoch_player_245","PLAIN DOWN"];
};
}
else {
cutText [(localize "STR_EPOCH_PLAYER_27"), "PLAIN DOWN"];
cutText [localize "STR_EPOCH_PLAYER_27","PLAIN DOWN"];
};
DZE_ActionInProgress = false;

View File

@@ -3,9 +3,10 @@ disableSerialization;
_control = _this select 0;
_button = _this select 1;
_parent = findDisplay 106;
_itemData = gearSlotData _control;
if (carryClick) then {carryClick = false;};
if (!DZE_SelfTransfuse && ((gearSlotData _control) in DZE_BloodBags)) exitWith {};
if (!DZE_SelfTransfuse && {(_itemData == "ItemBloodbag") or (_itemData in DZE_typedBags)}) exitWith {};
if (_button == 1) then {
private ["_conf","_name","_compile","_height","_item"];
_group = _parent displayCtrl 6902;