Missing Files

This commit is contained in:
icomrade
2016-02-29 00:55:29 -05:00
parent 64c251d95d
commit 84eb6f815a
75 changed files with 6780 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
_object_type = typeOf cursorTarget;
_fuellevels = fuel cursorTarget;
_dmglevels = damage cursorTarget;
//remove action menu
player removeAction s_player_debugCheck;
s_player_debugCheck = -1;
hintSilent format ["Object: %1, Fuel: %2, Damage: %3", _object_type, _fuellevels, _dmglevels];
diag_log format ["Object: %1, Fuel: %2, Damage: %3", _object_type, _fuellevels, _dmglevels];

View File

@@ -0,0 +1,14 @@
private["_bombData","_vehicle","_owner","_bombar"];
_bombData = _this select 0;
_vehicle = _bombData select 0;
_owner = _bombData select 1;
_vehicle setVariable ["hasBomb",true,true];
_vehicle addEventHandler ["GetIn",{
//diag_log str(_this);
sleep 2;
_bombCar = _this select 0;
_bomb = createVehicle ["Bo_GBU12_lgb",getPosATL _bombCar, [], 0, "NONE"];
}];

View File

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

View File

@@ -0,0 +1,173 @@
private ["_cursorTarget","_onLadder","_isWater","_alreadyRemoving","_characterID","_objectID","_objectUID","_ownerArray","_dir",
"_realObjectStillThere","_upgrade","_entry","_parent","_requiredParts","_requiredTools","_model","_toolsOK","_displayname",
"_whpos","_i","_wh","_object"];
_cursorTarget = _this select 3;
// ArmaA2 bug workaround: sometimes the object is null
if ((isNil "_cursorTarget") or {(isNull _cursorTarget)}) then {
_cursorTarget = nearestObjects [ player modelToWorld [0,1.5,0] , ["DZ_buildables","BuiltItems"], 1.5];
_cursorTarget = if (count _cursorTarget == 0) then { objNull } else { _cursorTarget select 0 };
};
if(isNull _cursorTarget) exitWith {
//cutText [localize "str_disassembleNoOption", "PLAIN DOWN"];
_msg = localize "str_disassembleNoOption";
_msg call dayz_rollingMessages;
};
//Remove action Menu
player removeAction s_player_disassembly;
s_player_disassembly = -1;
//Normal blocked stuff
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming;
if(_isWater or _onLadder) exitWith {
_msg = localize "str_disassembleInProgress";
_msg call dayz_rollingMessages;
};
_alreadyRemoving = _cursorTarget getVariable["ObjectLocked",0];
if (_alreadyRemoving == 1) exitWith {
_msg = localize "str_disassembleInProgress";
_msg call dayz_rollingMessages;
};
_cursorTarget setVariable["ObjectLocked",1,true];
_characterID = _cursorTarget getVariable ["characterID","0"];
_objectID = _cursorTarget getVariable ["ObjectID","0"];
_objectUID = _cursorTarget getVariable ["ObjectUID","0"];
_ownerArray = _cursorTarget getVariable ["ownerArray",[]];
_dir = round getDir _cursorTarget;
_vector = [vectorDir _cursorTarget,vectorUp _cursorTarget];
_pos = getposATL _cursorTarget;
if (((_vector select 1) select 2) - 1 > 0.001) then { _pos set [2,0]; };
_realObjectStillThere = true;
_upgrade = typeOf _cursorTarget;
_entry = configFile >> "CfgVehicles" >> _upgrade;
r_interrupt = false;
for "_i" from 1 to 20 do {
_parent = inheritsFrom _entry;
_requiredParts = [] + (getArray (_parent >> "Upgrade" >> "requiredParts"));
_requiredTools = [] + (getArray (_parent >> "Upgrade" >> "requiredTools"));
_model = getText (_parent >> "model"); // model of parent
_displayname = getText (_entry >> "displayName"); // name of current
diag_log format["%1 - %2 - %3 - %4 - %5",_parent,_requiredParts,_requiredTools,_model,_displayname];
// check the tools needed
_toolsOK = true;
{
if (!(_x IN items player)) exitWith { _toolsOK = false; };
} count _requiredTools;
if (!_toolsOK) exitWith {
//cutText [format [localize "str_disassembleMissingTool",getText (configFile >> "CfgWeapons" >> _x >> "displayName"),_displayname], "PLAIN DOWN"];//["Missing %1 to disassemble %2."
_msg = format [localize "str_disassembleMissingTool",getText (configFile >> "CfgWeapons" >> _x >> "displayName"),_displayname];
_msg call dayz_rollingMessages;
};
if (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "disableWeapons") == 0) then {
player playActionNow "Medic";
_dis=20;
[player,"tentpack",0,false,20] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
//wait animation starts and block
waitUntil {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "disableWeapons") == 1};
};
// remove object
deleteVehicle _cursorTarget;
_cursorTarget = objNull;
if (_realObjectStillThere) then { // send to server the destroy request
_realObjectStillThere = false;
PVDZ_obj_Destroy = [_objectID,_objectUID];
publicVariableServer "PVDZ_obj_Destroy";
diag_log [diag_ticktime, __FILE__, "Networked object, request to destroy", PVDZ_obj_Destroy];
};
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
// check whether we reached the base class, for which no P3D is defined
if (count _requiredParts == 0) exitwith {
diag_log [diag_ticktime, __FILE__, "Dismantle terminated, last building deleted is:", _upgrade];
};
// create a weaponholder with dismissed parts
_whpos=player modelToWorld [2 * sin(30*_i), 2 * cos(30*_i), 0];
_whpos set [2,0];
_wh = createVehicle ["WeaponHolder", _whpos, [], 0, "CAN_COLLIDE"];
_wh setDir (30*_i);
_wh setPosATL _whpos;
{
if (isClass (configFile >> "CfgMagazines" >> _x))
then { _wh addMagazineCargoGlobal [_x, 1]; }
else { _wh addWeaponCargoGlobal [_x, 1]; };
} forEach _requiredParts;
diag_log [diag_ticktime, __FILE__, "Pile created with:", _requiredParts];
// create the parent object locally
_upgrade = configName _parent;
if (getNumber(_parent >> "scope")==2) then {
_cursorTarget = _upgrade createVehicleLocal getMarkerpos "respawn_west";
_cursorTarget setVectorDirAndUp _vector;
_cursorTarget setPosATL _pos;
};
sleep 1.5;
if (r_interrupt) exitwith {
diag_log [diag_ticktime, __FILE__, "Operation interrupted, last building deleted is:", _upgrade];
};
_entry = _parent;
};
// wait animation ends
waitUntil {r_interrupt or (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "disableWeapons") == 0)};
if (r_interrupt and vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
r_interrupt = false;
};
if (!_realObjectStillThere) then {
// current object is a local one, replace it by a networked one, with all attributes
// and request a HIVE save
if (!isNull _cursorTarget) then {
_upgrade = typeOf _cursorTarget;
deleteVehicle _cursorTarget;
if (getNumber(_parent >> "scope")==2) then {
_object = createVehicle [_upgrade, getMarkerpos "respawn_west", [], 0, "CAN_COLLIDE"];
if (_object isKindOf "DZ_buildables") then { _object allowDamage false; };
_object setVectorDirAndUp _vector;
_object setPosATL _pos;
_puid = getPlayerUID player;
if (!(_puid in _ownerArray)) then {
_ownerArray set [ count _ownerArray, _puid ];
};
_object setVariable ["ownerArray",_ownerArray,true];
_variables = [[ "ownerArray", _ownerArray]];
_object setVariable ["characterID",_characterID,true];
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir, _pos],_variables];
publicVariableServer "PVDZ_obj_Publish";
diag_log [diag_ticktime, __FILE__, "New Networked object, request to save to hive. PVDZ_obj_Publish:", PVDZ_obj_Publish];
/*
//Send maintenance info
PVDZ_veh_Save = [_object,"maintenance"];
publicVariableServer "PVDZ_veh_Save";*/
player reveal _object;
};
};
};
_msg = localize "str_disassembleDone";
_msg call dayz_rollingMessages;
//cutText [localize "str_disassembleDone", "PLAIN DOWN"];
_cursorTarget setVariable["ObjectLocked",0,true];

View File

@@ -0,0 +1,173 @@
private ["_object","_proceed","_pos","_rndattemps","_limit","_dismantleToo","_pos","_ownerID","_objectID","_objectUID","_playerID","_claimedBy","_tools"];
_object = _this;
_proceed = false;
_exit = false;
//Random times to run
_rndattemps = getNumber (configFile >> "CfgVehicles" >> (typeOf _object) >> "dismantle" >> "attempts");
_limit = 1 + round(random _rndattemps);
//Dismantle magazine type
_dismantleToo = getText (configFile >> "CfgVehicles" >> (typeOf _object) >> "dismantle" >> "dismantleToo");
//Object location
_pos = getposATL _object;
//Object info
_ownerID = _object getVariable["CharacterID","0"];
_objectID = _object getVariable["ObjectID","0"];
_objectUID = _object getVariable["ObjectUID","0"];
//Playerinfo
_playerID = getPlayerUID player;
//Block
_claimedBy = _object getVariable "claimed";
if (isnil "claimed") then {
_object setVariable["claimed",_playerID,true];
};
//Tools
_tools = getArray (configFile >> "CfgVehicles" >> (typeOf _object) >> "dismantle" >> "requiredtools");
{
private ["_end"];
if ((_x select 0) in items player) then {_end = false;} else { cutText [format ["Missing tool %1 to dismantle",(_x select 0)] , "PLAIN DOWN"]; _end = true; _proceed = false; };
if (_end) exitwith { _exit = true; };
} foreach _tools;
//End missing tools
if (_exit) exitwith {};
//Normal blocked stuff
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming;
if(_isWater or _onLadder) exitWith {
//cutText ["unable to upgrade at this time", "PLAIN DOWN"];
titleText [localize "str_CannotUpgrade"];
};
//Start loop
_isOk = true;
//Counter
_counter = 0;
while {_isOk} do {
//Check if we have the tools to start
{
private ["_end"];
if ((_x select 0) in items player) then {_end = false;} else { cutText [format ["Missing tool %1 to dismantle",_x] , "PLAIN DOWN"]; _end = true; _proceed = false; };
if (_end) exitwith { _exit = true; };
}foreach _tools;
if (_exit) exitwith {};
_claimedBy = _object getVariable["claimed","0"];
if (_claimedBy != _playerID) exitWith { cutText [format [localize "str_player_beinglooted",_text] , "PLAIN DOWN"]; };
//Run animation
player playActionNow "Medic";
//Run SFX
_dis=20;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
// Working-Factor for chopping wood.
["Working",0,[100,15,10,0]] call dayz_NutritionSystem;
//Setup Vars
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
//run animation loop
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt or (player getVariable["combattimeout", 0] >= time)) then {
r_doLoop = false;
_finished = false;
};
sleep 0.1;
};
r_doLoop = false;
//Interrupt and end
if(!_finished) exitWith {
_isOk = false;
_proceed = false;
};
//Everything happened as it should
if(_finished) then {
//Add to Counter
_counter = _counter + 1;
//Try to dismantle
if ([0.01] call fn_chance) then {
//stop loop
_isOk = false;
//Set Done var
_proceed = true;
};
};
//Chances to damage tools
{
if ([(_x select 1)] call fn_chance) then {
player removeWeapon (_x select 0);
player addWeapon (_x select 2);
titleText ["Your tool has been damaged." , "PLAIN DOWN"];
};
}foreach _tools;
if(_counter == _limit) exitWith {
//stop loop
_isOk = false;
//Set Done var
_proceed = true;
};
titleText [format["Dismantle attempt (%1 of %2).", _counter,_limit], "PLAIN DOWN"];
sleep 0.10;
};
//Completed and successful
if (_proceed) then {
_claimedBy = _object getVariable["claimed","0"];
if (_claimedBy != _playerID) exitWith { cutText [format [localize "str_player_beinglooted",_text] , "PLAIN DOWN"]; };
titleText [format["Dismantled, (%1).", (typeOf _object)], "PLAIN DOWN"];
PVDZ_obj_Destroy = [_objectID,_objectUID];
publicVariableServer "PVDZ_obj_Destroy";
if (isServer) then {
PVDZ_obj_Destroy call server_deleteObj;
};
//Need to update for sanity no client should ever create or delete anything
deleteVehicle _object;
//PVDZ_obj_Create = ["WeaponHolder",_pos,["ItemTankTrap"]];
//publicVariableServer "PVDZ_obj_Create";
_holder = createVehicle ["WeaponHolder", _pos, [], 0, "CAN_COLLIDE"];
_holder addmagazinecargoGlobal [_dismantleToo,1];
};

View File

@@ -0,0 +1,112 @@
/*
Upkeep on built items.
*/
#define MAINTENANCE_NUTRITION_VALUES [20,40,15,0]
private ["_isMedic","_cursorTarget"];
_cursorTarget = _this select 3;
// ArmaA2 bug workaround: sometimes the object is null
if ((isNil "_cursorTarget") or {(isNull _cursorTarget)}) then {
_cursorTarget = nearestObjects [ player modelToWorld [0,1.5,0] , ["DZ_buildables","BuiltItems"], 1.5];
_cursorTarget = if (count _cursorTarget == 0) then { objNull } else { _cursorTarget select 0 };
};
if(isNull _cursorTarget) exitWith {
cutText ["No maintenance options", "PLAIN DOWN"];
};
//Remove action Menu
player removeAction s_player_maintenance;
s_player_maintenance = -1;
//Item
_item = typeof _cursorTarget;
//diag_log (str(_item));
_classname = configFile >> "CfgVehicles" >> _item;
_displayname = getText (_classname >> "displayname");
//Get tools needed
_requiredTools = getArray (_classname >> "Maintenance" >> "requiredTools");
//diag_log (str(_requiredTools));
//get parts needed
_requiredParts = getArray (_classname >> "Maintenance" >> "requiredParts");
//diag_log (str(_requiredParts));
//Normal blocked stuff
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming;
_upgradeParts = [];
_startMaintenance = true;
if(_isWater or _onLadder) exitWith {
cutText ["Unable to proceed", "PLAIN DOWN"];
};
// lets check player has requiredTools for upgrade
{
if (!(_x IN items player)) exitWith {
cutText[ format[ localize "str_maintenanceMissingTool",_x], "PLAIN DOWN"]; //"Missing %1 to do maintenance %2."
_startMaintenance = false;
};
} count _requiredTools;
// lets check player has requiredParts for upgrade
{
if (!(_x IN magazines player)) exitWith {
cutText[ format[ localize "str_maintenanceMissingPart",_x,_displayname], "PLAIN DOWN"]; //"Missing %1 to maintenance %2."
_startMaintenance = false;
};
} count _requiredParts;
if (_startMaintenance) then {
//play animation
player playActionNow "Medic";
_dis=20;
_sfx = "tentpack";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
["Working",0,MAINTENANCE_NUTRITION_VALUES] call dayz_NutritionSystem; // Added Nutrition-Factor for work
{ player removeMagazine _x; } count _requiredParts;
//Animation Loop
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isRefuel = ["medic",_animState] call fnc_inString;
if (_isRefuel) then {
_started = true;
};
if (_started and !_isRefuel) then {
r_doLoop = false;
_finished = true;
};
sleep 0.1;
};
r_doLoop = false;
if (_finished) then {
if (isServer) then {
PVDZ_veh_Save call server_updateObject;
} else {
PVDZ_veh_Save = [_cursorTarget,"maintenance"];
publicVariableServer "PVDZ_veh_Save";
};
PVDZ_object_replace = [_cursorTarget];
publicVariableServer "PVDZ_object_replace";
};
cutText [localize "str_maintenanceDone", "PLAIN DOWN"];
};

View File

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

View File

@@ -0,0 +1,241 @@
/*
This script is not part of dayz permission must be given to use. r4z0r49@gmail.com or skype me R4Z0R49.
Simple class system to use this script.
class Upgrade {
requiredTools[] = {"ItemToolbox"};
requiredParts[] = {"equip_crate","PartWoodPile"};
create = "TentStorage1";
};
*/
private
[
"_objclass",
"_cursorTarget",
"_item",
"_classname",
"_requiredTools",
"_requiredParts",
"_upgrade",
"_upgradeConfig",
"_upgradeDisplayname",
"_onLadder",
"_isWater",
"_upgradeParts",
"_startUpgrade",
"_missingPartsConfig",
"_textMissingParts",
"_dis",
"_sfx",
"_ownerID",
"_objectID",
"_objectUID",
"_alreadyupgrading",
"_pos",
"_dir",
"_weapons",
"_magazines",
"_backpacks",
"_object",
"_objWpnTypes",
"_objWpnQty",
"_countr"
];
_objclass = _this;
_cursorTarget = _this select 3;
_item = typeof _cursorTarget;
//diag_log (str(_item));
//remove action menu
player removeAction s_player_upgradestroage;
s_player_upgradestroage = -1;
//Not needed
//_itemName = getText (configFile >> "CfgVehicles" >> _item >> "displayName");
////diag_log (str(_itemName));
//Get tools needed
_classname = configFile >> "CfgVehicles" >> _item;
_requiredTools = getArray (_classname >> "Upgrade" >> "requiredTools");
//diag_log (str(_requiredTools));
//get parts needed
_requiredParts = getArray (_classname >> "Upgrade" >> "requiredParts");
//diag_log (str(_requiredParts));
//get item to create
_upgrade = getText (_classname >> "Upgrade" >> "create");
//diag_log (str(_upgrade));
//Display name of upgrade part
_upgradeConfig = configFile >> "CfgVehicles" >> _upgrade;
//diag_log (str(_upgradeConfig));
_upgradeDisplayname = getText (_upgradeConfig >> "displayName");
//diag_log (str(_upgradeDisplayname));
//Normal blocked stuff
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming;
_upgradeParts = [];
_startUpgrade = true;
if(_isWater or _onLadder) exitWith {
//cutText ["unable to upgrade at this time", "PLAIN DOWN"];
_msg = localize "str_CannotUpgrade";
_msg call dayz_rollingMessages;
};
// lets check player has requiredTools for upgrade
{
if (!(_x IN items player)) exitWith {
_missingPartsConfig = configFile >> "CfgWeapons" >> _x;
_textMissingParts = getText (_missingPartsConfig >> "displayName");
_msg = format ["Missing %1 to upgrade storage.", _textMissingParts];
_msg call dayz_rollingMessages;
_startUpgrade = false;
};
} count _requiredTools;
// lets check player has requiredParts for upgrade
{
if (!(_x IN magazines player)) exitWith {
_missingPartsConfig = configFile >> "CfgMagazines" >> _x;
_textMissingParts = getText (_missingPartsConfig >> "displayName");
_msg = format ["Missing %1 to upgrade storage.", _textMissingParts];
_msg call dayz_rollingMessages;
_startUpgrade = false;
};
if (_x IN magazines player) then {
_upgradeParts set [count _upgradeParts, _x];
};
} count _requiredParts;
//Does object have a upgrade option.
if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
//play animation
player playActionNow "Medic";
_dis = 20;
_sfx = "tentpack";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
// Added Nutrition-Factor for work
["Working",0,[100,15,5,0]] call dayz_NutritionSystem;
//get ownerID from old tent.
_ownerID = _cursorTarget getVariable ["characterID","0"];
_objectID = _cursorTarget getVariable ["ObjectID","0"];
_objectUID = _cursorTarget getVariable ["ObjectUID","0"];
//Upgrade
_alreadyupgrading = _cursorTarget getVariable["alreadyupgrading",0];
if (_alreadyupgrading == 1) exitWith {
//cutText [localize "str_upgradeInProgress", "PLAIN DOWN"]
_msg = localize "str_upgradeInProgress";
_msg call dayz_rollingMessages;
};
_cursorTarget setVariable["alreadyupgrading",1];
sleep 0.03;
//Get location and direction of old item
_dir = round getDir _cursorTarget;
_vector = [vectorDir _cursorTarget,vectorUp _cursorTarget];
//reset orientation before measuring position, otherwise the new object will be placed incorrectly. -foxy
_cursorTarget setDir 0;
_pos = getPosATL _cursorTarget;
diag_log [ "dir/angle/pos", _dir, _vector, _pos];
if (abs(((_vector select 1) select 2) - 1) > 0.001) then { _pos set [2,0]; };
diag_log [ "dir/angle/pos - reset elevation if angle is straight", _dir, _vector, _pos];
//get contents
_weapons = getWeaponCargo _cursorTarget;
_magazines = getMagazineCargo _cursorTarget;
_backpacks = getBackpackCargo _cursorTarget;
//replay animation
player playActionNow "Medic";
//remove old tent
PVDZ_obj_Destroy = [_objectID,_objectUID];
publicVariableServer "PVDZ_obj_Destroy";
if (isServer) then {
PVDZ_obj_Destroy call server_deleteObj;
};
deleteVehicle _cursorTarget;
// remove parts from players inventory before creation of new tent.
{
player removeMagazine _x;
_upgradeParts = _upgradeParts - [_x];
} count _upgradeParts;
//create new tent
_object = createVehicle [_upgrade, getMarkerpos "respawn_west", [], 0, "CAN_COLLIDE"];
//reseting orientation to make sure the object goes where it's supposed to -foxy
_object setDir 0;
_object setPosATL _pos;
_object setVectorDirAndUp _vector;
//set ownerID from old tent.
_object setVariable ["characterID",_ownerID];
//Make sure player knows about the new object
player reveal _object;
//Add contents back
//Add Weapons
_objWpnTypes = _weapons select 0;
_objWpnQty = _weapons select 1;
_countr = 0;
{
_object addweaponcargoGlobal [_x,(_objWpnQty select _countr)];
_countr = _countr + 1;
} count _objWpnTypes;
//Add Magazines
_objWpnTypes = _magazines select 0;
_objWpnQty = _magazines select 1;
_countr = 0;
{
_object addmagazinecargoGlobal [_x,(_objWpnQty select _countr)];
_countr = _countr + 1;
} count _objWpnTypes;
//Add Backpacks
_objWpnTypes = _backpacks select 0;
_objWpnQty = _backpacks select 1;
_countr = 0;
{
_object addbackpackcargoGlobal [_x,(_objWpnQty select _countr)];
_countr = _countr + 1;
} count _objWpnTypes;
sleep 3;
//publish new tent
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir, _pos],[_weapons,_magazines,_backpacks]];
publicVariableServer "PVDZ_obj_Publish";
diag_log [diag_ticktime, __FILE__, "New Networked object, request to save to hive. PVDZ_obj_Publish:", PVDZ_obj_Publish];
//cutText [localize "str_upgradeDone", "PLAIN DOWN"];
_msg = localize "str_upgradeDone";
_msg call dayz_rollingMessages;
/*
} else {
cutText ["Object has no upgrade option.", "PLAIN DOWN"];
*/
};

View File

@@ -0,0 +1,179 @@
/*
This script is not part of dayz permission must be given to use. r4z0r49@gmail.com or skype me R4Z0R49.
Simple class system to use this script.
class Upgrade {
requiredTools[] = {"ItemToolbox"};
requiredParts[] = {"equip_crate","PartWoodPile"};
create = "TentStorage1";
};
debugged by facoptere@gmail.com
*/
//systemchat str _this;
if (!isnil "faco_object_upgradeBuilding") exitWith { _this call faco_object_upgradeBuilding };
_cursorTarget = _this select 3;
// ArmaA2 bug workaround: sometimes the object is null
if ((isNil "_cursorTarget") or {(isNull _cursorTarget)}) then {
_cursorTarget = nearestObjects [ player modelToWorld [0,1.5,0] , ["DZ_buildables","BuiltItems"], 1.5];
_cursorTarget = if (count _cursorTarget == 0) then { objNull } else { _cursorTarget select 0 };
};
if (isNull _cursorTarget) exitWith {};
player removeAction s_player_building;
s_player_building = -1;
_type = typeof _cursorTarget;
_class = configFile >> "CfgVehicles" >> _type;
_requiredTools = getArray (_class >> "Upgrade" >> "requiredTools");
_requiredParts = getArray (_class >> "Upgrade" >> "requiredParts");
_upgradeType = getText (_class >> "Upgrade" >> "create");
_producedParts = getArray (_class >> "Upgrade" >> "produce");
//Allow random choice of items if specified.
if (isArray(configFile >> "CfgVehicles" >> _type >> "Upgrade" >> "randomcreate")) then {
_randomCreate = getArray (_class >> "Upgrade" >> "randomcreate");
_upgradeType = _randomCreate call BIS_fnc_selectRandom;
};
_upgradeClass = configFile >> "CfgVehicles" >> _upgradeType;
if (!isClass _upgradeClass) exitWith {
//cutText [localize "str_upgradeNoOption", "PLAIN DOWN"];
_msg = localize "str_upgradeNoOption";
_msg call dayz_rollingMessages;
};
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming;
if(_isWater or _onLadder) exitWith {
//systemchat[localize "str_CannotUpgrade"];
_msg = localize "str_CannotUpgrade";
_msg call dayz_rollingMessages;
};
// lets check player has requiredTools for upgrade
_ok = true;
_missing = "";
{
if (!(_x IN items player)) exitWith {
//systemchat("Missing tools for upgrade." +str());
_missing = getText (configFile >> "CfgWeapons" >> _x >> "displayName");
_ok = false;
};
} count _requiredTools;
if (!_ok) exitWith {
//systemChat format[localize "str_upgradeMissingTool", _missing]; //"Missing %1 to upgrade building."
_msg = format [localize "str_upgradeMissingTool", _missing];
_msg call dayz_rollingMessages;
};
// lets check player has requiredParts for upgrade
_ok = true;
_upgradeParts = [];
{
if (!(_x IN magazines player)) exitWith {
_missing = getText (configFile >> "CfgMagazines" >> _x >> "displayName");
_ok = false;
};
if (_x IN magazines player) then {
_upgradeParts set [count _upgradeParts, _x];
player removeMagazine _x;
};
} count _requiredParts;
if (!_ok) exitWith {
{ player addMagazine _x; } foreach _upgradeParts;
//systemChat format[localize "str_upgradeMissingPart", _missing]; //"Missing %1 to upgrade building."
_msg = format [localize "str_upgradeMissingPart", _missing];
_msg call dayz_rollingMessages;
};
//Upgrade Started
if ((player getVariable["alreadyBuilding",0]) == 1) exitWith {
{ player addMagazine _x; } foreach _upgradeParts;
//cutText [localize "str_upgradeInProgress" , "PLAIN DOWN"]
_msg = localize "str_upgradeInProgress";
_msg call dayz_rollingMessages;
};
player setVariable["alreadyBuilding",1];
//play animation
player playActionNow "Medic";
_dis=20;
[player,"tentpack",0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
// Added Nutrition-Factor for work
["Working",0,[100,15,5,0]] call dayz_NutritionSystem;
//wait animation end
waitUntil {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "disableWeapons") == 1};
waitUntil {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "disableWeapons") == 0};
//get data from old building.
_characterID = _cursorTarget getVariable ["characterID","0"];
_objectID = _cursorTarget getVariable ["ObjectID","0"];
_objectUID = _cursorTarget getVariable ["ObjectUID","0"];
//Person who owns the fence can be disa,abled by this person.
_ownerArray = _cursorTarget getVariable ["ownerArray",[]];
//Get passcode of fence.
_ownerPasscode = _cursorTarget getVariable ["padlockCombination",[]];
_dir = round getDir _cursorTarget;
_vector = [vectorDir _cursorTarget,vectorUp _cursorTarget];
_pos = getposATL _cursorTarget;
//diag_log [ "dir/angle/pos", _dir, _vector, _pos];
if (abs(((_vector select 1) select 2) - 1) > 0.001) then { _pos set [2,0]; };
//diag_log [ "dir/angle/pos - reset elevation if angle is straight", _dir, _vector, _pos];
_object = createVehicle [_upgradeType, getMarkerpos "respawn_west", [], 0, "CAN_COLLIDE"];
if (_object isKindOf "DZ_buildables") then { _object allowDamage false; };
_object setVectorDirAndUp _vector;
_object setPosATL _pos;
_puid = getPlayerUID player;
/*
if (!(_puid in _clanArray)) then {
_clanArray set [ count _clanArray, _puid ];
};
*/
_object setVariable ["ownerArray",_ownerArray,true];
_object setVariable ["padlockCombination",_ownerPasscode,true];
_object setVariable ["characterID",_characterID,true];
//remove old object
deleteVehicle _cursorTarget;
PVDZ_obj_Destroy = [_objectID,_objectUID];
publicVariableServer "PVDZ_obj_Destroy";
// create a weaponholder with dismissed parts
_wh = "WeaponHolder" createVehicle (getPosATL player);
{
if (isClass (configFile >> "CfgMagazines" >> _x))
then { _wh addMagazineCargoGlobal [_x, 1]; }
else { _wh addWeaponCargoGlobal [_x, 1]; };
} forEach _producedParts;
//publish new object
_variables = [["ownerArray", _ownerArray],["padlockCombination", _ownerPasscode]];
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir, _pos],_variables];
publicVariableServer "PVDZ_obj_Publish";
diag_log [diag_ticktime, __FILE__, "New Networked object, request to save to hive. PVDZ_obj_Publish:", PVDZ_obj_Publish];
/*
//Send maintenance info
PVDZ_veh_Save = [_object,"maintenance"];
publicVariableServer "PVDZ_veh_Save";
if (isServer) then {
PVDZ_veh_Save call server_updateObject;
};*/
//Make sure player knows about the new object
player reveal _object;
//Make sure its unlocked
player setVariable["alreadyBuilding",0];
//cutText [localize "str_upgradeDone", "PLAIN DOWN"];
_msg = localize "str_upgradeDone";
_msg call dayz_rollingMessages;

View File

@@ -0,0 +1,11 @@
private ["_unit","_unconcious","_inVeh","_alive"];
call fnc_usec_medic_removeActions;
_unit = _this select 3;
_unconcious = _unit getVariable ["NORRN_unconscious", false];
_inVeh = vehicle player != player;
_alive = alive _unit;
if (_unconcious && !_inVeh && _alive) then {
player action ["Gear", _unit];
};

View File

@@ -0,0 +1,79 @@
/*
Created by Alby exclusively for DayZMod.
Please request permission to use/alter from Alby.
*/
private["_config","_input","_output","_required","_failChance","_hasInput","_availabeSpace"];
disableSerialization;
["close"] call fn_updateCraftUI;
_config = _this select 0;
_overwrite = _this select 1;
_input = getArray (_config >> "input");
_required = getArray (_config >> "toolsRequired");
_orignalClass = getText (_config >> "orignalclass");
//diag_log (str(_this));
if (count _overwrite > 0) then {
{
_index = _x select 0;
_entry = _x select 1;
_input set [_index, _entry];
}forEach _overwrite;
};
//done from player inventory
_hasInput = true;
{
private ["_avail"];
_selection = _x select 1;
_item = _x select 0;
_amount = _x select 2;
switch (_selection) do {
case "CfgWeapons":
{
_avail = {_x == _item} count weapons player;
};
case "CfgMagazines":
{
_avail = {_x == _item} count magazines player;
};
};
if (_avail < _amount) exitWith {
_hasInput = false;
_itemName = getText(configFile >> _selection >> _item >> "displayName");
cutText [format [localize "str_crafting_missing",(_amount - _avail),_itemName], "PLAIN DOWN"];
};
} forEach (_input + _required);
if (_hasInput) then {
_freeSlots = [player] call BIS_fnc_invSlotsEmpty;
{
_item = _x select 0;
_amount = _x select 2;
_slotType = [_item] call BIS_fnc_invSlotType;
for "_i" from 1 to _amount do {
for "_j" from 1 to (count _slotType) do {
if ((_slotType select _j) > 0) then {
_freeSlots set[_j, ((_freeSlots select _j) + (_slotType select _j))];
};
};
};
} forEach _input;
_availabeSpace = true;
//sleep 1;
if (_availabeSpace) then {
player playActionNow "PutDown";
//Hack to get craft menu to use build needs a good tidy up
[_orignalClass,"Build","ItemActions"] spawn player_build;
r_action_count = r_action_count + 1;
};
};

View File

@@ -0,0 +1,28 @@
private ["_item","_config","_onLadder","_hastoolweapon","_text"];
_item = _this;
_config = configFile >> "cfgWeapons" >> _item;
call gear_ui_init;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {cutText [localize "str_player_21", "PLAIN DOWN"]};
_hastoolweapon = _item in weapons player;
_text = getText (_config >> "displayName");
if (!_hastoolweapon) exitWith {cutText [format [localize "str_player_30",_text] , "PLAIN DOWN"]};
if (dayZ_OnBack != "") exitWith {closeDialog 0; cutText [format [localize "str_player_toback_fail",_text] , "PLAIN DOWN"]};
call gear_ui_init;
if (_item in ["ItemHatchet","ItemCrowbar","ItemMachete","ItemFishingPole"]) then {
//free primary slot for new melee (remember item to add after)
switch (_item) do {
case "ItemHatchet": {player removeWeapon "ItemHatchet"; dayz_onBack = "MeleeHatchet";};
case "ItemCrowbar": {player removeWeapon "ItemCrowbar"; dayz_onBack = "MeleeCrowbar";};
case "ItemMachete": {player removeWeapon "ItemMachete"; dayz_onBack = "MeleeMachete";};
case "ItemFishingPole": {player removeWeapon "ItemFishingPole"; dayz_onBack = "MeleeFishingPole";};
};
disableSerialization;
[[(findDisplay 106)],"onLBSelChanged"] execVM "\z\addons\dayz_code\system\handleGear.sqf"; //update back
};

View File

@@ -0,0 +1,101 @@
/*
Attempts to attach attachment to the player's primary weapon or sidearm.
Parameters:
string attachment item classname
integer type of weapon: 1 if primary, 0 if secondary
Author:
Foxy
*/
#include "\z\addons\dayz_code\util\Player.hpp"
private
[
"_attachment",
"_weapon",
"_config",
"_newWeapon",
"_weaponInUse",
"_muzzle"
];
//check if player is on a ladder and if so, exit
if (Player_IsOnLadder()) exitWith
{
closeDialog 0;
(localize "str_player_21") call dayz_rollingMessages;
};
//name of attachment item
_attachment = _this select 0;
if (!(_attachment in magazines player)) exitWith
{
closeDialog 0;
"You seem to have misplaced the attachment." call dayz_rollingMessages;
};
//Get player's primary weapon or sidearm
_weapon = if ((_this select 1) == 1)
then { primaryWeapon player }
else { _weapon = Player_GetSidearm(); if (isNil "_weapon") then { "" } else { _weapon } };
//check if player has the weapon
if (_weapon == "") exitWith
{
closedialog 0;
localize
(
if ((_this select 1) == 1)
then {"str_AttachmentmissingWeapon"}
else {"str_AttachmentmissingWeapon2"}
) call dayz_rollingMessages;
};
//retrieve Attachments class config
_config = configFile >> "CfgWeapons" >> _weapon >> "Attachments";
//check that weapon has Attachments class and attachments class has <_attachment> field.
if (!isClass(_config) || {!isText(_config >> _attachment)}) exitWith
{
closeDialog 0;
localize
(
if ((_this select 1) == 1)
then {"str_AttachmentWeaponConfig"}
else {"str_AttachmentWeaponConfig2"}
) call dayz_rollingMessages;
};
_newWeapon = getText (_config >> _attachment);
_weaponInUse = (currentWeapon player == _weapon);
call gear_ui_init;
player playActionNow "Medic";
//remove attachment from inventory and replace weapon
player removeMagazine _attachment;
player removeWeapon _weapon;
player addWeapon _newWeapon;
//close gear
(findDisplay 106) closeDisplay 0;
//Select new weapon if the old was in use
if (_weaponInUse) then
{
_muzzle = (getArray (configFile >> "CfgWeapons" >> _newWeapon >> "muzzles")) select 0;
if (_muzzle == "this") then
{
player selectWeapon _newWeapon;
}
else
{
player selectWeapon _muzzle;
};
};

View File

@@ -0,0 +1,37 @@
private["_theBomb","_vehicle","_curFuel","_newFuel","_timeLeft","_hasToolbox","_hasCarBomb","_dis","_sfx","_alreadyBombed","_hasCrowbar"];
_vehicle = _this select 3;
_hasToolbox = "ItemToolbox" in items player;
_hasCrowbar = "ItemCrowbar" in items player;
_hasCarBomb = "ItemCarBomb" in magazines player;
_alreadyBombed = _vehicle getVariable["hasBomb",false];
if(!_hasToolbox or !_hasCrowbar) exitWith {
cutText [localize "str_bombToolMissing", "PLAIN DOWN"];
};
if(!_hasCarBomb) exitWith {
cutText [localize "str_bombMissing", "PLAIN DOWN"];
};
/*
if(_vehicle getVariable["hasBomb",false]) exitWith {
cutText [localize "str_bombAlready", "PLAIN DOWN"];
};
*/
player removeMagazine "ItemCarBomb";
//wait a bit
player playActionNow "Medic";
sleep 1;
//DO Animation
_dis=20;
_sfx = "tentunpack";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
//Send the Eventhandler to Server
if(!_alreadyBombed) then {
PVDZ_dayzCarBomb = [_vehicle,getPlayerUID player];
publicVariableServer "PVDZ_dayzCarBomb";
};
cutText [localize "str_bombAttached", "PLAIN DOWN"];

View File

@@ -0,0 +1,153 @@
private ["_target", "_pos", "_gps", "_vars", "_hasToolbox", "_hasCrowbar", "_limit", "_proceed", "_counter", "_dis", "_sfx", "_roll", "_animState", "_started", "_finished", "_animState", "_isMedic","_isGate"];
_target = _this select 3;
_pos = getPos _target;
_isGate = (typeOf cursorTarget) in ["WoodenGate_2","WoodenGate_3","WoodenGate_4"];
_limit = 2 + round(random 3);
_hasSledgeHammer = "ItemSledgeHammer" in items player;
_hasCrowbar = "ItemCrowbar" in items player;
if (!_hasSledgeHammer) exitWith {
titleText ["You need a SledgeHammer to break into this compound" , "PLAIN DOWN"];
sleep 1;
};
if (!_hasCrowbar) exitWith {
titleText ["You need a crowbar to break into this compound." , "PLAIN DOWN"];
sleep 1;
};
_isOk = true;
_proceed = false;
_counter = 0;
_brokein = false;
while {_isOk} do {
//Check if we have the tools to start
_hasSledgeHammer = "ItemSledgeHammer" in items player;
_hasCrowbar = "ItemCrowbar" in items player;
if (!_hasSledgeHammer) exitWith {
_proceed = nil;
titleText ["You need a sledge hammer to break into a gate." , "PLAIN DOWN"];
sleep 1;
};
if (!_hasCrowbar) exitWith {
_proceed = nil;
titleText ["You need a crowbar to break into a gate." , "PLAIN DOWN"];
sleep 1;
};
//Run animation
player playActionNow "Medic";
//Run SFX
_dis=20;
_sfx = "repair";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
//Setup Vars
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
//run animation loop
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
_finished = false;
};
sleep 0.1;
};
r_doLoop = false;
//Interrupt and end
if(!_finished) exitWith {
_isOk = false;
_proceed = false;
};
//Everything happened as it should
if(_finished) then {
//Add to Counter
_counter = _counter + 1;
//start chance to gain access.
if ([0.01] call fn_chance) then {
//stop loop
_isOk = false;
//Set Done var
_proceed = true;
if (_isGate) then {
_brokein = true;
_target setVariable ["isOpen", "1", true];
};
};
};
//Chances to damage tools
if ([0.02] call fn_chance) then {
player removeWeapon "ItemSledgeHammer";
player addWeapon "ItemSledgeHammerBroken";
titleText ["Your SledgeHammer handle has snapped." , "PLAIN DOWN"];
};
if ([0.04] call fn_chance) then {
player removeWeapon "ItemCrowbar";
player addWeapon "ItemCrowbarBent";
titleText ["Your crowbar has bent." , "PLAIN DOWN"];
};
if(_counter == _limit) exitWith {
//stop loop
_isOk = false;
//Set Done var
_proceed = true;
};
titleText [format["Breaking into compound, attempt (%1 of %2).", _counter,_limit], "PLAIN DOWN"];
sleep 0.03;
};
//Tool issues
if (isnil "_proceed") exitwith {};
//Interrupted for some reason
if (!_proceed) then {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
titleText ["Break in cancelled." , "PLAIN DOWN"];
};
// Working-Factor for chopping wood.
["Working",0,[100,15,10,0]] call dayz_NutritionSystem;
//Completed but no success.
if (_proceed and !_brokein) then {
titleText [format["Break in attempt completed with little success", _counter,_limit], "PLAIN DOWN"];
};
//Completed and successful
if (_proceed and _brokein) then {
titleText ["Break in attempt successful.", "PLAIN DOWN", 0.3];
//Open Gate.
_target animate ["DoorR", 0];
_target animate ["DoorL", 0];
};

View File

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

View File

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

View File

@@ -0,0 +1,167 @@
private["_item","_result","_dis","_sfx","_num", "_breaking"];
//if (!isnil "faco_player_chopWood") exitWith { _this call faco_player_chopWood };
_item = _this;
call gear_ui_init;
closeDialog 1;
_countOut = 3;
_woodCutting = false;
if (["forest",dayz_surfaceType] call fnc_inString) then {
_countOut = floor(random 3) + 2;
_woodCutting = true;
} else {
// allowed trees list move this later
_trees = ["ind_timbers.p3d","t_larix3s.p3d","t_pyrus2s.p3d","str_briza_kriva.p3d","dd_borovice.p3d","les_singlestrom_b.p3d","les_singlestrom.p3d","smrk_velky.p3d","smrk_siroky.p3d","smrk_maly.p3d","les_buk.p3d","str krovisko vysoke.p3d","str_fikovnik_ker.p3d","str_fikovnik.p3d","str vrba.p3d","hrusen2.p3d","str dub jiny.p3d","str lipa.p3d","str briza.p3d","p_akat02s.p3d","jablon.p3d","p_buk.p3d","str_topol.p3d","str_topol2.p3d","p_osika.p3d","t_picea3f.p3d","t_picea2s.p3d","t_picea1s.p3d","t_fagus2w.p3d","t_fagus2s.p3d","t_fagus2f.p3d","t_betula1f.p3d","t_betula2f.p3d","t_betula2s.p3d","t_betula2w.p3d","t_alnus2s.p3d","t_acer2s.p3d","t_populus3s.p3d","t_quercus2f.p3d","t_sorbus2s.p3d","t_malus1s.p3d","t_salix2s.p3d","t_picea1s_w.p3d","t_picea2s_w.p3d","t_ficusb2s_ep1.p3d","t_populusb2s_ep1.p3d","t_populusf2s_ep1.p3d","t_amygdalusc2s_ep1.p3d","t_ficusb2s_ep1.p3d","t_pistacial2s_ep1.p3d","t_pinuse2s_ep1.p3d","t_pinuss3s_ep1.p3d","t_prunuss2s_ep1.p3d","t_pinusn2s.p3d","t_pinusn1s.p3d","t_pinuss2f.p3d","t_poplar2f_dead_pmc.p3d","misc_torzotree_pmc.p3d","misc_burnspruce_pmc.p3d","brg_cocunutpalm8.p3d","brg_umbrella_acacia01b.p3d","brg_jungle_tree_canopy_1.p3d","brg_jungle_tree_canopy_2.p3d","brg_cocunutpalm4.p3d","brg_cocunutpalm3.p3d","palm_01.p3d","palm_02.p3d","palm_03.p3d","palm_04.p3d","palm_09.p3d","palm_10.p3d","brg_cocunutpalm2.p3d","brg_jungle_tree_antiaris.p3d","brg_cocunutpalm1.p3d"];
_findNearestTree = objNull;
{
_objInfo = toArray(str(_x));
_lenInfo = count _objInfo - 1;
_objName = [];
_i = 0;
// determine where the object name starts
{
if (58 == _objInfo select _i) exitWith {};
_i = _i + 1;
} forEach _objInfo;
_i = _i + 2; // skip the ": " part
for "_k" from _i to _lenInfo do {
_objName = _objName + [_objInfo select _k];
};
_objName = toLower(toString(_objName));
// Exit since we found a tree
if (_objName in _trees) exitWith { _findNearestTree = _x; };
} foreach nearestObjects [getPosATL player, [], 8];
_countOut = floor(random 3) + 2;
if (!isNull _findNearestTree) then {
_woodCutting = true;
} else {
cutText [localize "str_player_23", "PLAIN DOWN"];
};
};
if (_woodCutting) then {
//Remove melee magazines (BIS_fnc_invAdd fix) (add new melee ammo to array if needed)
{player removeMagazines _x} forEach ["Hatchet_Swing","Crowbar_Swing","Machete_Swing","Fishing_Swing"];
// Start chop tree loop
_counter = 0;
_isOk = true;
_proceed = false;
while {_isOk} do {
//play action
player playActionNow "Medic";
//setup alert and speak
_dis=20;
_sfx = "chopwood";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
// Working-Factor for chopping wood.
["Working",0,[100,15,10,0]] call dayz_NutritionSystem;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
if(!_finished) exitWith {
_isOk = false;
_proceed = false;
};
if(_finished) then {
_breaking = false;
if ([0.04] call fn_chance) then {
_breaking = true;
if ("MeleeHatchet" in weapons player) then {
player removeWeapon "MeleeHatchet";
} else {
if ("ItemHatchet" in weapons player) then {
player removeWeapon "ItemHatchet";
} else {
if (dayz_onBack == "MeleeHatchet") then {
dayz_onBack = "";
};
};
};
if (!("ItemHatchetBroken" in weapons player)) then {
player addWeapon "ItemHatchetBroken";
};
};
_counter = _counter + 1;
_itemOut = "ItemLog";
//Drop Item to ground
_itemOut call fn_dropItem;
};
if ((_counter == _countOut) || _breaking) exitWith {
if (_breaking) then {
cutText [localize "str_HatchetHandleBreaks", "PLAIN DOWN"];
} else {
cutText [localize "str_player_24_Stoped", "PLAIN DOWN"];
};
_isOk = false;
_proceed = true;
sleep 1;
};
cutText [format [localize "str_player_24_progress", _counter,_countOut], "PLAIN DOWN"];
};
if (_proceed) then {
if ("" == typeOf _findNearestTree) then {
//remove vehicle, Need to ask server to remove.
PVDZ_objgather_Knockdown = [_findNearestTree,player];
publicVariableServer "PVDZ_objgather_Knockdown";
};
//cutText [format["\n\nChopping down tree.], "PLAIN DOWN"];
//cutText [localize "str_player_25", "PLAIN DOWN"];
} else {
cutText [localize "str_player_24_Stoped", "PLAIN DOWN"];
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
};
//adding melee mags back if needed
switch (primaryWeapon player) do {
case "MeleeHatchet": {player addMagazine 'Hatchet_Swing';};
case "MeleeCrowbar": {player addMagazine 'Crowbar_Swing';};
case "MeleeMachete": {player addMagazine 'Machete_Swing';};
case "MeleeFishingPole": {player addMagazine 'Fishing_Swing';};
};
};

View File

@@ -0,0 +1,86 @@
private ["_create","_config","_create_magsize","_type","_name","_magCount","_slotstart","_slotend","_dialog","_qty_total_ammo","_control","_mag","_qtynew_create_mags_full","_qtynew_create_ammo_rest","_magFull","_magFullSingular","_magAmmunition"];
disableSerialization;
call gear_ui_init;
closeDialog 0;
if (r_action_count != 1) exitWith { cutText [localize "str_player_actionslimit", "PLAIN DOWN"]; };
_create = _this;
if (!(_create in magazines player)) exitWith {r_action_count = 0;};
_config = configFile >> "CfgMagazines" >> _create;
player playActionNow "PutDown";
_create_magsize = getNumber(configFile >> "CfgMagazines" >> _create >> "count");
_type = getNumber(configFile >> "CfgMagazines" >> _create >> "type");
_name = getText(configFile >> "CfgMagazines" >> _create >> "displayName");
_magCount = {_x == _create} count magazines player;
if (_magCount == 1) exitWith {
cutText [format [localize "str_cannotCombine", _name], "PLAIN DOWN"];
r_action_count = 0;
};
//primary/secondary mags?
_slotstart = 0;
_slotend = 0;
if ((_type == 256) or (_type == 256*2)) then {
_slotstart = 109;
_slotend = 120;
};
if (_type == 16) then {
_slotstart = 122;
_slotend = 129;
};
_dialog = findDisplay 106;
_qty_total_ammo = 0;
for "_i" from _slotstart to _slotend do {
_control = _dialog displayCtrl _i;
_mag = gearSlotData _control;
if (_mag == _create) then {
_qty_total_ammo = _qty_total_ammo + gearSlotAmmoCount _control;
};
};
_qtynew_create_mags_full = 0;
_qtynew_create_ammo_rest = 0;
_qtynew_create_mags_full = floor(_qty_total_ammo/_create_magsize);
_qtynew_create_ammo_rest = _qty_total_ammo - (_qtynew_create_mags_full*_create_magsize);
player removeMagazines _create;
for "_i" from 1 to _qtynew_create_mags_full do {
player addMagazine _create;
};
if (_qtynew_create_ammo_rest != 0) then {
player addMagazine [_create,_qtynew_create_ammo_rest];
};
// Check if quiver
if(_create == "Quiver") then {
_magFull = "quivers";
_magFullSingular = "quiver";
_magAmmunition = "arrows";
} else {
_magFull = "magazines";
_magFullSingular = "magazine";
_magAmmunition = "bullets";
};
switch true do {
case (_qtynew_create_ammo_rest == 0) : {
cutText [format [localize "str_combineDoneFull",_magCount, _name, _qtynew_create_mags_full,_magFull], "PLAIN DOWN"];
};
case (_qtynew_create_mags_full == 0) : {
cutText [format [localize "str_combineDonePartialOne",_magCount, _name, _qtynew_create_ammo_rest,_magAmmunition], "PLAIN DOWN"];
};
default {
cutText [format [localize "str_combineDonePartial",_magCount, _name, _qtynew_create_mags_full, _qtynew_create_ammo_rest,_magAmmunition,_magFullSingular,_magFull], "PLAIN DOWN"];
};
};
sleep 1;
r_action_count = 0;

View File

@@ -0,0 +1,139 @@
/*
Player action for consuming items
Single parameter:
string item classname
Author:
Foxy
*/
#define PILE_SEARCH_RADIUS 2
#define PILE_PLAYER_OFFSET [0,1,0]
private
[
"_cfg",
"_nutrition",
"_bloodRegen",
"_infectionChance",
"_sound",
"_output"
];
_cfg = (ConfigFile >> "CfgMagazines" >> _this);
//class doesn't exist
if (!isClass(_cfg)) exitWith
{
diag_log format ["DAYZ ERROR: Invalid magazine classname given to player_consume: %1", _this];
};
//class isn't a consumable
if (!isArray(_cfg >> "Nutrition")) exitWith
{
diag_log format ["DAYZ ERROR: Non-consumable item classname given to player_consume: %1", _this];
};
//player is on a ladder
if ((getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1) exitWith
{
(localize "str_player_21") call dayz_rollingMessages;
};
//player doesn't have the consumable item
if (!(_this in magazines player)) exitWith
{
//TODO move to stringtable
"You seem to have misplaced the foodstuff." call dayz_rollingMessages;
};
//close gear
(findDisplay 106) closeDisplay 0;
//if player is not in a vehicle play animation
if (vehicle player == player) then
{
player playActionNow "PutDown";
};
//Remove consumed item
player removeMagazine _this;
//Get values from config
_nutrition = getArray (_cfg >> "Nutrition");
_bloodRegen = getNumber (_cfg >> "bloodRegen");
_infectionChance = getNumber (_cfg >> "infectionChance");
_sound = getText (_cfg >> "consumeSound");
_output = getText (_cfg >> "consumeOutput");
//Apply nutrition and blood regen
if (dayz_nutritionValuesSystem) then {
_hungerCount = _nutrition select 1;
_thirstCount = _nutrition select 2;
if (_hungerCount > 0) then { dayz_lastMeal = time; };
if (_thirstCount > 0) then { dayz_lastDrink = time; };
["FoodDrink",_bloodRegen,_nutrition] call dayz_NutritionSystem;
r_player_foodstack = r_player_foodstack + 1;
} else {
_hungerCount = _nutrition select 1;
_thirstCount = _nutrition select 2;
if (_hungerCount > 0) then { dayz_hunger = 0; dayz_lastMeal = time; };
if (_thirstCount > 0) then { dayz_thirst = 0; dayz_lastDrink = time; };
};
//Apply or cure infection base on infectionChance
if (_infectionChance != 0 && {abs(_infectionChance) > random 1}) then
{
if (_infectionChance > 0) then
{
r_player_infected = true;
player setVariable["USEC_infected",true,true];
}
else
{
r_player_infected = false;
player setVariable["USEC_infected",false,true];
};
};
//Publish messing
player setVariable ["messing",[dayz_hunger,dayz_thirst,dayz_nutrition],false]; //No need to be sent to everyplayer
PVDZ_serverStoreVar = [player,"messing",[dayz_hunger,dayz_thirst,dayz_nutrition]]; //update server side only
publicVariableServer "PVDZ_serverStoreVar";
//Play sound and alert zombies
if (_sound != "") then
{
private ["_soundDistance"];
_soundDistance = getNumber (_cfg >> "consumeSoundDistance");
[player,_sound,0,false,_soundDistance] call dayz_zombieSpeak;
[player,_soundDistance,true,(getPosATL player)] call player_alertZombies;
};
//If item has a consumeOutput item defined add that to player
//inventory or ground/vehicle inventory based on consumedDrop
if (_output != "") then
{
//if consumeDrop is false add output item to player inventory
if (getNumber (_cfg >> "consumeDrop") == 0) then
{
player addMagazine _output;
}
//consumeDrop is true so drop the output item on the ground
else
{
//if player is not in a vehicle drop output item on the ground
if (vehicle player == player) then
{
//wait a while before dropping the output item
sleep 3;
//Drop Item to ground
_output call fn_dropItem;
};
};
};

View File

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

View File

@@ -0,0 +1,16 @@
private["_qty_arrows","_qty_quivers","_qty_quiverarrows"];
call gear_ui_init;
_qty_arrows = {_x == "WoodenArrow"} count magazines player;
_qty_quivers = {_x == "Quiver"} count magazines player;
//if (_qty_quivers > 0) exitWith { cutText [localize "str_quiver_reachlimit","PLAIN DOWN"];};
if (_qty_arrows < 2) exitWith { cutText [localize "str_quiver_notenougharrows","PLAIN DOWN"];}; //Not enough arrows to create quiver
_qty_quiverarrows = _qty_arrows min 6;
for "_x" from 1 to _qty_quiverarrows do {
player removeMagazine "WoodenArrow";
};
player addMagazine ["Quiver",_qty_quiverarrows];
cutText [format [localize "str_quiver_createsuccess",_qty_quiverarrows], "PLAIN DOWN"];

View File

@@ -0,0 +1,74 @@
private ["_playerPos","_item","_location","_config","_text","_dir","_dis","_sfx","_consumetext","_stashname","_stashtype","_stash","_consume","_hasitemcount","_worldspace"];
//check if can pitch here
call gear_ui_init;
closeDialog 1;
if (r_action_count != 1) exitWith { cutText [localize "str_player_actionslimit", "PLAIN DOWN"]; };
//Player Pos
_playerPos = getPosATL player;
//Classname
_item = _this;
//Config
_config = configFile >> "CFGWeapons" >> _item;
_text = getText (_config >> "displayName");
_stashtype = "0";
_consume = getText (_config >> "consume");
_consumetext = getText (configFile >> "CfgMagazines" >> _consume >> "displayName");
_hasitemcount = {_x == _consume} count magazines player;
if (_hasitemcount > 0) then { _stashtype = getText (_config >> "stashsmall"); };
_stashname = getText (configFile >> "CfgVehicles" >> _stashtype >> "displayName");
// Items are missing
if ((!(_consume IN magazines player))) exitWith {
r_action_count = 0;
cutText [format [localize "str_player_31_stash",_consumetext] , "PLAIN DOWN"];
};
_location = player modeltoworld [0,2.5,0];
_location set [2,0];
//blocked
if (["concrete",dayz_surfaceType] call fnc_inString) exitwith {
r_action_count = 0;
};
_worldspace = [_stashtype, player] call fn_niceSpot;
if ((count _worldspace) == 2) then {
player removeMagazine _consume;
_dir = round(direction player);
//wait a bit
player playActionNow "Medic";
sleep 1;
_dis=20;
_sfx = "tentunpack";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
sleep 5;
//place tent (local)
_stash = createVehicle [_stashtype, _location, [], 0, "CAN_COLLIDE"];
_stash setdir _dir;
_stash setposATL _location;
player reveal _stash;
_stash setVariable ["characterID",dayz_characterID,true];
PVDZ_obj_Publish = [dayz_characterID,_stash,[_dir,_location],[]];
publicVariableServer "PVDZ_obj_Publish";
diag_log [diag_ticktime, __FILE__, "New Networked object, request to save to hive. PVDZ_obj_Publish:", PVDZ_obj_Publish];
r_action_count = 0;
cutText [format [localize "str_success_stash_pitch",_stashname], "PLAIN DOWN"];
} else {
r_action_count = 0;
cutText [format [localize "str_fail_stash_pitch",_stashname], "PLAIN DOWN"];
};

View File

@@ -0,0 +1,107 @@
private ["_cantype","_emptycan","_intensity","_objectID", "_objectUID"];
//Tent Object
_obj = _this select 3;
_objectID = _obj getVariable["ObjectID","0"];
_objectUID = _obj getVariable["ObjectUID","0"];
//Active Arrays.
_fuelArray = [];
_matchArray = [];
//Count how many matchbox's the player has incase they have more then one.
{
if (_x IN items player) then {
_matchArray set [count _matchArray, _x];
};
} count Dayz_Ignators;
//Count how many fuelcans the player has incase they have more then one.
{
if (_x IN magazines player) then {
_fuelArray set [count _fuelArray, _x];
};
} count DayZ_fuelCans;
//Make sure we have both components to create the fire.
if ((count _fuelArray == 0)) exitwith { systemChat (localize ("str_setFireFuel")); };
if ((count _matchArray == 0)) exitwith { systemChat (localize ("str_setFireMatches")); };
//Play normal action animation
player playActionNow "Medic";
//Actionmenu tools
player removeAction s_player_destorytent;
s_player_destorytent = -1;
//Make sure you can only destory once
_alreadyDestorying = _obj getVariable["alreadyDestorying",0];
if (_alreadyDestorying == 1) exitWith {cutText [localize "str_TentAlreadyLit" , "PLAIN DOWN"]};
_obj setVariable["alreadyDestorying",1];
//Jerry can system ** Needs redoing
//Select random can from array
_randomJerryCan = _fuelArray call BIS_fnc_selectRandom;
_name = getText (configFile >> "CfgMagazines" >> _randomJerryCan >> "displayName");
_emptycan = getText (configFile >> "CfgMagazines" >> _randomJerryCan >> "emptycan");
_fireIntensity = getNumber (configFile >> "CfgMagazines" >> _randomJerryCan >> "fireIntensity");
player removeMagazine _randomJerryCan;
player addMagazine _emptycan;
//Match system ** Needs redoing
//Select random matchbox
_randomBoxMatches = _matchArray call BIS_fnc_selectRandom;
_qtyRemaining = getText (configFile >> "cfgWeapons" >> _randomBoxMatches >> "Ignators" >> "qtyRemaining");
switch _randomBoxMatches do {
case "ItemMatchbox" : {
if ([0.3] call fn_chance) then {
player removeWeapon _randomBoxMatches;
player addWeapon _qtyRemaining;
//info box.
systemChat (localize "str_info_limitedbox");
};
};
default {
player removeWeapon _randomBoxMatches;
player addWeapon _qtyRemaining;
};
};
//Normal alerts
_dis=20;
_sfx = "tentpack";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
// Added Nutrition-Factor for work
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
sleep 3;
PVDZ_obj_Destroy = [_objectID,_objectUID];
publicVariableServer "PVDZ_obj_Destroy";
//Send killed for object
if (isServer) then {
PVDZ_obj_Destroy call server_deleteObj;
} else {
PVDZ_veh_Save = [_obj, "killed"];
publicVariableServer "PVDZ_veh_Save";
};
//Set fire to item
onFire = [_obj,_fireIntensity,time,false,true] spawn BIS_Effects_Burn;
PVDZ_obj_Fire = [_obj,_fireIntensity,time,false,true];
publicVariable "PVDZ_obj_Fire";
_obj inflame true;
//_obj spawn player_fireMonitor;
cutText [localize "str_success_tent_destoryed", "PLAIN DOWN"];

View File

@@ -0,0 +1,83 @@
private["_playerPos","_canFill","_isPond","_isWell","_pondPos","_objectsWell","_onLadder","_hasbottleitem","_config","_item","_text","_objectsPond","_qty","_dis","_sfx","_isInfected","_bodiesNear","_chance"];
call gear_ui_init;
closeDialog 0;
_item = _this;
_playerPos = getPosATL player;
_canFill = count nearestObjects [_playerPos, ["Land_pumpa","Land_water_tank"], 4] > 0;
_isPond = false;
_isWell = false;
_isInfected = false;
_pondPos = [];
_objectsWell = [];
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith {cutText [localize "str_player_21", "PLAIN DOWN"]};
_itemorignal = _this;
//diag_log(str(_itemorignal));
if (!dayz_isSwimming) then {
player playActionNow "PutDown";
};
if (!_canFill) then {
_objectsWell = nearestObjects [_playerPos, [], 4];
{
//Check for Well
_isWell = ["_well",str(_x),false] call fnc_inString;
if (_isWell) then {_canFill = true};
} forEach _objectsWell;
};
if (!_canFill) then {
_objectsPond = nearestObjects [_playerPos, [], 100];
{
//Check for pond
_isPond = ["pond",str(_x),false] call fnc_inString;
//Check for Dead Bodies
_bodiesNear = ["dead",str(_x),false] call fnc_inString;
if (!_bodiesNear) then {
_bodiesNear = ["massgrave",str(_x),false] call fnc_inString;
};
if (_bodiesNear) then {
_isInfected = true;
};
if (_isPond) then {
_pondPos = (_x worldToModel _playerPos) select 2;
if (_pondPos < 0) then {
_canFill = true;
};
};
} forEach _objectsPond;
};
if (_canFill) then {
_chance = 0.1;
if (_itemorignal in boil_tin_cans) then {
_chance = 0.06;
["FoodDrink",0,[0,0,300,0]] call dayz_NutritionSystem; //[Energy,food,water,temp]
} else {
_chance = 0.03;
["FoodDrink",0,[0,0,150,0]] call dayz_NutritionSystem; //[Energy,food,water,temp]
};
[player,"drink",0,false,5] call dayz_zombieSpeak;
[player,10,true,(getPosATL player)] call player_alertZombies;
if(!_isWell) then {
if (_isInfected) then {
r_player_infected = true;
player setVariable["USEC_infected",true,true];
} else {
if ([_chance] call fn_chance) then {
r_player_infected = true;
player setVariable["USEC_infected",true,true];
};
};
};
cutText [localize "str_drinkwithhands", "PLAIN DOWN"];
} else {
cutText [localize "str_player_32", "PLAIN DOWN"];
};

View File

@@ -0,0 +1,33 @@
private ["_item","_config","_onLadder","_consume","_bag","_droppedtype"];
disableSerialization;
_item = _this;
_config = configFile >> "CfgWeapons" >> _item;
_droppedtype = (gettext (_config >> "droppeditem"));
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith { cutText [localize "str_player_21", "PLAIN DOWN"]; r_action_count = 0; };
if (r_action_count != 1) exitWith { cutText [localize "str_player_actionslimit", "PLAIN DOWN"]; };
call gear_ui_init;
_consume = ([] + getArray (_config >> "magazines")) select 0;
if ((dayz_onBack != "") && (dayz_onBack in MeleeWeapons) && carryClick) then {
switch DayZ_onBack do {
case "MeleeHatchet": {_item = "ItemHatchet"; dayz_onBack = "";};
case "MeleeCrowbar": {_item = "ItemCrowbar"; dayz_onBack = "";};
case "MeleeMachete": {_item = "ItemMachete"; dayz_onBack = "";};
};
carryClick = false;
((findDisplay 106) displayCtrl 1209) ctrlSetText "";
} else {
player removeMagazines _consume;
player removeWeapon _item;
if (_droppedtype == "") then { _item = _this; } else { _item = _droppedtype; };
};
_bag = createVehicle [format["WeaponHolder_%1",_item],getPosATL player,[], 1, "CAN_COLLIDE"];
_bag modelToWorld getPosATL player;
_bag setdir (getDir player);
player reveal _bag;
r_action_count = 0;

View File

@@ -0,0 +1,60 @@
/*
Player action for emptying containers e.g. water bottle
Single parameter:
string item classname
Author:
Foxy
*/
private
[
"_cfg",
"_nutrition",
"_bloodRegen",
"_infectionChance",
"_sound",
"_output"
];
_cfg = (ConfigFile >> "CfgMagazines" >> _this);
//class doesn't exist
if (!isClass(_cfg)) exitWith
{
diag_log format ["DAYZ ERROR: Invalid magazine classname given to player_emptyContainer: %1", _this];
};
//class isn't a consumable
if (!isText(_cfg >> "containerEmpty")) exitWith
{
diag_log format ["DAYZ ERROR: Non-emptiable item classname given to player_emptyContainer: %1", _this];
};
//player is on a ladder
if ((getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1) exitWith
{
(localize "str_player_21") call dayz_rollingMessages;
};
//player doesn't have the consumable item
if (!(_this in magazines player)) exitWith
{
//TODO move to stringtable
"You seem to have misplaced the container." call dayz_rollingMessages;
};
//Remove container
player removeMagazine _this;
player addMagazine getText (_cfg >> "containerEmpty");
//update gear ui or close if the player is in a vehicle
if (vehicle player == player) then
{
call gear_ui_init;
}
else
{
(findDisplay 106) closeDisplay 0;
};

View File

@@ -0,0 +1,24 @@
private["_qty_arrows","_qty_quivers","_control","_qty_quiverarrows","_qty_quiverfreeslots","_qty_arrows2add"];
disableSerialization;
call gear_ui_init;
_qty_arrows = {_x == "WoodenArrow"} count magazines player;
_qty_quivers = {_x == "Quiver"} count magazines player;
_control = uiNamespace getVariable 'uiControl';
_qty_quiverarrows = gearSlotAmmoCount _control;
_qty_quiverfreeslots = 12-_qty_quiverarrows;
//if (_qty_quivers > 1) exitWith { cutText [localize "str_quiver_reachlimit", "PLAIN DOWN"];};
if (_qty_quiverfreeslots > 0) then {
_qty_arrows2add = _qty_quiverfreeslots min _qty_arrows;
player removeMagazine "Quiver";
for "_x" from 1 to _qty_arrows2add do {
player removeMagazine "WoodenArrow";
};
player addMagazine ["Quiver",_qty_quiverarrows+_qty_arrows2add];
cutText [format [localize "str_quiver_addarrows",_qty_arrows2add], "PLAIN DOWN"];
} else {
cutText [localize "str_quiver_full", "PLAIN DOWN"];
};

View File

@@ -0,0 +1,21 @@
private ["_bottle","_tape","_fixedBottle"];
_bottle = _this;
_tape = "equip_duct_tape";
_fixedBottle = "ItemWaterBottleUnfilled";
call gear_ui_init;
closeDialog 0;
// Check if the player has the tape
if (_tape in magazines player) then {
//Fix the bottle
player playActionNow "Medic";
[player,"bandage",0,false] call dayz_zombieSpeak;
sleep 6;
player removeMagazine _bottle;
player removeMagazine _tape;
player addMagazine _fixedBottle;
cutText [localize "str_fix_water_bottle", "PLAIN DOWN"];
} else { //If the player doesn't have the tape
cutText [localize "str_fix_water_bottle_fail", "PLAIN DOWN"];
};

View File

@@ -0,0 +1,40 @@
//fixHatchet old file
private ["_tool","_tape","_fixedItem"];
_tool = _this;
_config = configFile >> "CfgWeapons" >> _tool;
_fixedItem = getText(_config >> "fixedTool");
_dName = getText(configFile >> "CfgWeapons" >> _fixedItem >> "displayName");
//Used for Grip
_tape = "equip_duct_tape";
//Handle
_handle = "equip_lever";
call gear_ui_init;
closeDialog 0;
// Check if the player has the tape
if ((_tape in magazines player) && (_handle in magazines player)) then {
//Fix the tool
player playActionNow "Medic";
[player,"bandage",0,false] call dayz_zombieSpeak;
sleep 6;
player removeWeapon _tool;
player removeMagazine _tape;
player removeMagazine _handle;
player addWeapon _fixedItem;
cutText [format [localize "str_fixToolSuccess", _dName], "PLAIN DOWN"];
} else { //If the player doesn't have the mats.
if (!(_tape in magazines player)) then {
if (!(_handle in magazines player)) then {
cutText [localize "str_fixToolFail", "PLAIN DOWN"];
} else {
cutText [localize "str_fixtoolMissingTape", "PLAIN DOWN"];
};
} else {
cutText [localize "str_fixtoolMissingHandle", "PLAIN DOWN"];
};
};

View File

@@ -0,0 +1,38 @@
private ["_plant", "_originalCount"];
_plant = _this;
if (_plant getVariable["Gathering",false]) exitWith {};
_originalCount = getNumber (configFile >> "CfgVehicles" >> (typeOf _plant) >> "TransportMagazines" >> "_xx_leaf" >> "count");
if !([ [[["equip_comfreyleafs"],[_originalCount]],[[],[]]] , [getMagazineCargo _plant, getWeaponCargo _plant] ] call BIS_fnc_areEqual) then {
//diag_log [ [getMagazineCargo _plant, getWeaponCargo _plant], "!=", [[["equip_comfreyleafs"],[_originalCount]],[[],[]]] ];
_plant setVariable["Gathering",true]; // avoid multiple call because the fn_selfActions is called in an infinite loop
[_this] spawn { // in background to be called after fn_selfActions
_plant = _this select 0;
_mags = (getMagazineCargo _plant) select 0;
_weps = (getWeaponCargo _plant) select 0;
if (count _mags != 0 OR count _weps != 0) then { // if not empty
// replace plant to a regular weaponholder
_item = createVehicle ["WeaponHolder", (getPosATL _plant), [], 0, "CAN_COLLIDE"];
_magcounts = (getMagazineCargo _plant) select 1;
{
_item addMagazineCargoGlobal [_x, _magcounts select _forEachIndex];
} forEach _mags;
_wepcounts = (getWeaponCargo _plant) select 1;
{
_item addWeaponCargoGlobal [_x, _wepcounts select _forEachIndex];
} forEach _weps;
};
//remove vehicle, Need to ask server to remove.
PVDZ_obj_Delete = [_plant,player];
publicVariableServer "PVDZ_obj_Delete";
deleteVehicle _plant;
//Make some noise
_dis=2;
_sfx = "tentpack";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
};
};

View File

@@ -0,0 +1,151 @@
private ["_item","_result","_dis","_sfx","_num","_breaking","_counter","_rocks","_findNearestRock","_objInfo","_lenInfo","_objName","_i","_k","_countOut","_isOk","_proceed","_animState","_started","_finished","_isMedic","_itemOut","_wpPos","_nearByPile"];
_item = _this;
call gear_ui_init;
closeDialog 1;
if(dayz_workingInprogress) exitWith { cutText ["Mining already in progress!", "PLAIN DOWN"];};
dayz_workingInprogress = true;
// allowed rocks list move this later
_rocks = ["r2_boulder1.p3d","r2_boulder2.p3d","r2_rock1.p3d","r2_rock2.p3d","r2_rocktower.p3d","r2_rockwall.p3d","r2_stone.p3d"];
_findNearestRock = objNull;
{
_objInfo = toArray(str(_x));
_lenInfo = count _objInfo - 1;
_objName = [];
_i = 0;
// determine where the object name starts
{
if (58 == _objInfo select _i) exitWith {};
_i = _i + 1;
} forEach _objInfo;
_i = _i + 2; // skip the ": " part
for "_k" from _i to _lenInfo do {
_objName = _objName + [_objInfo select _k];
};
_objName = toLower(toString(_objName));
// Exit since we found a rock
if (_objName in _rocks) exitWith { _findNearestRock = _x; };
} foreach nearestObjects [getPosATL player, [], 8];
if (!isNull _findNearestRock) then {
_countOut = 2 + floor(random 3);
//Remove melee magazines (BIS_fnc_invAdd fix) (add new melee ammo to array if needed)
{player removeMagazines _x} forEach ["Hatchet_Swing","Crowbar_Swing","Machete_Swing","Fishing_Swing"];
// Start stone mining loop
_counter = 0;
_isOk = true;
_proceed = false;
while {_isOk} do {
//play action
player playActionNow "Medic";
//setup alert and speak
_dis=20;
_sfx = "minestone";
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
[player,_dis,true,(getPosATL player)] call player_alertZombies;
// Working-Factor for mining stone.
["Working",0,[100,15,10,0]] call dayz_NutritionSystem;
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
_finished = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
if(!_finished) exitWith {
_isOk = false;
_proceed = false;
};
if(_finished) then {
_breaking = false;
if ([0.04] call fn_chance) then {
_breaking = true;
if ("MeleePickaxe" in weapons player) then {
player removeWeapon "MeleePickaxe";
} else {
if ("ItemPickaxe" in weapons player) then {
player removeWeapon "ItemPickaxe";
} else {
if (dayz_onBack == "MeleePickaxe") then {
dayz_onBack = "";
};
};
};
if (!("ItemPickaxeBroken" in weapons player)) then {
player addWeapon "ItemPickaxeBroken";
};
};
_counter = _counter + 1;
_itemOut = "ItemStone";
//Drop Item to ground
_itemOut call fn_dropItem;
};
if ((_counter >= _countOut) || _breaking) exitWith {
if (_breaking) then {
cutText [localize "str_PickAxeHandleBreaks", "PLAIN DOWN"];
} else {
cutText [localize "str_mining_finished", "PLAIN DOWN"];
};
_isOk = false;
_proceed = true;
sleep 1;
};
cutText [format[localize "str_mining_progress", _counter,(_countOut - _counter)], "PLAIN DOWN"];
};
if (!_proceed) then {
cutText [localize "str_mining_canceled", "PLAIN DOWN"];
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
};
//adding melee mags back if needed
switch (primaryWeapon player) do {
case "MeleeHatchet": {player addMagazine 'Hatchet_Swing';};
case "MeleeCrowbar": {player addMagazine 'Crowbar_Swing';};
case "MeleeMachete": {player addMagazine 'Machete_Swing';};
case "MeleeFishingPole": {player addMagazine 'Fishing_Swing';};
};
} else {
cutText [localize "str_mining_no_rocks", "PLAIN DOWN"];
};
dayz_workingInprogress = false;

View File

@@ -0,0 +1,83 @@
private ["_target","_type","_fn_Lock","_fn_UnLock","_fn_Open","_fn_Closed"];
_target = ((_this select 3) select 0);
_type = ((_this select 3) select 1);
_fn_Set = {
if (typeOf _target in ["WoodenGate_2","WoodenGate_3","WoodenGate_4"]) then {
_target animate ["DoorR", 0];
_target animate ["DoorL", 0];
//_target setVariable ["isOpen", "0", true];
[_target,true] spawn padlock_open;
};
};
_fn_Lock = {
if (typeOf _target in ["WoodenGate_2","WoodenGate_3","WoodenGate_4"]) then {
_target animate ["DoorR", 0];
_target animate ["DoorL", 0];
_target setVariable ["isOpen", "0", true];
_target setVariable ["dayz_padlockLockStatus",true,true];
};
};
_fn_UnLock = {
if (typeOf _target in ["WoodenGate_2","WoodenGate_3","WoodenGate_4"]) then {
[_target,false] spawn padlock_open;
};
};
_fn_Lockold = {
if (typeOf _target in ["WoodenGate_2","WoodenGate_3","WoodenGate_4"]) then {
_target animate ["DoorR", 0];
_target animate ["DoorL", 0];
_target setVariable ["isOpen", "0", true];
cutText ["Gates locked.", "PLAIN DOWN"];
};
};
_fn_UnLockold = {
if (typeOf _target in ["WoodenGate_2","WoodenGate_3","WoodenGate_4"]) then {
_target setVariable ["isOpen", "1", true];
cutText ["Gates Unlocked.", "PLAIN DOWN"];
};
};
_fn_Open = {
if (typeOf _target in ["WoodenGate_1","WoodenGate_2","WoodenGate_3","WoodenGate_4"]) then {
_target animate ["DoorR", 1];
_target animate ["DoorL", 1];
cutText ["Gates Opened.", "PLAIN DOWN"];
};
};
_fn_Closed = {
if (typeOf _target in ["WoodenGate_1","WoodenGate_2","WoodenGate_3","WoodenGate_4"]) then {
_target animate ["DoorR", 0];
_target animate ["DoorL", 0];
cutText ["Gates Closed.", "PLAIN DOWN"];
};
};
_fn_BuildLock = {
_target setVariable ["BuildLock",true,true];
PVDZ_Server_buildLock = [_target];
publicVariableServer "PVDZ_Server_buildLock";
};
_fn_BuildUnLock = {
_target setVariable ["BuildLock",false,true];
PVDZ_Server_buildLock = [_target];
publicVariableServer "PVDZ_Server_buildLock";
};
switch (_type) do {
case "Lock": { call _fn_Lock; };
case "Unlock": { call _fn_UnLock; };
case "Open": { call _fn_Open; };
case "Close": { call _fn_Closed; };
case "Set": { call _fn_Set; };
case "BuildLock": { call _fn_BuildLock; };
case "BuildUnLock": { call _fn_BuildUnLock; };
};

View File

@@ -0,0 +1,120 @@
private ["_item","_config","_consume","_create","_item_ammo","_consume_magsize","_create_magsize","_consume_type","_slotstart","_slotend","_dialog","_qty_total_ammo","_qty_consume_ammo","_qty_create_ammo","_qty_consume_mags","_qty_create_mags","_qty_free_slots","_control","_mag","_qtynew_create_ammo","_qtynew_consume_ammo","_qtynew_create_mags","_qtynew_consume_mags","_qtynew_consume_mags_full","_qtynew_create_mags_full","_qtynew_consume_ammo_rest","_qtynew_create_ammo_rest"];
disableSerialization;
call gear_ui_init;
//note - one slot ammo can be used!
r_action_count = r_action_count + 1;
if (r_action_count != 1) exitWith { cutText [localize "str_player_actionslimit", "PLAIN DOWN"]; };
_item = _this;
if (!(_item in magazines player)) exitWith {r_action_count = 0;};
_config = configFile >> "CfgMagazines" >> _item;
_consume = getArray (_config >> "ItemActions" >> "ReloadMag" >> "use") select 0;
_create = getArray (_config >> "ItemActions" >> "ReloadMag" >> "output") select 0;
_item_ammo = gearSlotAmmoCount (uiNamespace getVariable 'uiControl');
//add check if weapon can use _create (if not - show message)
/*
if (currentWeapon player != "") then {
_mags = [] + getArray (configFile >> "cfgWeapons" >> (currentWeapon player) >> "magazines");
};
if !(_create in _mags) exitWith {cutText [localize "str_must_have_weapon", "PLAIN DOWN"];};
*/
player playActionNow "PutDown";
_consume_magsize = getNumber(configFile >> "CfgMagazines" >> _consume >> "count");
_create_magsize = getNumber(configFile >> "CfgMagazines" >> _create >> "count");
_consume_type = getNumber(configFile >> "CfgMagazines" >> _consume >> "type");
//primary/secondary mags?
_slotstart = 0;
_slotend = 0;
if (_consume_type == 256) then {
_slotstart = 109;
_slotend = 120;
};
if (_consume_type == 16) then {
_slotstart = 122;
_slotend = 129;
};
_dialog = findDisplay 106;
_qty_total_ammo = 0;
_qty_consume_ammo = 0;
_qty_create_ammo = 0;
_qty_consume_mags = 0;
_qty_create_mags = 0;
_qty_free_slots = 0;
for "_i" from _slotstart to _slotend do {
_control =_dialog displayCtrl _i;
_mag = gearSlotData _control;
if (_mag == _consume) then {
_qty_total_ammo = _qty_total_ammo + gearSlotAmmoCount _control;
_qty_consume_ammo = _qty_consume_ammo + gearSlotAmmoCount _control;
_qty_consume_mags = _qty_consume_mags+1;
};
if (_mag == _create) then {
_qty_total_ammo = _qty_total_ammo + gearSlotAmmoCount _control;
_qty_create_ammo = _qty_create_ammo + gearSlotAmmoCount _control;
_qty_create_mags = _qty_create_mags+1;
};
if (_mag == "") then {
_qty_free_slots = _qty_free_slots + 1;
};
};
_qtynew_create_ammo = 0;
_qtynew_consume_ammo = 0;
_qtynew_create_mags = 0;
_qtynew_consume_mags = 0;
_qtynew_consume_mags_full = 0;
_qtynew_create_mags_full = 0;
_qtynew_consume_ammo_rest = 0;
_qtynew_create_ammo_rest = 0;
if (_consume_magsize > _create_magsize) then {
_qtynew_create_ammo = _qty_create_ammo + _item_ammo;
_qtynew_consume_ammo = _qty_consume_ammo - _item_ammo;
_qtynew_create_mags = ceil(_qtynew_create_ammo/_create_magsize);
_qtynew_consume_mags = ceil(_qtynew_consume_ammo/_consume_magsize);
} else {
_qtynew_create_ammo = _qty_total_ammo;
_qtynew_consume_ammo = 0;
};
if ((_qtynew_create_mags + _qtynew_consume_mags) > (_qty_create_mags + _qty_consume_mags + _qty_free_slots)) exitWith {
r_action_count = 0;
cutText [localize "str_player_24", "PLAIN DOWN"];
};
_qtynew_consume_mags_full = floor(_qtynew_consume_ammo/_consume_magsize);
_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);
//remove all _consume and _create mags (we already have total ammo count)
player removeMagazines _consume;
player removeMagazines _create;
for "_i" from 1 to _qtynew_consume_mags_full do {
player addMagazine _consume;
};
if (_qtynew_consume_ammo_rest != 0) then {
player addMagazine [_consume,_qtynew_consume_ammo_rest];
};
for "_i" from 1 to _qtynew_create_mags_full do {
player addMagazine _create;
};
if (_qtynew_create_ammo_rest != 0) then {
player addMagazine [_create,_qtynew_create_ammo_rest];
};
sleep 1;
r_action_count = 0;

View File

@@ -0,0 +1,84 @@
/*
Attempts to remove an attachment from the player's current primary weapon or sidearm.
Parameters:
string attachment item classname
string current weapon classname
string resulting weapon classname
Author:
Foxy
*/
#include "\z\addons\dayz_code\util\Player.hpp"
private
[
"_attachment",
"_weapon",
"_newWeapon",
"_weaponInUse",
"_newWeaponConfig",
"_muzzle"
];
//check if player is on a ladder and if so, exit
if (Player_IsOnLadder()) exitWith
{
closeDialog 0;
(localize "str_player_21") call dayz_rollingMessages;
};
_attachment = _this select 0;
_weapon = _this select 1;
_newWeapon = _this select 2;
//check that player has enough room in inventory
if ((([player] call BIS_fnc_invSlotsEmpty) select 4) < 1) exitWith
{
closeDialog 0;
(localize "str_player_24") call dayz_rollingMessages;
};
//check that player has the weapon
if (!(player hasWeapon _weapon)) exitWith
{
closeDialog 0;
(localize "str_AttachmentMissingWeapon3") call dayz_rollingMessages;
};
//Check that newWeapon + attachment actually results in current weapon
_newWeaponConfig = configFile >> "CfgWeapons" >> _newWeapon >> "Attachments";
if (!isClass(_newWeaponConfig) || {getText(_newWeaponConfig >> _attachment) != _weapon}) exitWith
{
closeDialog 0;
"Cannot remove attachment." call dayz_rollingMessages;
};
_weaponInUse = (currentWeapon player == _weapon);
call gear_ui_init;
player playActionNow "Medic";
//replace weapon and add attachment to inventory
player removeWeapon _weapon;
player addWeapon _newWeapon;
player addMagazine _attachment;
//close gear
(findDisplay 106) closeDisplay 0;
//Select new weapon if the old was in use
if (_weaponInUse) then
{
_muzzle = (getArray (configFile >> "CfgWeapons" >> _newWeapon >> "muzzles")) select 0;
if (_muzzle == "this") then
{
player selectWeapon _newWeapon;
}
else
{
player selectWeapon _muzzle;
};
};

View File

@@ -0,0 +1,54 @@
private ["_item","_use","_repair","_waterUsed"];
//['ItemKnifeBlunt','ItemKnife']
_item = _this select 0; //Item to be sharpened
_repair = _this select 1; //Item to be given back.
_use = ["ItemWaterBottle","ItemWaterBottleInfected","ItemWaterBottleSafe","ItemWaterBottleBoiled","ItemWaterBottleHerbal","ItemCanteen","ItemCanteenInfected","ItemCanteenSafe","ItemCanteenBoiled","ItemCanteenHerbal"];
_waterUsed = nil;
call gear_ui_init;
closeDialog 1;
{
if (_x IN magazines player) exitwith { _waterUsed = _x; };
} foreach _use;
// item is missing or tools are missing
if (isNil "_waterUsed") exitWith {
//_displayName = getText (configFile >> "CfgMagazines" >> _use >> "displayName");
_msg = "Missing Water";
_msg call dayz_rollingMessages;
};
// item is missing or tools are missing
if (!(_item IN items player)) exitWith {
_displayName = getText (configFile >> "CfgWeapons" >> _item >> "displayName");
//cutText [format["Missing Item",_displayName], "PLAIN DOWN"];
_msg = format["Missing %1",_displayName];
_msg call dayz_rollingMessages;
};
if (player hasWeapon _item) then {
_displayName = getText (configFile >> "CfgWeapons" >> _item >> "displayName");
player removeMagazine _waterUsed;
Player removeWeapon _item;
Player addWeapon _repair;
if (_waterUsed in ["ItemWaterBottle","ItemWaterBottleInfected","ItemWaterBottleSafe","ItemWaterBottleBoiled","ItemWaterBottleHerbal"]) then {
player addMagazine "ItemWaterBottleUnfilled";
};
if (_waterUsed in ["ItemCanteen","ItemCanteenInfected","ItemCanteenSafe","ItemCanteenBoiled","ItemCanteenHerbal"]) then {
player addMagazine "ItemCanteenEmpty";
};
//Remove Later
player removeMagazine "equip_brick";
//cutText [format ["%1 has been Sharpened",_displayName], "PLAIN DOWN"];
_msg = format ["%1 has been Sharpened",_displayName];
_msg call dayz_rollingMessages;
};

View File

@@ -0,0 +1 @@
1 call dz_fn_switchWeapon;

View File

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

View File

@@ -0,0 +1,58 @@
private ["_skin","_rnd","_rounded","_itemtocreate","_i"];
_skin = _this;
_config = configFile >> "CfgMagazines" >> _skin;
_itemtocreate = getText (_config >> "Craftoutput");
_rnd = random 3;
_rounded = round _rnd;
call gear_ui_init;
closeDialog 0;
_infoText = "";
//Tear the clothes
player playActionNow "Medic";
[player,"bandage",0,false] call dayz_zombieSpeak;
sleep 6;
player removeMagazine _skin;
switch (_rounded) do {
case 0: {
cutText [localize "str_tear_clothes_0", "PLAIN DOWN"];
};
case 1: {
cutText [localize "str_tear_clothes_1", "PLAIN DOWN"];
};
case 2: {
cutText [localize "str_tear_clothes_2", "PLAIN DOWN"];
};
case 3: {
cutText [localize "str_tear_clothes_3", "PLAIN DOWN"];
};
};
_i = 0;
while {_i < _rounded} do {
_i = _i + 1;
_result = [player,_itemtocreate] call BIS_fnc_invAdd;
if (_rnd < 0.5) then {
[player,"equip_string"] call BIS_fnc_invAdd;
};
sleep 0.03;
if (!_result) then {
systemchat (localize ("str_tear_clothes_noroom"));
_nearByPile = nearestObjects [getPosATL player, ["WeaponHolder","WeaponHolderBase"], 2];
_pile = if (count _nearByPile > 0) then {_nearByPile select 0};
if (count _nearByPile == 0) then {
_pos = player modeltoWorld [0,1,0];
_pos set [2, 0];
//diag_log format [ "%1 itempos:%2 _nearByPile:%3", __FILE__, _pos, _nearByPile];
_pile = createVehicle ["WeaponHolder", _pos, [], 0.0, "CAN_COLLIDE"];
_pile setPosATL _pos;
};
_pile addMagazineCargoGlobal [_itemtocreate,1];
};
};

View File

@@ -0,0 +1,37 @@
private["_item","_onLadder","_hasmeditem","_config","_text","_id"];
//Old System
_item = _this;
//Other initail info
call gear_ui_init;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
//Get config info
_config = configFile >> "CfgMagazines" >> _item;
_removeWeapon = getText (_config >> "oringal");
_addWeapon = getText (_config >> "weapon");
_text = getText (_config >> "displayName");
//item checks
_hasitem = _item in magazines player;
//fail saves
if (!_hasitem) exitWith { cutText [localize "str_missingAttachment", "PLAIN DOWN"]};
if (_onLadder) exitWith { cutText [localize "str_player_21", "PLAIN DOWN"] };
if (_removeWeapon in (weapons player)) then {
player removeMagazine _item;
player removeWeapon _removeWeapon;
player addWeapon _addWeapon;
if (vehicle player != player) then {
_display = findDisplay 106;
_display closeDisplay 0;
};
} else {
closedialog 0;
sleep 0.2;
cutText [format[ localize "str_missingweapon", _text, _removeWeapon] , "PLAIN DOWN"]
};

View File

@@ -0,0 +1,387 @@
/********************************************************************************************************************/
// Function file for [DayZ]
// Created by: [Horde]
//********************************************************************************************************************/
private ["_h_human_disp","_top_value","_bot_value","_card_details","_h","_blank","_bandit_pic","_bandit_pic","_b_human_disp","_b_spades_top_suit","_b_spades_bot_suit","_b_clubs_top_suit","_b_clubs_bot_suit","_survivor_pic","_survivor_pic","_s_human_disp","_s_top_joker_b","_s_bot_joker_b","_s_top_joker_r","_s_bot_joker_r","_hero_pic","_hero_pic","_h_hearts_top_suit","_h_hearts_bot_suit","_h_diamonds_top_suit","_h_diamonds_bot_suit"];
_h = (_this select 0) / 37037.037037;
// we need to return these
/*
_pl_pic
_humanity_readout
_top_joker
_bot_joker
_top_value
_bot_value
_top_suit
_bot_suit
*/
_blank = "<img size = '4' color = '#000000' align = 'left' image = '\z\addons\dayz_communityassets\pictures\playerstats\tally\0.paa'/>";
_b_human_disp = "<t size = '2' font = 'Zeppelin33' color = '#000000' shadow = 'false' align = 'center' underline = 'false'>"+(localize "str_playerstats_bandit")+"</t";
_b_spades_top_suit = "<img size = '3' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\spade.paa'/>";
_b_spades_bot_suit = "<img size = '3' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\spade_u.paa'/>";
_b_clubs_top_suit = "<img size = '3' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\club.paa'/>";
_b_clubs_bot_suit = "<img size = '3' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\club_u.paa'/>";
_s_human_disp = "<t size = '2' font = 'Zeppelin33' color = '#000000' shadow = 'false' align = 'center' underline = 'false'>"+(localize "str_playerstats_survivor")+"</t";
_s_top_joker_b = "<img size = '11' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\joker\joker_black.paa'/>";
_s_bot_joker_b = "<img size = '11' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\joker\joker_black_u.paa'/>";
_s_top_joker_r = "<img size = '11' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\joker\joker_red.paa'/>";
_s_bot_joker_r = "<img size = '11' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\joker\joker_red_u.paa'/>";
_h_hearts_top_suit = "<img size = '3' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\heart.paa'/>";
_h_hearts_bot_suit = "<img size = '3' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\heart_u.paa'/>";
_h_diamonds_top_suit = "<img size = '3' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\diamond.paa'/>";
_h_diamonds_bot_suit = "<img size = '3' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\diamond_u.paa'/>";
if (getText(configFile >> "cfgVehicles" >> (typeOf player) >> "TextPlural") != "Women") then
{
_h_human_disp = "<t size = '2' font = 'Zeppelin33' color = '#000000' shadow = 'false' align = 'center' underline = 'false'>"+(localize "str_playerstats_hero")+"</t";
_bandit_pic = "<img size = '14' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\face\bandit_m.paa'/>";
_survivor_pic = "<img size = '14' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\face\survivor_m.paa'/>";
_hero_pic = "<img size = '14' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\face\hero_m.paa'/>";
} else
{
_h_human_disp = "<t size = '2' font = 'Zeppelin33' color = '#000000' shadow = 'false' align = 'center' underline = 'false'>"+(localize "str_playerstats_heroine")+"</t";
_bandit_pic = "<img size = '14' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\face\bandit_f.paa'/>";
_survivor_pic = "<img size = '14' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\face\survivor_f.paa'/>";
_hero_pic = "<img size = '14' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\face\hero_f.paa'/>";
};
_card_details = [];
switch (true) do
{
case (_h < -27):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\ace.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\ace_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_spades_top_suit, _b_spades_bot_suit];
};
case (_h < -26):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\king.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\king_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_spades_top_suit, _b_spades_bot_suit];
};
case (_h < -25):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\queen.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\queen_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_spades_top_suit, _b_spades_bot_suit];
};
case (_h < -24):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\jack.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\jack_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_spades_top_suit, _b_spades_bot_suit];
};
case (_h < -23):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\10.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\10_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_spades_top_suit, _b_spades_bot_suit];
};
case (_h < -22):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\9.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\9_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_spades_top_suit, _b_spades_bot_suit];
};
case (_h < -21):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\8.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\8_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_spades_top_suit, _b_spades_bot_suit];
};
case (_h < -20):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\7.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\7_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_spades_top_suit, _b_spades_bot_suit];
};
case (_h < -19):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\6.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\6_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_spades_top_suit, _b_spades_bot_suit];
};
case (_h < -18):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\5.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\5_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_spades_top_suit, _b_spades_bot_suit];
};
case (_h < -17):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\4.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\4_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_spades_top_suit, _b_spades_bot_suit];
};
case (_h < -16):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\3.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\3_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_spades_top_suit, _b_spades_bot_suit];
};
case (_h < -15):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\2.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\2_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_spades_top_suit, _b_spades_bot_suit];
};
case (_h < -14):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\ace.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\ace_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_clubs_top_suit, _b_clubs_bot_suit];
};
case (_h < -13):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\king.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\king_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_clubs_top_suit, _b_clubs_bot_suit];
};
case (_h < -12):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\queen.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\queen_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_clubs_top_suit, _b_clubs_bot_suit];
};
case (_h < -11):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\jack.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\jack_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_clubs_top_suit, _b_clubs_bot_suit];
};
case (_h < -10):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\10.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\10_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_clubs_top_suit, _b_clubs_bot_suit];
};
case (_h < -9):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\9.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\9_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_clubs_top_suit, _b_clubs_bot_suit];
};
case (_h < -8):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\8.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\8_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_clubs_top_suit, _b_clubs_bot_suit];
};
case (_h < -7):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\7.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\7_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_clubs_top_suit, _b_clubs_bot_suit];
};
case (_h < -6):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\6.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\6_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_clubs_top_suit, _b_clubs_bot_suit];
};
case (_h < -5):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\5.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\5_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_clubs_top_suit, _b_clubs_bot_suit];
};
case (_h < -4):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\4.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\4_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_clubs_top_suit, _b_clubs_bot_suit];
};
case (_h < -3):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\3.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\3_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_clubs_top_suit, _b_clubs_bot_suit];
};
case (_h < -0.135):
{
_top_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\2.paa'/>";
_bot_value = "<img size = '5' color = '#000000' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_black\2_u.paa'/>";
_card_details = [_bandit_pic, _b_human_disp, _blank, _blank, _top_value, _bot_value, _b_clubs_top_suit, _b_clubs_bot_suit];
};
case (_h < 0):
{
_top_value = "<img size = '4' color = '#000000' align = 'left' image = '\z\addons\dayz_communityassets\pictures\playerstats\tally\0.paa'/>";
_card_details = [_survivor_pic, _s_human_disp, _s_top_joker_b, _s_bot_joker_b, _blank, _blank, _blank, _blank];
};
case (_h < 0.135):
{
_top_value = "<img size = '4' color = '#000000' align = 'left' image = '\z\addons\dayz_communityassets\pictures\playerstats\tally\0.paa'/>";
_card_details = [_survivor_pic, _s_human_disp, _s_top_joker_r, _s_bot_joker_r, _blank, _blank, _blank, _blank];
};
case (_h < 3):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\2.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\2_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_hearts_top_suit, _h_hearts_bot_suit];
};
case (_h < 4):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\3.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\3_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_hearts_top_suit, _h_hearts_bot_suit];
};
case (_h < 5):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\4.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\4_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_hearts_top_suit, _h_hearts_bot_suit];
};
case (_h < 6):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\5.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\5_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_hearts_top_suit, _h_hearts_bot_suit];
};
case (_h < 7):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\6.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\6_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_hearts_top_suit, _h_hearts_bot_suit];
};
case (_h < 8):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\7.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\7_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_hearts_top_suit, _h_hearts_bot_suit];
};
case (_h < 9):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\8.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\8_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_hearts_top_suit, _h_hearts_bot_suit];
};
case (_h < 10):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\9.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\9_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_hearts_top_suit, _h_hearts_bot_suit];
};
case (_h < 11):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\10.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\10_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_hearts_top_suit, _h_hearts_bot_suit];
};
case (_h < 12):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\jack.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\jack_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_hearts_top_suit, _h_hearts_bot_suit];
};
case (_h < 13):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\queen.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\queen_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_hearts_top_suit, _h_hearts_bot_suit];
};
case (_h < 14):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\king.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\king_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_hearts_top_suit, _h_hearts_bot_suit];
};
case (_h < 15):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\ace.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\ace_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_hearts_top_suit, _h_hearts_bot_suit];
};
case (_h < 16):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\2.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\2_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_diamonds_top_suit, _h_diamonds_bot_suit];
};
case (_h < 17):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\3.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\3_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_diamonds_top_suit, _h_diamonds_bot_suit];
};
case (_h < 18):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\4.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\4_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_diamonds_top_suit, _h_diamonds_bot_suit];
};
case (_h < 19):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\5.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\5_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_diamonds_top_suit, _h_diamonds_bot_suit];
};
case (_h < 20):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\6.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\6_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_diamonds_top_suit, _h_diamonds_bot_suit];
};
case (_h < 21):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\7.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\7_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_diamonds_top_suit, _h_diamonds_bot_suit];
};
case (_h < 22):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\8.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\8_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_diamonds_top_suit, _h_diamonds_bot_suit];
};
case (_h < 23):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\9.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\9_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_diamonds_top_suit, _h_diamonds_bot_suit];
};
case (_h < 24):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\10.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\10_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_diamonds_top_suit, _h_diamonds_bot_suit];
};
case (_h < 25):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\jack.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\jack_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_diamonds_top_suit, _h_diamonds_bot_suit];
};
case (_h < 26):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\queen.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\queen_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_diamonds_top_suit, _h_diamonds_bot_suit];
};
case (_h < 27):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\king.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\king_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_diamonds_top_suit, _h_diamonds_bot_suit];
};
case (_h >= 27):
{
_top_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\ace.paa'/>";
_bot_value = "<img size = '5' align = 'center' image = '\z\addons\dayz_communityassets\pictures\playerstats\cards\typeface_red\ace_u.paa'/>";
_card_details = [_hero_pic, _h_human_disp, _blank, _blank, _top_value, _bot_value, _h_diamonds_top_suit, _h_diamonds_bot_suit];
};
};
_card_details

View File

@@ -0,0 +1,70 @@
private ["_hum","_h","_humanity","_pl_pic","_humanity_readout","_top_joker","_bot_joker","_top_value","_bot_value","_top_suit","_bot_suit","_pl_name"];
//check humanity
_h = player getVariable["humanity", 0];
/*
IDC's
1201 // middle
1202 // bottom
1203 // top
1204 // pic on right hand page
*/
switch (true) do
{
case (_h < -666666):
{
ctrlSetText [1201, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_bandit_middle_1.paa"];
ctrlSetText [1202, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_bandit_bottom_1.paa"];
ctrlSetText [1203, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_bandit_top_1.paa"];
ctrlSetText [1204, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_bandit_3.paa"];
};
case (_h < -333333):
{
ctrlSetText [1201, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_bandit_middle_1.paa"];
ctrlSetText [1202, ""];
ctrlSetText [1203, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_bandit_top_1.paa"];
ctrlSetText [1204, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_bandit_2.paa"];
};
case (_h < -1999):
{
ctrlSetText [1201, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_bandit_middle_1.paa"];
ctrlSetText [1202, ""];
ctrlSetText [1203, ""];
ctrlSetText [1204, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_bandit_1.paa"];
};
case (_h < 5000):
{
ctrlSetText [1201, ""];
ctrlSetText [1202, ""];
ctrlSetText [1203, ""];
ctrlSetText [1204, ""];
};
case (_h < 333333):
{
ctrlSetText [1201, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_heropic_middle_1.paa"];
ctrlSetText [1202, ""];
ctrlSetText [1203, ""];
ctrlSetText [1204, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_hero_1.paa"];
};
case (_h < 666666):
{
ctrlSetText [1201, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_heropic_middle_1.paa"];
ctrlSetText [1202, ""];
ctrlSetText [1203, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_heropic_top_1.paa"];
ctrlSetText [1204, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_hero_2.paa"];
};
case (_h >= 666666):
{
ctrlSetText [1201, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_heropic_middle_1.paa"];
ctrlSetText [1202, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_heropic_bottom_1.paa"];
ctrlSetText [1203, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_heropic_top_1.paa"];
ctrlSetText [1204, "\z\addons\dayz_communityassets\pictures\playerstats\humanity\humanity_hero_3.paa"];
};
};

View File

@@ -0,0 +1,305 @@
private ["_ys","_ms","_ds","_b","_2","_6","_7","_8","_9","_10","_str_left_text","_1","_3","_4","_5","_blood_in_pack","_blood_in_inv","_mag_arr","_backpack","_11","_mags_for_weap","_mssv_cnt","_weapon","_config"];
_survivors = playersNumber west;
_str_left_text = "
<t size = '1.4' font = 'Zeppelin33' color = '#000000' shadow = 'false' align = 'left'>
"+(localize "str_playerstats_journal_1")+"
<br />
<br />
"+(localize "str_playerstats_journal_2")+"
<br />
<br />
%7%8%9 %10
<br />
<br />
%11
</t>
";
_1 = name player;
/*
if (player hasWeapon "ItemWatch") then
{
if (dayz_Survived == Dayz_logonDate) then // only interested if the same - assume server will only run over one day before restart
{
switch (true) do
{
case (Dayz_logonTime > 20): {_2 = (localize "str_playerstats_journal_1_a")};
case (Dayz_logonTime > 17): {_2 = (localize "str_playerstats_journal_1_b")};
case (Dayz_logonTime > 12): {_2 = (localize "str_playerstats_journal_1_c")};
default {_2 = (localize "str_playerstats_journal_1_d")};
};
} else
{
switch (true) do
{
case (Dayz_logonTime > 20): {_2 = (localize "str_playerstats_journal_1_e")};
case (Dayz_logonTime > 17): {_2 = (localize "str_playerstats_journal_1_f")};
case (Dayz_logonTime > 12): {_2 = (localize "str_playerstats_journal_1_g")};
default {_2 = (localize "str_playerstats_journal_1_h")};
};
};
} else
{
_2 = (localize "str_playerstats_journal_1_i");
};
_3 = Dayz_logonTown;
_4 = worldName;
_ys = str (date select 0);
_ms = "";
_ds = str (date select 2);
switch (true) do
{
case (date select 1 == 1):{_ms = (localize "str_playerstats_journal_month_1")};
case (date select 1 == 2):{_ms = (localize "str_playerstats_journal_month_2")};
case (date select 1 == 3):{_ms = (localize "str_playerstats_journal_month_3")};
case (date select 1 == 4):{_ms = (localize "str_playerstats_journal_month_4")};
case (date select 1 == 5):{_ms = (localize "str_playerstats_journal_month_5")};
case (date select 1 == 6):{_ms = (localize "str_playerstats_journal_month_6")};
case (date select 1 == 7):{_ms = (localize "str_playerstats_journal_month_7")};
case (date select 1 == 8):{_ms = (localize "str_playerstats_journal_month_8")};
case (date select 1 == 9):{_ms = (localize "str_playerstats_journal_month_9")};
case (date select 1 == 10):{_ms =(localize "str_playerstats_journal_month_10")};
case (date select 1 == 11):{_ms =(localize "str_playerstats_journal_month_11")};
case (date select 1 == 12):{_ms =(localize "str_playerstats_journal_month_12")};
};
_5 = format[localize "str_playerstats_journal_2_date", _ds, _ms, _ys];
// can't test dayz_Survived at home
switch (true) do
{
case (dayz_Survived == 0): {_6 = (localize "str_playerstats_journal_2_info_1")};
case (dayz_Survived == 1): {_6 = (localize "str_playerstats_journal_2_info_2")};
case (dayz_Survived > 1): {_6 = format [localize "str_playerstats_journal_2_info_3", dayz_Survived]};
default {};
};
switch (true) do
{
case (!r_fracture_legs and !r_fracture_arms): {_7 = (localize "str_playerstats_journal_3_1")};
case (r_fracture_legs and r_fracture_arms): {_7 = (localize "str_playerstats_journal_3_2")};
case (r_fracture_legs): {_7 = (localize "str_playerstats_journal_3_3")};
case (r_fracture_arms): {_7 = (localize "str_playerstats_journal_3_4")};
default {};
};
switch (true) do
{
case (r_player_infected):
{
if (!r_fracture_legs and !r_fracture_arms) then
{
_8 = (localize "str_playerstats_journal_4_1");
} else
{
_8 = (localize "str_playerstats_journal_4_2");
};
};
default {_8 = ""};
};
if (r_fracture_legs or r_fracture_arms) then
{
switch (true) do
{
case (r_player_blood < 3000): {_9 = (localize "str_playerstats_journal_5_1")};
case (r_player_blood < 6000): {_9 = (localize "str_playerstats_journal_5_2")};
case (r_player_blood < 9000): {_9 = (localize "str_playerstats_journal_5_3")};
case (r_player_blood < 11000): {_9 = (localize "str_playerstats_journal_5_4")};
case (r_player_blood == 12000): {_9 = (localize "str_playerstats_journal_5_5")};
default {_9 = "."};
};
}else
{
switch (true) do
{
case (r_player_blood < 3000): {_9 = (localize "str_playerstats_journal_5_6")};
case (r_player_blood < 6000): {_9 = (localize "str_playerstats_journal_5_7")};
case (r_player_blood < 9000): {_9 = (localize "str_playerstats_journal_5_8")};
case (r_player_blood < 11000): {_9 = (localize "str_playerstats_journal_5_9")};
case (r_player_blood == 12000):
{
if (r_player_infected) then
{
_9 = (localize "str_playerstats_journal_5_10");
} else
{
_9 = (localize "str_playerstats_journal_5_11");
};
};
default {_9 = "."};
};
};
_blood_in_pack = false;
_backpack = unitBackpack player;
if (!isNull _backpack) then
{
_mag_arr = getMagazineCargo _backpack;
if ("ItemBloodbag" in (_mag_arr select 0)) then
{
_blood_in_pack = true;
};
};
_blood_in_inv = false;
if ("ItemBloodbag" in (magazines player)) then
{
_blood_in_inv = true;
};
_10 = "";
if (r_player_blood < 9000 and (_blood_in_inv or _blood_in_pack)) then
{
if (_blood_in_inv) then
{
_10 = (localize "str_playerstats_journal_6_1");
} else
{
_10 = (localize "str_playerstats_journal_6_2");
};
};
if (r_player_blood < 9000 and ! _blood_in_inv and ! _blood_in_pack) then
{
_10 = (localize "str_playerstats_journal_6_3");
};
_11 = "";
_weapon = currentWeapon player;
_config = configFile >> "CfgWeapons";
// possibly filter out torch and the dayz_throwweapon thingy too. Need to get feedback..
if (_weapon != "" and _weapon != "Throw" and _weapon != "Put" and _weapon != "Flare") then
{
switch (true) do
{
case (getText (_config >> _weapon >> "melee") == "true"): // used getText as config entry had "" marks around it.
{
_11 = format [localize "str_playerstats_journal_7_1", getText (_config >> _weapon >> "displayName")];
};
case (_weapon == "ItemFlashlight" or _weapon == "ItemFlashlightRed"):
{
if (sunOrMoon == 1) then
{
_11 = format [localize "str_playerstats_journal_7_2", getText (_config >> _weapon >> "displayName")];
} else
{
_11 = format [localize "str_playerstats_journal_7_3", getText (_config >> _weapon >> "displayName")];
};
};
case (_weapon == "Makarov"):
{
_11 = format [localize "str_playerstats_journal_7_4", getText (_config >> _weapon >> "displayName")];
};
default
{
_mags_for_weap = getArray (_config >> _weapon >> "magazines");
_mssv_cnt = false;
{
if (_x in _mags_for_weap) then
{
_mssv_cnt = true;
};
} forEach (magazines player);
if (_mssv_cnt) then
{
if (player ammo _weapon > 0) then
{
_11 = format [localize "str_playerstats_journal_7_5", getText (configFile >> "CfgWeapons" >> _weapon >> "displayName")];
} else
{
_11 = format [localize "str_playerstats_journal_7_6", getText (configFile >> "CfgWeapons" >> _weapon >> "displayName")];
};
} else
{
_11 = format [localize "str_playerstats_journal_7_7", getText (_config >> _weapon >> "displayName")];
};
};
};
} else
{
_11 = (localize "str_playerstats_journal_7_8");
};
*/
_moon = if (dayz_ForcefullmoonNights) then { "Yes" } else { "No" };
_spawnselection = switch (dayz_spawnselection) do {
case 1: { "Yes" };
case 0: { "No" };
};
_disabledTemperature = switch (dayz_temperature_override) do {
case true: { "Disabled" };
case false: { "Enabled" };
};
// left page
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1800) ctrlSetStructuredText parseText format ["
<br/>
<t size='2' font='Zeppelin33' color = '#000000' align='left'>Health: </t><t size='2' font='Zeppelin33' align='right' color='#FF0033'>%1</t><br/>
<br/>
<t size='2' font='Zeppelin33' color = '#000000' align='left'>Hunger: </t><t size='2' font='Zeppelin33' align='right' color='#FF0033'>%2%</t><br/>
<t size='2' font='Zeppelin33' color = '#000000' align='left'>Thirst: </t><t size='2' font='Zeppelin33' align='right' color='#FF0033'>%3%</t><br/>
<br/>
<t size='2' font='Zeppelin33' color = '#000000' align='left'>Temp: </t><t size='2' font='Zeppelin33' align='right' color='#FF0033'>%5/%13</t><br/>
<br />
<t size='2' font='Zeppelin33' color = '#000000' align='left'>Humanity: </t><t size='2' font='Zeppelin33' align='right' color='#FF0033'>%6</t><br/>
<t size='2' font='Zeppelin33' color = '#000000' align='left'>Zombies: </t><t size='2' font='Zeppelin33' align='right' color='#FF0033'>%7</t><br/>
<br />
<t size='2' font='Zeppelin33' color = '#000000' align='left'>SpawnSelection: </t><t size='2' font='Zeppelin33' align='right' color='#FF0033'>%4</t><br/>
<t size='2' font='Zeppelin33' color = '#000000' align='left'>Full Moon: </t><t size='2' font='Zeppelin33' align='right' color='#FF0033'>%12</t><br/>
<br/>
<t size='2' font='Zeppelin33' color = '#000000' align='center'>Survived: %8 Day(s)</t><br/>
<br />
<t size='2' font='Zeppelin33' color = '#000000' align='center'>Survivors:%9</t><br/>
<br/>
<t size='2' font='Zeppelin33' color = '#000000' align='center'>FPS:%10, FPSMin:%11</t><br/>
",
(round(r_player_blood)),
//(player getVariable['USEC_BloodQty', r_player_blood]),
//(r_player_bloodpersec),
//(r_player_foodstack),
//(r_player_bloodregen),
(round(dayz_hunger)),
(round(dayz_thirst)),
(_spawnselection),
(round(dayz_temperatur)),
(player getVariable['humanity', 0]),
({alive _x} count entities "zZombie_Base"),
(dayz_Survived),
(_survivors),
(round diag_fps),
(round diag_fpsmin),
(_moon),
(_disabledTemperature)
];
// right page - blank until humanity is checked
_b = "<img size = '5' image = '\z\addons\dayz_communityassets\pictures\playerstats\tally\0.paa'/>";
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1801) ctrlSetStructuredText parseText format ["%1", _b];
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1802) ctrlSetStructuredText parseText format ["%1", _b];
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1803) ctrlSetStructuredText parseText format ["%1", _b];
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1804) ctrlSetStructuredText parseText format ["%1", _b];
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1805) ctrlSetStructuredText parseText format ["%1", _b];
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1806) ctrlSetStructuredText parseText format ["%1", _b];
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1807) ctrlSetStructuredText parseText format ["%1", _b];
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1808) ctrlSetStructuredText parseText format ["%1", _b];
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1809) ctrlSetStructuredText parseText format ["%1", _b];

View File

@@ -0,0 +1,33 @@
/********************************************************************************************************************/
// Function file for [DayZ]
// Created by: [Horde]
//********************************************************************************************************************/
private ["_pge","_tally_idc_arr","_need_to_blank_idc_arr","_kills","_5","_4","_3","_2","_1","_b"];
if (isDedicated) exitWith {};
// _pge = _this select 0;
_kills = _this select 0;
_5 = "<img size = '4.8' image = '\z\addons\dayz_communityassets\pictures\playerstats\tally\5.paa'/>";
_4 = "<img size = '4.8' image = '\z\addons\dayz_communityassets\pictures\playerstats\tally\4.paa'/>";
_3 = "<img size = '4.8' image = '\z\addons\dayz_communityassets\pictures\playerstats\tally\3.paa'/>";
_2 = "<img size = '4.8' image = '\z\addons\dayz_communityassets\pictures\playerstats\tally\2.paa'/>";
_1 = "<img size = '4.8' image = '\z\addons\dayz_communityassets\pictures\playerstats\tally\1.paa'/>";
_b = "<img size = '4.8' image = '\z\addons\dayz_communityassets\pictures\playerstats\tally\0.paa'/>";
// array of IDC's for tallys
_tally_idc_arr = [1204,1205,1206,1207,1208,1209,1210,1211,1212,1213,1214,1215,1216,1217,1218,1219,1220,1221,1222,1223,1224,1225,1226,1227,1228,1229,1230,1231,1232,1233,1234,1235,1236,1237,1238];
// array of IDC's for journal pages
_need_to_blank_idc_arr = [1800,1801,1802,1803,1804,1805,1806,1807,1808,1809];
{
((uiNamespace getVariable "horde_myDisplay") displayCtrl _x) ctrlSetStructuredText parseText format ["%1", _b];
} forEach _need_to_blank_idc_arr;
[_kills, _5, _4, _3, _2, _1, _b, _tally_idc_arr] call horde_epeen_fnc_fill_page;

View File

@@ -0,0 +1,62 @@
/********************************************************************************************************************/
// Function file for [DayZ]
// Created by: [Horde]
//********************************************************************************************************************/
private ["_count","_kills","_5","_4","_3","_2","_1","_b","_idc_arr","_extra_kills","_tally_kills","_full_box_count","_partial_box_tally","_add_kills"];
_kills = _this select 0;
_5 = _this select 1;
_4 = _this select 2;
_3 = _this select 3;
_2 = _this select 4;
_1 = _this select 5;
_b = _this select 6;
_idc_arr = _this select 7;
_extra_kills = 175 * (floor (_kills / 175));
_tally_kills = _kills - _extra_kills;
_full_box_count = floor (_tally_kills / 5);
_partial_box_tally = _tally_kills - (5 * (floor (_tally_kills / 5)));
_add_kills = "<t size = '3' font = 'Zeppelin33' color = '#000000' shadow = 'false' align = 'center' underline = 'false'>+</t>
" + format ["<t size = '3' font = 'Zeppelin33' color = '#000000' shadow = 'false' align = 'center' underline = 'false'>%1", _extra_kills];
_count = 1;
{
if (_count <= _full_box_count) then
{
((uiNamespace getVariable "horde_myDisplay") displayCtrl _x) ctrlSetStructuredText parseText format ["%1", _5];
};
if (_count == _full_box_count + 1) then
{
if (_partial_box_tally == 4) then
{
((uiNamespace getVariable "horde_myDisplay") displayCtrl _x) ctrlSetStructuredText parseText format ["%1", _4];
};
if (_partial_box_tally == 3) then
{
((uiNamespace getVariable "horde_myDisplay") displayCtrl _x) ctrlSetStructuredText parseText format ["%1", _3];
};
if (_partial_box_tally == 2) then
{
((uiNamespace getVariable "horde_myDisplay") displayCtrl _x) ctrlSetStructuredText parseText format ["%1", _2];
};
if (_partial_box_tally == 1) then
{
((uiNamespace getVariable "horde_myDisplay") displayCtrl _x) ctrlSetStructuredText parseText format ["%1", _1];
};
};
if (_count > _full_box_count + 1) then
{
((uiNamespace getVariable "horde_myDisplay") displayCtrl _x) ctrlSetStructuredText parseText format ["%1", _b];
};
_count = _count + 1;
} forEach _idc_arr;
// additional kills
if (_extra_kills > 0) then
{
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1239) ctrlSetStructuredText parseText format ["<br />%1", _add_kills];
} else
{
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1239) ctrlSetStructuredText parseText format ["%1", _b];
};

View File

@@ -0,0 +1,34 @@
/********************************************************************************************************************/
// Function file for [DayZ]
// Created by: [Horde]
//********************************************************************************************************************/
private ["_hum","_humanity","_pl_pic","_humanity_readout","_top_joker","_bot_joker","_top_value","_bot_value","_top_suit","_bot_suit","_pl_name"];
//check humanity
_humanity = player getVariable["humanity", 0];
_hum = [_humanity] call horde_epeen_determine_humanity_fnc;
_pl_pic = _hum select 0;
_humanity_readout = _hum select 1;
_top_joker = _hum select 2;
_bot_joker = _hum select 3;
_top_value = _hum select 4;
_bot_value = _hum select 5;
_top_suit = _hum select 6;
_bot_suit = _hum select 7;
_pl_name = format ["<t size = '1.1' font = 'Zeppelin33' color = '#000000' shadow = 'false' align = 'center' underline = 'false'>%1</t", name player];
ctrlShow [1906, false];
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1801) ctrlSetStructuredText parseText format ["%1", _top_value];
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1802) ctrlSetStructuredText parseText format ["%1", _bot_value];
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1803) ctrlSetStructuredText parseText format ["%1", _top_suit];
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1804) ctrlSetStructuredText parseText format ["%1", _bot_suit];
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1805) ctrlSetStructuredText parseText format ["%1", _top_joker];
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1806) ctrlSetStructuredText parseText format ["%1", _bot_joker];
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1807) ctrlSetStructuredText parseText format ["%1", _pl_pic];
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1808) ctrlSetStructuredText parseText format ["%1", _pl_name];
((uiNamespace getVariable "horde_myDisplay") displayCtrl 1809) ctrlSetStructuredText parseText format ["%1", _humanity_readout];
ctrlShow [1907, false];