diff --git a/dayz_code/CfgMagazines.hpp b/dayz_code/CfgMagazines.hpp
new file mode 100644
index 000000000..617f540b1
--- /dev/null
+++ b/dayz_code/CfgMagazines.hpp
@@ -0,0 +1,197 @@
+class CfgMagazines {
+ class CA_Magazine; // External class reference
+
+ class ItemTent : CA_Magazine {
+ scope = public;
+ count = 1;
+ type = (256 * 3);
+ displayName = $STR_EQUIP_NAME_20;
+ model = "\dayz_equip\models\tentbag_gear.p3d";
+ picture = "\dayz_equip\textures\equip_tentbag_ca.paa";
+ descriptionShort = $STR_EQUIP_DESC_20;
+
+ class ItemActions {
+ class Pitch {
+ text = $STR_PITCH_TENT;
+ script = "spawn player_tentPitch;";
+ };
+ };
+ };
+
+ class ItemSandbag : CA_Magazine {
+ scope = public;
+ count = 1;
+ type = 256;
+ displayName = $STR_EQUIP_NAME_21;
+ model = "\dayz_equip\models\sandbags.p3d";
+ picture = "\dayz_equip\textures\equip_sandbag_ca.paa";
+ descriptionShort = $STR_EQUIP_DESC_21;
+
+ class ItemActions {
+ class Build {
+ text = "Build me";
+ script = "spawn player_build;";
+ require = "ItemEtool";
+ create = "Sandbag1_DZ";
+ };
+ };
+ };
+
+ class ItemTankTrap : CA_Magazine {
+ scope = public;
+ count = 1;
+ type = 256;
+ displayName = $STR_EQUIP_NAME_22;
+ model = "\dayz_equip\models\tank_trap_kit.p3d";
+ picture = "\dayz_equip\textures\equip_tanktrap_kit_CA.paa";
+ descriptionShort = $STR_EQUIP_DESC_22;
+
+ class ItemActions {
+ class Build {
+ text = $STR_ACTIONS_BUILD;
+ script = "spawn player_build;";
+ require = "ItemToolbox";
+ create = "Hedgehog_DZ";
+ };
+ };
+ };
+
+ class TrapBear : CA_Magazine {
+ scope = public;
+ count = 1;
+ type = 256;
+ displayName = "Bear Trap";
+ model = "\dayz_equip\models\bear_trap_gear.p3d";
+ picture = "\dayz_equip\textures\equip_bear_trap_ca.paa";
+ descriptionShort = "Place to add a bear trap";
+
+ class ItemActions {
+ class Build {
+ text = "Place Trap";
+ script = "spawn player_setTrap;";
+ require = "ItemToolbox";
+ create = "BearTrap_DZ";
+ };
+ };
+ };
+
+ class ItemWire : CA_Magazine {
+ scope = public;
+ count = 1;
+ type = 256;
+ displayName = $STR_EQUIP_NAME_23;
+ model = "\dayz_equip\models\Fence_wire_kit.p3d";
+ picture = "\dayz_equip\textures\equip_fencewire_kit_CA.paa";
+ descriptionShort = $STR_EQUIP_DESC_23;
+
+ class ItemActions {
+ class Build {
+ text = $STR_ACTIONS_BUILD;
+ script = "spawn player_build;";
+ require = "ItemToolbox";
+ create = "Wire_cat1";
+ };
+ };
+ };
+
+ class FoodmuttonRaw : CA_Magazine {
+ scope = public;
+ count = 1;
+ type = 256;
+ displayName = $STR_FOOD_EQIP_CODE_NAME_1;
+ model = "\z\addons\dayz_communityassets\models\boar_raw.p3d";
+ picture = "\z\addons\dayz_communityassets\pictures\icon_boar_steak_raw_ca.paa";
+ descriptionShort = $STR_FOOD_EQUIP_CODE_DESC_1;
+ };
+
+ class FoodchickenRaw : CA_Magazine {
+ scope = public;
+ count = 1;
+ type = 256;
+ displayName = $STR_FOOD_EQIP_CODE_NAME_2;
+ model = "\z\addons\dayz_communityassets\models\chicken_raw.p3d";
+ picture = "\z\addons\dayz_communityassets\pictures\icon_chicken_raw_ca.paa";
+ descriptionShort = $STR_FOOD_EQUIP_CODE_DESC_2;
+ };
+
+ class FoodrabbitRaw : CA_Magazine {
+ scope = public;
+ count = 1;
+ type = 256;
+ displayName = $STR_FOOD_EQIP_CODE_NAME_3;
+ model = "\z\addons\dayz_communityassets\models\rabbit_raw.p3d";
+ picture = "\z\addons\dayz_communityassets\pictures\i_rabbit_raw_co.paa";
+ descriptionShort = $STR_FOOD_EQUIP_CODE_DESC_3;
+ };
+
+ class FoodbaconRaw : CA_Magazine {
+ scope = public;
+ count = 1;
+ type = 256;
+ displayName = $STR_FOOD_EQIP_CODE_NAME_4;
+ model = "\z\addons\dayz_communityassets\models\bacon_raw.p3d";
+ picture = "\z\addons\dayz_communityassets\pictures\i_bacon_raw.paa";
+ descriptionShort = $STR_FOOD_EQUIP_CODE_DESC_4;
+ };
+
+ class DayZ_Code_FoodEdible : CA_Magazine {
+ isFood = 1;
+ count = 1;
+ type = 256;
+ class ItemActions {
+ class Eat {
+ text = $STR_EAT_FOOD;
+ script = "spawn player_eat;";
+ };
+ };
+ };
+
+
+ class FoodmuttonCooked : DayZ_Code_FoodEdible {
+ scope = public;
+ count = 1;
+ displayName = $STR_FOODCOOKED_EQIP_CODE_NAME_1;
+ model = "\z\addons\dayz_communityassets\models\boar_geo.p3d";
+ picture = "\z\addons\dayz_communityassets\pictures\icon_boar_steak_cooked_ca.paa";
+ descriptionShort = $STR_FOODCOOKED_EQUIP_CODE_DESC_1;
+ bloodRegen = 200;
+ };
+
+ class FoodchickenCooked : DayZ_Code_FoodEdible {
+ scope = public;
+ count = 1;
+ displayName = $STR_FOODCOOKED_EQIP_CODE_NAME_2; //$STR_EQUIP_NAME_25
+ model = "\z\addons\dayz_communityassets\models\chicken_cooked.p3d";
+ picture = "\z\addons\dayz_communityassets\pictures\icon_chicken_cooked_ca.paa";
+ descriptionShort = $STR_FOODCOOKED_EQUIP_CODE_DESC_2;
+ bloodRegen = 400;
+ };
+
+ class FoodBaconCooked : DayZ_Code_FoodEdible {
+ scope = public;
+ count = 1;
+ displayName = $STR_FOODCOOKED_EQIP_CODE_NAME_4;
+ model = "\z\addons\dayz_communityassets\models\bacon_cooked.p3d";
+ picture = "\z\addons\dayz_communityassets\pictures\i_bacon_cooked.paa";
+ descriptionShort = $STR_FOODCOOKED_EQUIP_CODE_DESC_4;
+ bloodRegen = 800;
+ };
+ class FoodRabbitCooked : DayZ_Code_FoodEdible {
+ scope = public;
+ count = 1;
+ displayName = $STR_FOODCOOKED_EQIP_CODE_NAME_3;
+ model = "\z\addons\dayz_communityassets\models\rabbit_cooked.p3d";
+ picture = "\z\addons\dayz_communityassets\pictures\i_rabbit_cooked_co.paa";
+ descriptionShort = $STR_FOODCOOKED_EQUIP_CODE_DESC_3;
+ bloodRegen = 100;
+ };
+ class AngelCookies : DayZ_Code_FoodEdible {
+ scope = public;
+ count = 1;
+ displayName = $STR_FOODCOOKED_EQIP_CODE_NAME_5;
+ model = "\z\addons\dayz_communityassets\models\buiscits_box.p3d";
+ picture = "\z\addons\dayz_communityassets\pictures\i_buiscit_cai_buiscit_ca.paa";
+ descriptionShort = $STR_FOODCOOKED_EQUIP_CODE_DESC_5;
+ bloodRegen = 100;
+ };
+};
\ No newline at end of file
diff --git a/dayz_code/CfgMarkers.hpp b/dayz_code/CfgMarkers.hpp
new file mode 100644
index 000000000..073cde698
--- /dev/null
+++ b/dayz_code/CfgMarkers.hpp
@@ -0,0 +1,43 @@
+class CfgMarkers
+{
+ class Cricle01 {
+ name = "Marker description";
+ icon = "\z\addons\dayz_communityassets\cricle_01_raw.paa";
+ color[] = {1, 0, 0, 1};
+ size = 32;
+ shadow = true;
+ scope = private;
+ };
+ class Cricle02 {
+ name = "Marker description";
+ icon = "\z\addons\dayz_communityassets\cricle_02_raw.paa";
+ color[] = {1, 0, 0, 1};
+ size = 32;
+ shadow = true;
+ scope = private;
+ };
+ class Cross01 {
+ name = "Marker description";
+ icon = "\z\addons\dayz_communityassets\cross_01_raw.paa";
+ color[] = {1, 0, 0, 1};
+ size = 32;
+ shadow = true;
+ scope = private;
+ };
+ class Cross02 {
+ name = "Marker description";
+ icon = "\z\addons\dayz_communityassets\cross_02_raw.paa";
+ color[] = {1, 0, 0, 1};
+ size = 32;
+ shadow = true;
+ scope = private;
+ };
+class Questionmark {
+ name = "Marker description";
+ icon = "\z\addons\dayz_communityassets\questionmark_raw.paa";
+ color[] = {1, 0, 0, 1};
+ size = 32;
+ shadow = true;
+ scope = private;
+ };
+};
\ No newline at end of file
diff --git a/dayz_code/CfgWeapons.hpp b/dayz_code/CfgWeapons.hpp
new file mode 100644
index 000000000..1d7ec964b
--- /dev/null
+++ b/dayz_code/CfgWeapons.hpp
@@ -0,0 +1,72 @@
+class CfgWeapons {
+ class ItemCore;
+ class ItemMap1: ItemCore {
+ descriptionshort = "Map";
+ displayname = "Map";
+ picture = "\z\addons\dayz_communityassets\icons\gear_picture_map_01_ca.paa";
+ scope = 2;
+ simulation = "ItemMap";
+ };
+ class ItemMap2: ItemCore {
+ descriptionshort = "Map";
+ displayname = "Map";
+ picture = "\z\addons\dayz_communityassets\icons\gear_picture_map_02_ca.paa";
+ scope = 2;
+ simulation = "ItemMap";
+ };
+ class ItemMap3: ItemCore {
+ descriptionshort = "Map";
+ displayname = "Map";
+ picture = "\z\addons\dayz_communityassets\icons\gear_picture_map_03_ca.paa";
+ scope = 2;
+ simulation = "ItemMap";
+ };
+ class ItemMap_Debug: ItemCore {
+ descriptionshort = "Debug Map - Admin use only";
+ displayname = "Map";
+ picture = "\ca\ui\data\gear_picture_map_ca.paa";
+ scope = 2;
+ simulation = "ItemMap";
+ class Library {
+ libtextdesc = "Debug Map - Admin use only";
+ };
+ };
+ class ItemMatchboxWet : ItemCore {
+ scope = public;
+ displayName = $STR_EQUIP_CODE_NAME_3;
+ model = "\dayz_equip\models\matchbox_gear.p3d";
+ picture = "\z\addons\dayz_communityassets\pictures\equip_matchbox_wet_CA.paa";
+ descriptionShort = $STR_EQUIP_CODE_DESC_3;
+ };
+ class ItemMatchboxEmpty : ItemCore {
+ scope = public;
+ displayName = "Empty Match Box";
+ model = "\dayz_equip\models\matchbox_gear.p3d";
+ picture = "\z\addons\dayz_communityassets\pictures\equip_matchbox_wet_CA.paa";
+ descriptionShort = $STR_EQUIP_CODE_DESC_3;
+ };
+
+ class ItemBrokeHatchet : ItemCore {
+ scope = public;
+ displayName = $STR_EQUIP_CODE_NAME_41;
+ model = "\dayz_equip\models\hatchet.p3d";
+ picture = "\dayz_equip\textures\equip_hatchet_CA.paa";
+ descriptionShort = $STR_EQUIP_CODE_DESC_41;
+ class ItemActions {
+ class Toolbelt {
+ text = "Remove from Toolbelt";
+ script = "spawn player_addToolbelt;";
+ use[] = {"ItemBrokeHatchet"};
+ output[] = {"MeleeHatchet"};
+ };
+ };
+ };
+ class ItemKnifeBlunt : ItemCore {
+ scope = public;
+ displayName = $STR_EQUIP_CODE_NAME_4;
+ model = "\dayz_equip\models\knife_gear.p3d";
+ picture = "\dayz_equip\textures\equip_knife_ca.paa";
+ descriptionShort = $STR_EQUIP_CODE_DESC_4;
+ };
+
+};
\ No newline at end of file
diff --git a/dayz_code/actions/build.sqf b/dayz_code/actions/build.sqf
index 9d4a53878..38780df50 100644
--- a/dayz_code/actions/build.sqf
+++ b/dayz_code/actions/build.sqf
@@ -33,11 +33,7 @@ player reveal _object;
cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
-dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
-publicVariableServer "dayzPublishObj";
-if (isServer) then {
- dayzPublishObj call server_publishObj;
-};
+["dayzPublishObj",[dayz_characterID,_object,[_dir,_location],_classname]] call callRpcProcedure;
sleep 2;
player allowDamage true;
\ No newline at end of file
diff --git a/dayz_code/actions/buy_db.sqf b/dayz_code/actions/buy_db.sqf
index b5018a394..878a997b3 100644
--- a/dayz_code/actions/buy_db.sqf
+++ b/dayz_code/actions/buy_db.sqf
@@ -10,11 +10,7 @@ _category = (_this select 3) select 1;
diag_log format["DEBUG TRADER OBJ: %1", _trader_id];
-dayzTraderMenu = [_activatingPlayer,_trader_id,_category,_action];
-publicVariableServer "dayzTraderMenu";
-if (isServer) then {
- dayzTraderMenu call server_traders;
-};
+["dayzTraderMenu",[_activatingPlayer,_trader_id,_category,_action]] call callRpcProcedure;
waitUntil {!isNil "dayzTraderMenuResult"};
diff --git a/dayz_code/actions/forcesave.sqf b/dayz_code/actions/forcesave.sqf
index 32416c00a..aa76ad173 100644
--- a/dayz_code/actions/forcesave.sqf
+++ b/dayz_code/actions/forcesave.sqf
@@ -1,7 +1,3 @@
private["_object"];
-dayzUpdateVehicle = [_this select 3,"all"];
-publicVariableServer "dayzUpdateVehicle";
-if (isServer) then {
- dayzUpdateVehicle call server_updateObject;
-};
\ No newline at end of file
+["dayzUpdateVehicle",[_this select 3,"all"]] call callRpcProcedure;
diff --git a/dayz_code/actions/gather_meat.sqf b/dayz_code/actions/gather_meat.sqf
index 81c7175b4..5ddaa2ac8 100644
--- a/dayz_code/actions/gather_meat.sqf
+++ b/dayz_code/actions/gather_meat.sqf
@@ -1,38 +1,43 @@
-private["_hasKnife","_qty","_item","_text","_string","_type","_loop","_meat","_timer"];
+private["_item","_hasKnife","_hasKnifeBlunt","_hasHarvested","_qty","_text","_string","_type"];
_item = _this select 3;
_hasKnife = "ItemKnife" in items player;
+_hasKnifeBlunt = "ItemKnifeBlunt" in items player;
_type = typeOf _item;
_hasHarvested = _item getVariable["meatHarvested",false];
_config = configFile >> "CfgSurvival" >> "Meat" >> _type;
player removeAction s_player_butcher;
s_player_butcher = -1;
+_hasChance = 9 > random 100;
-if (_hasKnife and !_hasHarvested) then {
+if (_hasKnife) then {
+ if (_hasChance) then {
+ player removeWeapon "ItemKnife";
+ player addWeapon "ItemKnifeBlunt";
+ cutText [localize "STR_EQUIP_CODE_DESC_4", "PLAIN DOWN"];
+ };
+};
+
+if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
//Get Animal Type
- _loop = true;
_isListed = isClass (_config);
_text = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
player playActionNow "Medic";
[player,"gut",0,false] call dayz_zombieSpeak;
_item setVariable["meatHarvested",true,true];
+ _item setVariable ["timerawmeatHarvested",time,false];
- _qty = 1;
+ _qty = 2;
if (_isListed) then {
_qty = getNumber (_config >> "yield");
};
+ if (_hasKnifeBlunt) then { _qty = round(_qty / 2); };
+
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
- _array = [_item,_qty];
-
- if (local _item) then {
- _array spawn local_gutObject;
- } else {
- dayzGutBody = _array;
- publicVariable "dayzGutBody";
- };
+ ["dayzGutBody",[_item,_qty]] call callRpcProcedure;
sleep 6;
_string = format[localize "str_success_gutted_animal",_text,_qty];
diff --git a/dayz_code/actions/gather_zparts.sqf b/dayz_code/actions/gather_zparts.sqf
index 16571cdbb..e81ec2b82 100644
--- a/dayz_code/actions/gather_zparts.sqf
+++ b/dayz_code/actions/gather_zparts.sqf
@@ -1,6 +1,7 @@
private["_hasKnife","_qty","_item","_text","_string","_type","_loop","_meat","_timer"];
_item = _this select 3;
_hasKnife = "ItemKnife" in items player;
+_hasKnifeBlunt = "ItemKnifeBlunt" in items player;
_type = typeOf _item;
_hasHarvested = _item getVariable["meatHarvested",false];
_config = configFile >> "CfgSurvival" >> "Meat" >> _type;
@@ -8,7 +9,7 @@ _config = configFile >> "CfgSurvival" >> "Meat" >> _type;
player removeAction s_player_butcher;
s_player_butcher = -1;
-if (_hasKnife and !_hasHarvested) then {
+if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
//Get Animal Type
_loop = true;
_isListed = isClass (_config);
@@ -18,21 +19,13 @@ if (_hasKnife and !_hasHarvested) then {
[player,"gut",0,false] call dayz_zombieSpeak;
_item setVariable["meatHarvested",true,true];
- _qty = 1;
- if (_isListed) then {
- _qty = getNumber (_config >> "yield");
- };
+ _qty = 1;
_id = [player,100,true,(getPosATL player)] spawn player_alertZombies;
_array = [_item,_qty];
- if (local _item) then {
- _array spawn local_gutObjectZ;
- } else {
- dayzGutBodyZ = _array;
- publicVariable "dayzGutBodyZ";
- };
+ ["dayzGutBodyZ",[_item,_qty]] call callRpcProcedure;
sleep 6;
_string = format["Successfully Gutted Zombie",_text,_qty];
diff --git a/dayz_code/actions/player_build.sqf b/dayz_code/actions/player_build.sqf
index 928f70663..4952fb07c 100644
--- a/dayz_code/actions/player_build.sqf
+++ b/dayz_code/actions/player_build.sqf
@@ -3,6 +3,7 @@ _location = player modeltoworld [0,1,0];
_location set [2,0];
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_isWater = (surfaceIsWater _location) or dayz_isSwimming;
+_bypass = false;
call gear_ui_init;
@@ -11,33 +12,36 @@ if(_onLadder) exitWith {cutText [localize "str_player_21", "PLAIN DOWN"];};
_item = _this;
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
+_require = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "require");
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
_hasbuilditem = _this in magazines player;
+_hasrequireditem = _require in items player;
if (!_hasbuilditem) exitWith {cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]};
+if (_text == "TrapBear") then { _bypass = true; };
-_dir = getDir player;
-player removeMagazine _item;
+if (_hasrequireditem or _bypass) then {
+ _dir = getDir player;
+ player removeMagazine _item;
-player playActionNow "Medic";
-sleep 1;
-[player,"repair",0,false] call dayz_zombieSpeak;
-_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
-sleep 5;
-
-player allowDamage false;
-_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
-_object setDir _dir;
-player reveal _object;
+ player playActionNow "Medic";
+ sleep 1;
+ [player,"repair",0,false] call dayz_zombieSpeak;
+ _id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
+ sleep 5;
+
+ player allowDamage false;
+ _object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
+ _object setDir _dir;
+ player reveal _object;
-cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
+ cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
-dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
-publicVariableServer "dayzPublishObj";
-if (isServer) then {
- dayzPublishObj call server_publishObj;
-};
+ ["dayzPublishObj",[dayz_characterID,_object,[_dir,_location],_classname]] call callRpcProcedure;
-sleep 2;
-player allowDamage true;
\ No newline at end of file
+ sleep 2;
+ player allowDamage true;
+} else {
+ cutText [format[localize "str_build_failed_01",_text], "PLAIN DOWN"];
+};
\ No newline at end of file
diff --git a/dayz_code/actions/player_chopWood.sqf b/dayz_code/actions/player_chopWood.sqf
index 294ad5d3c..002ec646f 100644
--- a/dayz_code/actions/player_chopWood.sqf
+++ b/dayz_code/actions/player_chopWood.sqf
@@ -2,14 +2,21 @@ private["_location","_isOk","_dir","_classname"];
private["_item"];
_item = _this;
call gear_ui_init;
+_hasChance = 9 > random 100;
if (["forest",dayz_surfaceType] call fnc_inString) then {
+ if (!_hasChance) then {
_result = [player,"PartWoodPile"] call BIS_fnc_invAdd;
if (_result) then {
cutText [localize "str_player_25", "PLAIN DOWN"];
} else {
cutText [localize "str_player_24", "PLAIN DOWN"];
};
+ } else {
+ player removeWeapon "ItemHatchet";
+ player addWeapon "ItemBrokeHatchet";
+ cutText [localize "str_player_23", "PLAIN DOWN"];
+ }
} else {
cutText [localize "str_player_23", "PLAIN DOWN"];
};
\ No newline at end of file
diff --git a/dayz_code/actions/player_drink.sqf b/dayz_code/actions/player_drink.sqf
index 5bc58fa66..fe07716f1 100644
--- a/dayz_code/actions/player_drink.sqf
+++ b/dayz_code/actions/player_drink.sqf
@@ -6,11 +6,15 @@ if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
if (vehicle player != player) exitWith {cutText ["You may not drink while in a vehicle", "PLAIN DOWN"]};
-if (dayz_thirst == 0) exitWith {cutText ["I am not thirsty", "PLAIN DOWN"]};
+//Force players to wait 3 mins to drink again
+if (dayz_lastDrink < 180) exitWith {cutText ["You may not drink, your not thirsty", "PLAIN DOWN"]};
_item = _this;
_hasdrinkitem = _this in magazines player;
+_rndInfection = (random 15);
+_DrinkInfection = (_rndInfection < 1);
+
_config = configFile >> "CfgMagazines" >> _item;
_text = getText (_config >> "displayName");
_sfx = getText (_config >> "sfx");
@@ -25,7 +29,13 @@ sleep 1;
if (_item == "ItemWaterbottle") then {
player addMagazine "ItemWaterbottleUnfilled";
+ if (_DrinkInfection) then {
+ r_player_infected = true;
+ player setVariable["USEC_infected",true];
};
+};
+
+
player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
/*
diff --git a/dayz_code/actions/player_eat.sqf b/dayz_code/actions/player_eat.sqf
index 35e61d1d7..98bc084d3 100644
--- a/dayz_code/actions/player_eat.sqf
+++ b/dayz_code/actions/player_eat.sqf
@@ -5,17 +5,30 @@ _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animati
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
if (vehicle player != player) exitWith {cutText ["You may not eat while in a vehicle", "PLAIN DOWN"]};
-
-if (dayz_hunger == 0) exitWith {cutText ["I am not hungry", "PLAIN DOWN"]};
+//Force players to wait 3 mins to eat again
+if (dayz_lastMeal < 180) exitWith {cutText ["You may not eat, you're already full", "PLAIN DOWN"]};
_item = _this;
-_hasfoodmag = _this in magazines player;
+_hasfooditem = _this in magazines player;
+
+_rndInfection = (random 15);
+_EatInfection = (_rndInfection < 1);
_config = configFile >> "CfgMagazines" >> _item;
_text = getText (_config >> "displayName");
_regen = getNumber (_config >> "bloodRegen");
-if (!_hasfoodmag) exitWith {cutText [format[(localize "str_player_31"),_text,"consume"] , "PLAIN DOWN"]};
+if (!_hasfooditem) exitWith {cutText [format[(localize "str_player_31"),_text,"consume"] , "PLAIN DOWN"]};
+
+if (_EatInfection) then {
+ if (_item == "FoodSteakCooked" ) then {
+ r_player_infected = true;
+ player setVariable["USEC_infected",true];
+ };
+};
+
+//Rawtime = getVarable _item
+//_Cookedtime = _item getVariable ["timemeatCooked", time];
player playActionNow "PutDown";
player removeMagazine _item;
@@ -38,11 +51,7 @@ _update = player getVariable["updatePlayer",[false,false,false,false,false]];
_update set [3,true];
player setVariable["updatePlayer",_update,true];
*/
-dayzPlayerSave = player;
-publicVariableServer "dayzPlayerSave";
-if (isServer) then {
- dayzPlayerSave call server_updatePlayer;
-};
+["dayzPlayerSave",[player,[],true]] call callRpcProcedure;
dayz_lastMeal = time;
dayz_hunger = 0;
diff --git a/dayz_code/actions/player_makefire.sqf b/dayz_code/actions/player_makefire.sqf
index e17f848eb..7cfb1b518 100644
--- a/dayz_code/actions/player_makefire.sqf
+++ b/dayz_code/actions/player_makefire.sqf
@@ -6,9 +6,11 @@ if ((_location select 2) < 0) then {
//_location set [2,0];
_isOk = true; //count (_location isFlatEmpty [0.3,0,0,4,0,false,player]) > 0;
_hasWood = "PartWoodPile" in magazines player;
+_hasChance = 9 > random 100;
if (_hasWood) then {
if (_isOk) then {
+ if (!_hasChance) then {
player removeMagazine "PartWoodPile";
_dir = getDir player;
_classname = "Land_Fire_DZ";
@@ -21,6 +23,11 @@ if (_hasWood) then {
_id = _fire spawn player_fireMonitor;
cutText [localize "str_fireplace_01", "PLAIN DOWN"];
+ } else {
+ player removeWeapon "ItemMatchbox";
+ player addWeapon "ItemMatchboxEmpty";
+ cutText [localize "Your box of matches appear to be empty", "PLAIN DOWN"];
+ };
} else {
cutText [localize "str_fireplace_02", "PLAIN DOWN"];
};
diff --git a/dayz_code/actions/player_tagFriendly.sqf b/dayz_code/actions/player_tagFriendly.sqf
index af8968dda..14e1d3ab2 100644
--- a/dayz_code/actions/player_tagFriendly.sqf
+++ b/dayz_code/actions/player_tagFriendly.sqf
@@ -5,18 +5,21 @@ _action = _this select 2;
_caller removeAction _action;
-_callerID = _caller getVariable "characterID";
-_targetID = _target getVariable "characterID";
+_callerID = _caller getVariable ["characterID", "0"];
+_targetID = _target getVariable ["characterID", "0"];
-_friendlies = _caller getVariable ["friendlies", []];
-_friendlies set [count _friendlies, _targetID];
-_caller setVariable ["friendlies", _friendlies, true];
+if (_callerID != 0 && _targetID != 0) then {
-_rfriendlies = _target getVariable ["friendlies", []];
+ _friendlies = _caller getVariable ["friendlies", []];
+ _friendlies set [count _friendlies, _targetID];
+ _caller setVariable ["friendlies", _friendlies, true];
-if ((isNull _rfriendlies) or !(_callerID in _rfriendlies)) then {
- // caller
- titleText [format["You have tagged %1 as friendly. Waiting for %1 to accept that.",(name _target)]];
- // target
- [_caller,_target,"loc",rTITLETEXT,format["%1 wants to tag you as friendly. To accept, tag %1 as friendly.", (name _caller)],"PLAIN DOWN"] call RE;
-};
+ _rfriendlies = _target getVariable ["friendlies", []];
+
+ if ((isNil "_rfriendlies") or !(_callerID in _rfriendlies)) then {
+ // caller
+ titleText [format["You have tagged %1 as friendly. Waiting for %1 to accept that.",(name _target)]];
+ // target
+ [_caller,_target,"loc",rTITLETEXT,format["%1 wants to tag you as friendly. To accept, tag %1 as friendly.", (name _caller)],"PLAIN DOWN"] call RE;
+ };
+};
\ No newline at end of file
diff --git a/dayz_code/actions/playerstats.sqf b/dayz_code/actions/playerstats.sqf
new file mode 100644
index 000000000..6fbedb90f
--- /dev/null
+++ b/dayz_code/actions/playerstats.sqf
@@ -0,0 +1,38 @@
+//Remove action menu
+player removeAction s_player_stats;
+s_player_stats = -1;
+
+//set stats enabled later use
+player setVariable ["StatsEnabled",true,false];
+
+//Let Zeds know
+_id = [player,4,true,(getPosATL player)] spawn player_alertZombies;
+
+//display gui (temp hint)
+
+hintSilent parseText format ["
+ %1
+ Zombies Killed: %2
+ Headshots: %3
+ Murders: %4
+ Bandits Killed: %5
+ Humanity: %6
",
+ (name player),
+ (player getVariable['zombieKills', 0]),
+ (player getVariable['headShots', 0]),
+ (player getVariable['humanKills', 0]),
+ (player getVariable['banditKills', 0]),
+ (player getVariable['humanity', 0])
+];
+
+/*
+player createDiarySubject ["MyDiary","My Diary"];
+player createDiaryRecord ["MyDiary",["Stats", "Zombies Killed: "]];
+player createDiaryRecord ["MyDiary",["Stats", "Headshots: "]];
+player createDiaryRecord ["MyDiary",["Stats", "Murders: "]];
+player createDiaryRecord ["MyDiary",["Stats", "Bandits Killed: "]];
+player createDiaryRecord ["MyDiary",["Stats", "Humanity: "]];
+*/
+
+//Remove variable
+player setVariable ["StatsEnabled",false,false];
diff --git a/dayz_code/actions/pzombie/pz_feed.sqf b/dayz_code/actions/pzombie/pz_feed.sqf
index 7da2bb8aa..8e38239c9 100644
--- a/dayz_code/actions/pzombie/pz_feed.sqf
+++ b/dayz_code/actions/pzombie/pz_feed.sqf
@@ -58,11 +58,7 @@ dayz_thirst = 0;
dayz_lastMeal = time;
dayz_hunger = 0;
-dayzPlayerSave = player;
-publicVariableServer "dayzPlayerSave";
-if (isServer) then {
- dayzPlayerSave call server_updatePlayer;
-};
+["dayzPlayerSave",[player,[],true]] call callRpcProcedure;
[player,"eat",0,false] call dayz_zombieSpeak;
@@ -83,10 +79,9 @@ _display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1302;
_control ctrlShow true;
-// Remove body
-dayzHideBody = _item;
-publicVariable "dayzHideBody";
-hideBody _item;
+// Remove body
+["dayzHideBody",_item] call broadcastRpcCallAll;
+
cutText [format[(localize "str_player_consumed"),_item, "PLAIN DOWN"];
diff --git a/dayz_code/actions/refuel.sqf b/dayz_code/actions/refuel.sqf
index 5857b8e81..438aea9f1 100644
--- a/dayz_code/actions/refuel.sqf
+++ b/dayz_code/actions/refuel.sqf
@@ -21,9 +21,9 @@ _id = [player,20,true,(getPosATL player)] spawn player_alertZombies;
sleep 6;
-dayzSetFuel = [_vehicle,_newFuel];
-dayzSetFuel spawn local_sefFuel;
-publicVariable "dayzSetFuel";
+//apply newFuel to vehicle on every peer
+["dayzSetFuel",[_vehicle,_newFuel]] call broadcastRpcCallAll;
+
cutText [format[localize "str_player_05",_nameType,_canSize], "PLAIN DOWN"];
sleep 1;
diff --git a/dayz_code/actions/remove.sqf b/dayz_code/actions/remove.sqf
index 7d4a26456..e5b06b3bb 100644
--- a/dayz_code/actions/remove.sqf
+++ b/dayz_code/actions/remove.sqf
@@ -13,10 +13,5 @@ sleep 1;
_id = [player,50,true,(getPosATL player)] spawn player_alertZombies;
sleep 5;
-dayzDeleteObj = [_objectID,_objectUID];
-publicVariableServer "dayzDeleteObj";
-if (isServer) then {
- dayzDeleteObj call local_deleteObj;
-};
-
+["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
deleteVehicle _obj;
\ No newline at end of file
diff --git a/dayz_code/actions/repair.sqf b/dayz_code/actions/repair.sqf
index 9491e7f98..ba4323fc3 100644
--- a/dayz_code/actions/repair.sqf
+++ b/dayz_code/actions/repair.sqf
@@ -26,11 +26,8 @@ if (_section and _hasToolbox) then {
//Fix the part
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
- dayzSetFix = [_vehicle,_selection,0];
- publicVariable "dayzSetFix";
- if (local _vehicle) then {
- dayzSetFix call object_setFixServer;
- };
+ //vehicle is owned by whoever is in it, so we have to have each client try and fix it
+ ["dayzSetFix",[_vehicle,_selection,0],_vehicle] call broadcastRpcCallIfLocal;
player playActionNow "Medic";
sleep 1;
@@ -64,12 +61,5 @@ _allFixed = true;
//update if repaired
if (_allFixed) then {
_vehicle setDamage 0;
- dayzUpdateVehicle = [_vehicle,"repair"];
- if (isServer) then {
- if (allowConnection) then {
- dayzUpdateVehicle call server_updateObject;
- };
- } else {
- publicVariable "dayzUpdateVehicle";
- };
+ ["dayzUpdateVehicle",[_vehicle,"repair"]] call callRpcProcedure;
};
\ No newline at end of file
diff --git a/dayz_code/actions/sell_db.sqf b/dayz_code/actions/sell_db.sqf
index 6afae3ffb..155cc0109 100644
--- a/dayz_code/actions/sell_db.sqf
+++ b/dayz_code/actions/sell_db.sqf
@@ -10,11 +10,7 @@ _category = (_this select 3) select 1;
diag_log format["DEBUG TRADER OBJ: %1", _trader_id];
-dayzTraderMenu = [_activatingPlayer,_trader_id,_category,_action];
-publicVariableServer "dayzTraderMenu";
-if (isServer) then {
- dayzTraderMenu call server_traders;
-};
+["dayzTraderMenu",[_activatingPlayer,_trader_id,_category,_action]] call callRpcProcedure;
waitUntil {!isNil "dayzTraderMenuResult"};
diff --git a/dayz_code/actions/tent_pitch.sqf b/dayz_code/actions/tent_pitch.sqf
index 8ad3b4ba9..dbb32daa5 100644
--- a/dayz_code/actions/tent_pitch.sqf
+++ b/dayz_code/actions/tent_pitch.sqf
@@ -57,11 +57,7 @@ if (!_isOk) then {
//player setVariable ["tentUpdate",["Land_A_tent",_dir,_location,[dayz_tentWeapons,dayz_tentMagazines,dayz_tentBackpacks]],true];
- dayzPublishObj = [dayz_characterID,_tent,[_dir,_location],"TentStorage"];
- publicVariable "dayzPublishObj";
- if (isServer) then {
- dayzPublishObj call server_publishObj;
- };
+ ["dayzPublishObj",[dayz_characterID,_tent,[_dir,_location],"TentStorage"]] call callRpcProcedure;
cutText [localize "str_success_tent_pitch", "PLAIN DOWN"];
} else {
diff --git a/dayz_code/actions/trade_any_boat.sqf b/dayz_code/actions/trade_any_boat.sqf
index caa61d5d9..6afcaabee 100644
--- a/dayz_code/actions/trade_any_boat.sqf
+++ b/dayz_code/actions/trade_any_boat.sqf
@@ -25,13 +25,7 @@ if(_buy_o_sell == "buy") then {
if (_qty >= _qty_in) then {
- // server_tradeObject [_activatingPlayer,_traderID,_bos]
- dayzTradeObject = [_activatingPlayer,_traderID,_bos];
- publicVariableServer "dayzTradeObject";
-
- if (isServer) then {
- dayzTradeObject call server_tradeObject;
- };
+ ["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
@@ -63,13 +57,7 @@ if (_qty >= _qty_in) then {
_veh setVariable ["characterID",dayz_playerUID,true];
- // server_publishVeh [_veh,[_dir,_objPosition],_vehicle,true,dayz_characterID]
- dayzPublishVeh = [_veh,[_dir,_location],_part_out,false,dayz_playerUID];
-
- publicVariableServer "dayzPublishVeh";
- if (isServer) then {
- dayzPublishVeh call server_publishVeh;
- };
+ ["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,dayz_playerUID]] call callRpcProcedure;
cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
@@ -82,11 +70,7 @@ if (_qty >= _qty_in) then {
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
- dayzDeleteObj = [_objectID,_objectUID];
- publicVariableServer "dayzDeleteObj";
- if (isServer) then {
- dayzDeleteObj call local_deleteObj;
- };
+ ["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
deleteVehicle _obj;
diff --git a/dayz_code/actions/trade_any_vehicle.sqf b/dayz_code/actions/trade_any_vehicle.sqf
index f7d4c07cf..ed0be32f8 100644
--- a/dayz_code/actions/trade_any_vehicle.sqf
+++ b/dayz_code/actions/trade_any_vehicle.sqf
@@ -25,13 +25,7 @@ if(_buy_o_sell == "buy") then {
if (_qty >= _qty_in) then {
- // server_tradeObject [_activatingPlayer,_traderID,_bos]
- dayzTradeObject = [_activatingPlayer,_traderID,_bos];
- publicVariableServer "dayzTradeObject";
-
- if (isServer) then {
- dayzTradeObject call server_tradeObject;
- };
+ ["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
@@ -63,14 +57,8 @@ if (_qty >= _qty_in) then {
_veh setVariable ["characterID",dayz_playerUID,true];
- // server_publishVeh [_veh,[_dir,_objPosition],_vehicle,true,dayz_characterID]
- dayzPublishVeh = [_veh,[_dir,_location],_part_out,false,dayz_playerUID];
-
- publicVariableServer "dayzPublishVeh";
- if (isServer) then {
- dayzPublishVeh call server_publishVeh;
- };
-
+ ["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,dayz_playerUID]] call callRpcProcedure;
+
cutText [format[("Bought %3 %4 for %1 %2"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
} else {
// Sell Vehicle
@@ -82,11 +70,7 @@ if (_qty >= _qty_in) then {
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
- dayzDeleteObj = [_objectID,_objectUID];
- publicVariableServer "dayzDeleteObj";
- if (isServer) then {
- dayzDeleteObj call local_deleteObj;
- };
+ ["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
deleteVehicle _obj;
diff --git a/dayz_code/actions/trade_backpacks.sqf b/dayz_code/actions/trade_backpacks.sqf
index 90c4eef03..174617179 100644
--- a/dayz_code/actions/trade_backpacks.sqf
+++ b/dayz_code/actions/trade_backpacks.sqf
@@ -27,13 +27,7 @@ if(_buy_o_sell == "buy") then {
if (_qty >= _qty_in) then {
- // server_tradeObject [_activatingPlayer,_traderID,_bos]
- dayzTradeObject = [_activatingPlayer,_traderID,_bos];
- publicVariableServer "dayzTradeObject";
-
- if (isServer) then {
- dayzTradeObject call server_tradeObject;
- };
+ ["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
diff --git a/dayz_code/actions/trade_items.sqf b/dayz_code/actions/trade_items.sqf
index eeb17e1c8..d7d1f14ba 100644
--- a/dayz_code/actions/trade_items.sqf
+++ b/dayz_code/actions/trade_items.sqf
@@ -21,13 +21,7 @@ if (_qty >= _qty_in) then {
_bos = 1;
};
- // server_tradeObject [_activatingPlayer,_traderID,_bos]
- dayzTradeObject = [_activatingPlayer,_traderID,_bos];
- publicVariableServer "dayzTradeObject";
-
- if (isServer) then {
- dayzTradeObject call server_tradeObject;
- };
+ ["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
diff --git a/dayz_code/actions/trade_weapons.sqf b/dayz_code/actions/trade_weapons.sqf
index a27569005..ebb6a27aa 100644
--- a/dayz_code/actions/trade_weapons.sqf
+++ b/dayz_code/actions/trade_weapons.sqf
@@ -23,14 +23,7 @@ if(_buy_o_sell == "buy") then {
if (_qty >= _qty_in) then {
-
- // server_tradeObject [_activatingPlayer,_traderID,_bos]
- dayzTradeObject = [_activatingPlayer,_traderID,_bos];
- publicVariableServer "dayzTradeObject";
-
- if (isServer) then {
- dayzTradeObject call server_tradeObject;
- };
+ ["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
waitUntil {!isNil "dayzTradeResult"};
diff --git a/dayz_code/actions/vault_pitch.sqf b/dayz_code/actions/vault_pitch.sqf
index b7d58a999..ad93d1538 100644
--- a/dayz_code/actions/vault_pitch.sqf
+++ b/dayz_code/actions/vault_pitch.sqf
@@ -57,13 +57,7 @@ if (!_isOk) then {
_tent setVariable ["characterID",dayz_playerUID,true];
_tent setVariable ["OEMPos",_location,true];
- //player setVariable ["tentUpdate",["Land_A_tent",_dir,_location,[dayz_tentWeapons,dayz_tentMagazines,dayz_tentBackpacks]],true];
-
- dayzPublishObj = [dayz_playerUID,_tent,[_dir,_location],"VaultStorageLocked"];
- publicVariable "dayzPublishObj";
- if (isServer) then {
- dayzPublishObj call server_publishObj;
- };
+ ["dayzPublishObj",[dayz_playerUID,_tent,[_dir,_location],"VaultStorageLocked"]] call callRpcProcedure;
cutText ["You have setup your vault", "PLAIN DOWN"];
} else {
diff --git a/dayz_code/cfgVehicles.hpp b/dayz_code/cfgVehicles.hpp
index c25611d9c..9c577c5c8 100644
--- a/dayz_code/cfgVehicles.hpp
+++ b/dayz_code/cfgVehicles.hpp
@@ -548,14 +548,14 @@ class Citizen1; // External class reference
class DZ_Czech_Vest_Puch: Bag_Base_EP1
{
- scope = 2;
- displayName = "Czech Vest Pouch";
- picture = "\ca\weapons_e\data\icons\backpack_ACR_small_CA.paa";
+ displayname = "Czech Vest Pouch";
icon = "\ca\weapons_e\data\icons\mapIcon_backpack_CA.paa";
mapsize = 2;
model = "\ca\weapons_e\AmmoBoxes\backpack_acr_small.p3d";
- transportMaxWeapons = 0;
- transportMaxMagazines = 12;
+ picture = "\ca\weapons_e\data\icons\backpack_ACR_small_CA.paa";
+ scope = 2;
+ transportmaxmagazines = 12;
+ transportmaxweapons = 0;
};
class DZ_ALICE_Pack_EP1: Bag_Base_EP1
diff --git a/dayz_code/compile/building_spawnZombies.sqf b/dayz_code/compile/building_spawnZombies.sqf
index 692839d5b..11fe6ed95 100644
--- a/dayz_code/compile/building_spawnZombies.sqf
+++ b/dayz_code/compile/building_spawnZombies.sqf
@@ -8,10 +8,10 @@ _originalPos = getPosATL _obj;
if (_canLoot) then {
//Get zombie class
_unitTypes = getArray (_config >> "zombieClass");
- _min = getNumber (_config >> "maxRoaming");
- _max = getNumber (_config >> "minRoaming");
+ _min = getNumber (_config >> "minRoaming");
+ _max = getNumber (_config >> "maxRoaming");
//Walking Zombies
- _num = round(random _max) max _min;
+ _num = round(random _max) min _min;
_config = configFile >> "CfgBuildingLoot" >> _type;
//Get zombie class
_zombieChance = getNumber (_config >> "zombieChance");
diff --git a/dayz_code/compile/fn_damageActions.sqf b/dayz_code/compile/fn_damageActions.sqf
index 355241146..23924cdbc 100644
--- a/dayz_code/compile/fn_damageActions.sqf
+++ b/dayz_code/compile/fn_damageActions.sqf
@@ -182,7 +182,7 @@ if (_hasPatient and !r_drag_sqf and !r_action and !_inVehicle and !r_player_unco
if ((isPlayer _unit) and !(_charID in _friendlies)) then {
r_action = true;
- _action = _unit addAction ["Tag as friendly", "\z\addons\dayz_code\actions\player_tagFriendly.sqf", [], 0, false, true, "", "_target != player"];
+ _action = _unit addAction ["Tag as friendly", "\z\addons\dayz_code\actions\player_tagFriendly.sqf", [], 0, false, true, "", "vehicle _unit == _unit"];
r_player_actions set [count r_player_actions,_action];
};
diff --git a/dayz_code/compile/fn_damageHandler.sqf b/dayz_code/compile/fn_damageHandler.sqf
index f54525496..5f50d8317 100644
--- a/dayz_code/compile/fn_damageHandler.sqf
+++ b/dayz_code/compile/fn_damageHandler.sqf
@@ -31,8 +31,8 @@ _sourceZombie = _source isKindOf "zZombie_base";
if (_isPlayer) then {
if (_damage > 0.1) then {
dayz_canDisconnect = false;
- dayzDiscoAdd = getPlayerUID player;
- publicVariable "dayzDiscoAdd";
+ ["dayzDiscoAdd",getPlayerUID player] call callRpcProcedure;
+
dayz_damageCounter = time;
//Ensure Control is visible
@@ -56,10 +56,7 @@ if (_unit == player) then {
_myKills = 200 - (((player getVariable ["humanKills",0]) / 30) * 100);
//Process Morality Hit
_humanityHit = -(_myKills * _damage);
- _id = [_source,_humanityHit] spawn {
- dayzHumanity = [_this select 0,_this select 1,30];
- publicVariable "dayzHumanity";
- };
+ ["dayzHumanity",[_source,_humanityHit,30]] call broadcastRpcCallAll;
};
};
};
@@ -169,9 +166,7 @@ if (_damage > 0.4) then { //0.25
if(!_isPZombie) then {
//Create Wound
_unit setVariable[_wound,true,true];
- [_unit,_wound,_hit] spawn fnc_usec_damageBleed;
- usecBleed = [_unit,_wound,_hit];
- publicVariable "usecBleed";
+ ["usecBleed",[_unit,_wound,_hit]] call broadcastRpcCallAll;
//Set Injured if not already
_isInjured = _unit getVariable["USEC_injured",false];
diff --git a/dayz_code/compile/fn_selfActions.sqf b/dayz_code/compile/fn_selfActions.sqf
index 27d717790..a6e0dc318 100644
--- a/dayz_code/compile/fn_selfActions.sqf
+++ b/dayz_code/compile/fn_selfActions.sqf
@@ -16,6 +16,7 @@ _hasFuelE = "ItemJerrycanEmpty" in magazines player;
_hasRawMeat = "FoodSteakRaw" in magazines player;
_hasKnife = "ItemKnife" in items player;
_hasToolbox = "ItemToolbox" in items player;
+_hasstatsenabled = player getVariable ["StatsEnabled",false];
//_hasTent = "ItemTent" in items player;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_nearLight = nearestObject [player,"LitObject"];
@@ -28,6 +29,14 @@ if (!isNull _nearLight) then {
};
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
+if (!_hasstatsenabled) then {
+ if (s_player_stats < 0) then {
+// s_player_stats = player addAction [format[localize "str_actions_stats",_text], "\z\addons\dayz_code\actions\playerstats.sqf"];
+ (findDisplay 46) displayAddEventHandler ["keyDown", "_this call fnc_onKeyDown"];
+ s_player_stats = 1;
+ };
+};
+
//Grab Flare
if (_canPickLight and !dayz_hasLight) then {
if (s_player_grabflare < 0) then {
diff --git a/dayz_code/compile/object_setFixServer.sqf b/dayz_code/compile/object_setFixServer.sqf
index d487c1d19..59f48ebf5 100644
--- a/dayz_code/compile/object_setFixServer.sqf
+++ b/dayz_code/compile/object_setFixServer.sqf
@@ -1,4 +1,4 @@
-private["_unit","_selection","_strH","_dam","_total"];
+private["_unit","_selection","_strH","_damage","_total"];
_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
@@ -9,15 +9,8 @@ if (_selection != "" and local _unit) then {
//player sidechat str _damage;
_unit setVariable [_strH,_damage,true];
if (_damage == 0) then {
- dayzUpdateVehicle = [_unit,"repair"];
+ ["dayzUpdateVehicle",[_unit,"repair"]] call callRpcProcedure;
} else {
- dayzUpdateVehicle = [_unit,"damage"];
- };
- if (isServer) then {
- if (allowConnection) then {
- dayzUpdateVehicle call server_updateObject;
- };
- } else {
- publicVariable "dayzUpdateVehicle";
+ ["dayzUpdateVehicle",[_unit,"damage"]] call callRpcProcedure;
};
};
\ No newline at end of file
diff --git a/dayz_code/compile/object_setHitServer.sqf b/dayz_code/compile/object_setHitServer.sqf
index 94840ff23..98c37cd4a 100644
--- a/dayz_code/compile/object_setHitServer.sqf
+++ b/dayz_code/compile/object_setHitServer.sqf
@@ -1,4 +1,4 @@
-private["_unit","_selection","_strH","_dam","_total"];
+private["_unit","_selection","_damage","_strH","_dam","_total"];
_unit = _this select 0;
_selection = _this select 1;
_damage = _this select 2;
@@ -12,14 +12,7 @@ if ((_selection != "") and local _unit) then {
_unit setVariable [_strH,_total,true];
if (_damage >= 1) then {
- dayzUpdateVehicle = [_unit,"damage"];
- if (isServer) then {
- if (allowConnection) then {
- dayzUpdateVehicle call server_updateObject;
- };
- } else {
- publicVariable "dayzUpdateVehicle";
- };
+ ["dayzUpdateVehicle",[_unit,"damage"]] call callRpcProcedure;
};
} else {
diff --git a/dayz_code/compile/object_vehicleKilled.sqf b/dayz_code/compile/object_vehicleKilled.sqf
index 466111a01..e83d2b9b0 100644
--- a/dayz_code/compile/object_vehicleKilled.sqf
+++ b/dayz_code/compile/object_vehicleKilled.sqf
@@ -1,4 +1,4 @@
-private["_unit","_selection","_strH","_dam","_total"];
+private["_unit","_killer","_type","_pos","_dir"];
_unit = _this select 0;
_killer = _this select 1;
_type = typeOf _unit;
@@ -6,5 +6,4 @@ _pos = getposATL _unit;
_dir = direction _unit;
if (local _unit) then {
deleteVehicle _unit;
-// [_type,_pos,_dir] spawn object_spawnDamVehicle;
};
diff --git a/dayz_code/compile/player_death.sqf b/dayz_code/compile/player_death.sqf
index 42d1b1bee..3273a07e6 100644
--- a/dayz_code/compile/player_death.sqf
+++ b/dayz_code/compile/player_death.sqf
@@ -13,11 +13,7 @@ if (r_player_infected) then {
};
//Send Death Notice
-dayzDeath = [dayz_characterID,0,_body,_playerID,dayz_playerName,_infected];
-publicVariableServer "dayzDeath";
-if (isServer) then {
- _id = dayzDeath spawn server_playerDied;
-};
+["dayzDeath",[dayz_characterID,0,_body,_playerID,dayz_playerName,_infected]] call callRpcProcedure;
_id = [player,50,true,getPosATL player] spawn player_alertZombies;
@@ -66,8 +62,7 @@ if (count _array > 0) then {
_wait = 0;
};
if (!_canHitFree and !_isBandit) then {
- dayzHumanity = [_source,_humanity,_wait];
- publicVariable "dayzHumanity";
+ ["dayzHumanity",[_source,_humanity,_wait]] call broadcastRpcCallAll;
};
};
};
@@ -124,10 +119,7 @@ if (count _array > 0) then {
_body setVariable["combattimeout", 0, true];
-/*
-dayzFlies = player;
-publicVariable "dayzFlies";
-*/
+//["dayzFlies",player] call broadcastRpcCallAll;
sleep 2;
1 cutRsc ["DeathScreen","BLACK OUT",3];
diff --git a/dayz_code/compile/player_fired.sqf b/dayz_code/compile/player_fired.sqf
index 8b054d4d2..06d235635 100644
--- a/dayz_code/compile/player_fired.sqf
+++ b/dayz_code/compile/player_fired.sqf
@@ -60,16 +60,14 @@ if (_ammo isKindOf "SmokeShell") then {
if (_ammo isKindOf "RoadFlare") then {
//hint str(_ammo);
_projectile = nearestObject [_unit, "RoadFlare"];
- _id = [_projectile,0] spawn object_roadFlare;
- dayzRoadFlare = [_projectile,0];
- publicVariable "dayzRoadFlare";
+ ["dayzRoadFlare",[_projectile,0]] call broadcastRpcCallAll;
+
_id = _this spawn player_throwObject;
};
if (_ammo isKindOf "ChemLight") then {
_projectile = nearestObject [_unit, "ChemLight"];
- _id = [_projectile,1] spawn object_roadFlare;
- dayzRoadFlare = [_projectile,1];
- publicVariable "dayzRoadFlare";
+ ["dayzRoadFlare",[_projectile,1]] call broadcastRpcCallAll;
+
_id = _this spawn player_throwObject;
};
};
diff --git a/dayz_code/compile/player_gearSync.sqf b/dayz_code/compile/player_gearSync.sqf
index cabae9013..492d4858d 100644
--- a/dayz_code/compile/player_gearSync.sqf
+++ b/dayz_code/compile/player_gearSync.sqf
@@ -1,8 +1,7 @@
private ["_objects"];
_objects = nearestObjects [getPosATL player, ["Car", "Helicopter", "Motorcycle", "Ship", "TentStorage"], 10];
{
- dayzUpdateVehicle = [_x,"gear"];
- publicVariableServer "dayzUpdateVehicle";
+ ["dayzUpdateVehicle",[_x,"gear"]] call callRpcProcedure;
} foreach _objects;
private["_dialog","_magazineArray","_control","_item","_val","_max"];
diff --git a/dayz_code/compile/player_humanityMorph.sqf b/dayz_code/compile/player_humanityMorph.sqf
index 453489fc0..8204ed619 100644
--- a/dayz_code/compile/player_humanityMorph.sqf
+++ b/dayz_code/compile/player_humanityMorph.sqf
@@ -46,9 +46,7 @@ if (count _medical > 0) then {
//Add Wounds
{
player setVariable[_x,true,true];
- [player,_x,_hit] spawn fnc_usec_damageBleed;
- usecBleed = [player,_x,0];
- publicVariable "usecBleed";
+ ["usecBleed",[player,_x,_hit]] call broadcastRpcCallAll;
} forEach (_medical select 8);
//Add fractures
@@ -77,11 +75,8 @@ player setVariable["worldspace",_worldspace,true];
player setVariable["friendlies",_friendlies,true];
player setVariable["tagList",_tagList,true];
-dayzPlayerMorph = [_charID,player,_playerUID,[_zombieKills,_headShots,_humanKills,_banditKills],_humanity];
-publicVariable "dayzPlayerMorph";
-if (isServer) then {
- dayzPlayerMorph call server_playerMorph;
-};
+//code for this on the server is missing
+//["dayzPlayerMorph",[_charID,player,_playerUID,[_zombieKills,_headShots,_humanKills,_banditKills],_humanity]] call callRpcProcedure;
call dayz_resetSelfActions;
diff --git a/dayz_code/compile/player_packTent.sqf b/dayz_code/compile/player_packTent.sqf
index 5edd63161..8337c226a 100644
--- a/dayz_code/compile/player_packTent.sqf
+++ b/dayz_code/compile/player_packTent.sqf
@@ -34,12 +34,7 @@ if(_ownerID == dayz_characterID) then {
_magazines = getMagazineCargo _obj;
_backpacks = getBackpackCargo _obj;
- dayzDeleteObj = [_objectID,_objectUID];
- publicVariableServer "dayzDeleteObj";
- if (isServer) then {
- dayzDeleteObj call local_deleteObj;
- };
-
+ ["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
deleteVehicle _obj;
//Add weapons
diff --git a/dayz_code/compile/player_packVault.sqf b/dayz_code/compile/player_packVault.sqf
index 8aa169942..49b79bbf3 100644
--- a/dayz_code/compile/player_packVault.sqf
+++ b/dayz_code/compile/player_packVault.sqf
@@ -34,11 +34,7 @@ if(_ownerID == dayz_playerUID) then {
_magazines = getMagazineCargo _obj;
_backpacks = getBackpackCargo _obj;
- dayzDeleteObj = [_objectID,_objectUID];
- publicVariableServer "dayzDeleteObj";
- if (isServer) then {
- dayzDeleteObj call local_deleteObj;
- };
+ ["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
deleteVehicle _obj;
diff --git a/dayz_code/compile/player_spawnCheck.sqf b/dayz_code/compile/player_spawnCheck.sqf
index 6480d6e62..c1b8c1ff1 100644
--- a/dayz_code/compile/player_spawnCheck.sqf
+++ b/dayz_code/compile/player_spawnCheck.sqf
@@ -7,6 +7,7 @@ _dateNow = (DateToNumber date);
_maxZombies = dayz_maxLocalZombies;
_maxWildZombies = 3;
_age = -1;
+
_nearbyBuildings = [];
_radius = 200;
_maxZombies = 10;
@@ -23,20 +24,37 @@ diag_log ("Type: " +str(_type));
switch (_nearbytype) do {
case "NameVillage": {
- _radius = 250;
+ //_radius = 250;
_maxZombies = 30;
};
case "NameCity": {
- _radius = 300;
+ //_radius = 300;
_maxZombies = 40;
};
case "NameCityCapital": {
- _radius = 400;
+ //_radius = 400;
_maxZombies = 50;
};
};
- _spawnZombies = count (_position nearEntities ["zZombie_Base",_radius]) < _maxZombies;
+_spawnZombies = count (_position nearEntities ["zZombie_Base",_radius+100]) < _maxZombies;
+
+if ("ItemMap_Debug" in items player) then {
+ deleteMarkerLocal "MaxZeds";
+ deleteMarkerLocal "Counter";
+ _markerstr = createMarkerLocal ["MaxZeds", _position];
+ _markerstr setMarkerColorLocal "ColorRed";
+ _markerstr setMarkerShapeLocal "ELLIPSE";
+ _markerstr setMarkerBrushLocal "Border";
+ _markerstr setMarkerSizeLocal [_radius, _radius];
+
+ _markerstr1 = createMarkerLocal ["Counter", _position];
+ _markerstr1 setMarkerColorLocal "ColorYellow";
+ _markerstr1 setMarkerShapeLocal "ELLIPSE";
+ _markerstr1 setMarkerBrushLocal "Border";
+ _markerstr1 setMarkerSizeLocal [_radius+100, _radius+100];
+};
+
switch (_type) do {
case "Zeds": {
@@ -49,8 +67,16 @@ switch (_type) do {
};
};
};
- case "Wild": {
+ case "both": {
//[_position, _maxZombies] call wild_spawnZombies;
+ _nearbyBuildings = nearestObjects [_position, dayz_ZombieBuildings, _radius];
+ _nearbyCount = count _nearbyBuildings;
+ if (_nearbyCount > 0) then {
+ [_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _nearbyBuildings] call player_spawnlootCheck;
+ if (_spawnZombies) then {
+ [_radius, _position, _inVehicle, _dateNow, _age, _locationstypes, _nearestCity, _maxZombies, _nearbyBuildings] call player_spawnzedCheck;
+ };
+ };
};
case "Loot": {
//_nearbyBuildings = nearestObjects [_position, ["building"], _radius];
diff --git a/dayz_code/compile/player_switchModel.sqf b/dayz_code/compile/player_switchModel.sqf
index b3cfed16c..55773ce1f 100644
--- a/dayz_code/compile/player_switchModel.sqf
+++ b/dayz_code/compile/player_switchModel.sqf
@@ -189,5 +189,5 @@ private ["_newBackpackType","_backpackWpn","_backpackMag"];
_playerUID=getPlayerUID player;
_playerObjName = format["player%1",_playerUID];
- call compile format["player%1 = player;",_playerUID];
+ call compile format["%1 = player;",_playerObjName];
publicVariable _playerObjName;
\ No newline at end of file
diff --git a/dayz_code/compile/player_zombieAttack.sqf b/dayz_code/compile/player_zombieAttack.sqf
index 593679376..8b706ec85 100644
--- a/dayz_code/compile/player_zombieAttack.sqf
+++ b/dayz_code/compile/player_zombieAttack.sqf
@@ -1,4 +1,4 @@
-private["_unit","_targets","_move","_damage","_wound","_index","_cnt","_sound","_local","_dir","_hpList","_hp","_strH","_dam","_total","_result","_vehicle","_tPos","_zPos","_cantSee","_inAngle"];
+private["_unit","_targets","_move","_damage","_wound","_index","_cnt","_sound","_local","_dir","_hpList","_hp","_strH","_dam","_total","_vehicle","_tPos","_zPos","_cantSee","_inAngle"];
_unit = _this select 0;
_type = _this select 1;
_vehicle = (vehicle player);
@@ -40,9 +40,7 @@ if (_vehicle != player) then {
//diag_log ("Hitpoints " +str(_wound) +str(_total));
- //_result = [_vehicle, _wound,_total, _unit,"zombie"] call fnc_usec_damageVehicle;
- //dayzHitV = [_vehicle,_wound,_total, _unit,"zombie"];
- //publicVariable "dayzHitV";
+ //["dayzHitV",[_vehicle, _wound,_total, _unit,"zombie"]] call broadcastRpcCallAll;
if (_total >= 1) then {
if ((_chance % 4) == 0) then {
if ((_vehicle isKindOf "ATV_Base_EP1") or (_vehicle isKindOf "Motorcycle")) then { player action ["eject", _vehicle] };
@@ -65,9 +63,7 @@ if (_vehicle != player) then {
//publicVariable "dayzHit";
[_unit,"hit",2,true] call dayz_zombieSpeak;
} else {
- _result = [_vehicle, _wound,_total, _unit,"zombie"] call fnc_usec_damageVehicle;
- dayzHitV = [_vehicle,_wound,_total, _unit,"zombie"];
- publicVariable "dayzHitV";
+ ["dayzHitV",[_vehicle, _wound,_total, _unit,"zombie"]] call broadcastRpcCallAll;
};
};
} else {
diff --git a/dayz_code/compile/player_zombieCheck.sqf b/dayz_code/compile/player_zombieCheck.sqf
index 07a7d6780..4f2f4c37f 100644
--- a/dayz_code/compile/player_zombieCheck.sqf
+++ b/dayz_code/compile/player_zombieCheck.sqf
@@ -31,7 +31,6 @@ _multiplier = 1;
_delta = _pHeight - _entHeight;
if ( ((time - _last) > 1) and ((_delta < 1.5) and (_delta > -1.5)) ) then {
zedattack = [_x, _type] spawn player_zombieAttack;
- waitUntil {scriptDone zedattack};
_x setVariable["lastAttack",time];
};
_attacked = true;
diff --git a/dayz_code/compile/vehicle_handleDamage.sqf b/dayz_code/compile/vehicle_handleDamage.sqf
index d6b7fa45f..54fa82c2d 100644
--- a/dayz_code/compile/vehicle_handleDamage.sqf
+++ b/dayz_code/compile/vehicle_handleDamage.sqf
@@ -23,14 +23,7 @@ if (_dam < 1 ) then {
_unit setVariable [_strH,_total,true];
if ( !_needUpdate ) then {
_unit setVariable ["needUpdate",true,true];
- dayzUpdateVehicle = [_unit,"damage"];
- if (isServer) then {
- if (allowConnection) then {
- dayzUpdateVehicle call server_updateObject;
- };
- } else {
- publicVariableServer "dayzUpdateVehicle";
- };
+ ["dayzUpdateVehicle",[_unit,"damage"]] call callRpcProcedure;
};
};
};
diff --git a/dayz_code/compile/vehicle_handleKilled.sqf b/dayz_code/compile/vehicle_handleKilled.sqf
index f1d498fb7..03b2a5a4c 100644
--- a/dayz_code/compile/vehicle_handleKilled.sqf
+++ b/dayz_code/compile/vehicle_handleKilled.sqf
@@ -1,4 +1,4 @@
-private["_unit","_selection","_killer"];
+private["_unit","_hitPoints","_selection","_killer"];
_unit = _this select 0;
_killer = _this select 1;
@@ -9,15 +9,7 @@ _hitPoints = _unit call vehicle_getHitpoints;
_unit setVariable [_selection, 1, true];
} forEach _hitPoints;
-dayzUpdateVehicle = [_unit, "damage", true];
-
-if (isServer) then {
- if (allowConnection) then {
- dayzUpdateVehicle call server_updateObject;
- };
-} else {
- publicVariable "dayzUpdateVehicle";
-};
+["dayzUpdateVehicle",[_unit, "damage", true]] call callRpcProcedure;
_unit removeAllEventHandlers "HandleDamage";
_unit removeAllEventHandlers "Killed";
diff --git a/dayz_code/compile/zombie_generate.sqf b/dayz_code/compile/zombie_generate.sqf
index bf02fc606..9d86fd25f 100644
--- a/dayz_code/compile/zombie_generate.sqf
+++ b/dayz_code/compile/zombie_generate.sqf
@@ -63,7 +63,6 @@ if (_doLoiter) then {
};
};
-
if (isNull _agent) exitWith {
dayz_spawnZombies = dayz_spawnZombies - 1;
};
@@ -83,6 +82,7 @@ if (_rnd > 0.3) then {
_array = []+ getArray (configFile >> "cfgLoot" >> getText(_lootType));
if (count _array > 0) then {
_loot = _array call BIS_fnc_selectRandomWeighted;
+ //diag_log ("Zed Loot: " +(_loot));
if(!isNil "_array") then {
_agent addMagazine _loot;
};
diff --git a/dayz_code/config.cpp b/dayz_code/config.cpp
index 51c0cb757..5ef2fbfe1 100644
--- a/dayz_code/config.cpp
+++ b/dayz_code/config.cpp
@@ -33,7 +33,7 @@ class CfgMods
hidePicture = 0;
hideName = 0;
action = "http://www.dayzmod.com";
- version = "1.7.5.M1D9";
+ version = "1.7.5.M1D15";
hiveVersion = 0.96; //0.93
};
};
@@ -94,9 +94,11 @@ class RscStructuredTextGUI: RscStructuredText
//#include "CfgWorlds.hpp"
#include "cfgMoves.hpp"
#include "rscTitles.hpp"
-#include "cfgVehicles.hpp"
-//#include "CfgWeapons.hpp"
+#include "CfgVehicles.hpp"
+#include "CfgWeapons.hpp"
+#include "CfgMagazines.hpp"
#include "cfgLoot.hpp"
+#include "CfgMarkers.hpp"
class CfgSurvival {
class Inventory {
@@ -110,10 +112,12 @@ class CfgSurvival {
};
class Meat {
class Default {
- yield = 1;
+ yield = 2;
+ rawfoodtype = "FoodSteakRaw";
};
class Cow: Default {
- yield = 6;
+ yield = 8;
+ rawfoodtype = "FoodSteakRaw";
};
class Cow01: Cow{};
class Cow02: Cow{};
@@ -121,12 +125,27 @@ class CfgSurvival {
class Cow04: Cow{};
class Goat: Default {
yield = 4;
+ rawfoodtype = "FoodSteakRaw";
};
class Sheep: Default {
- yield = 3;
+ yield = 4;
+ rawfoodtype = "FoodmuttonRaw";
};
class WildBoar: Default {
- yield = 2;
+ yield = 4;
+ rawfoodtype = "FoodbaconRaw";
+ };
+ class Hen: Default {
+ yield = 4;
+ rawfoodtype = "FoodchickenRaw";
+ };
+ class Cock: Default {
+ yield = 4;
+ rawfoodtype = "FoodchickenRaw";
+ };
+ class Rabbit: Default {
+ yield = 4;
+ rawfoodtype = "FoodrabbitRaw";
};
};
};
diff --git a/dayz_code/init/compiles.sqf b/dayz_code/init/compiles.sqf
index 07cbe0307..7471c7745 100644
--- a/dayz_code/init/compiles.sqf
+++ b/dayz_code/init/compiles.sqf
@@ -284,8 +284,18 @@ if (!isDedicated) then {
dayz_spaceInterrupt = {
private ["_dikCode", "_handled"];
_dikCode = _this select 1;
- _altState = _this select 4;
_handled = false;
+ if (_dikCode in (actionKeys "GetOver")) then {
+ if (animationState player in ["amovpercmrunslowwrfldf","amovpercmrunsraswrfldf","amovpercmevaslowwrfldf","amovpercmevasraswrfldf"]) then {
+ null = [] spawn {
+ //Needed for sync with others
+ [nil, player, rSWITCHMOVE,"ActsPercMrunSlowWrflDf_FlipFlopPara"] call RE;
+ sleep 0.3;
+ player setVelocity [(velocity player select 0) + 1.5 * sin direction player, (velocity player select 1) + 1.5 * cos direction player, (velocity player select 2) + 4];
+ };
+ _handled = true;
+ };
+ };
//if (_dikCode == 57) then {_handled = true}; // space
//if (_dikCode in actionKeys 'MoveForward' or _dikCode in actionKeys 'MoveBack') then {r_interrupt = true};
if (_dikCode in actionKeys "MoveLeft") then {r_interrupt = true};
@@ -384,6 +394,18 @@ if (!isDedicated) then {
_vdir
};
+ fnc_onKeyDown =
+ {
+ private["_key"];
+ _key = _this select 1;
+ if (_key == 70) then //SCROLL LOCK
+ {
+ _nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
+ _shift = nil;
+ };
+ _return
+ };
+
dayz_lowHumanity = {
private["_unit","_humanity","_delay"];
_unit = _this;
@@ -417,21 +439,10 @@ if (!isDedicated) then {
dayz_originalPlayer = player;
};
- BIS_fnc_selectRandom = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selectRandom.sqf"; //Checks which actions for nearby casualty
-
-//Server Only
-if (isServer) then {
- call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\server_functions.sqf";
-} else {
- eh_localCleanup = {};
-};
-
progressLoadingScreen 0.8;
//Both
- //Start Dynamic Weather
- execVM "\z\addons\dayz_code\external\DynamicWeatherEffects.sqf";
-
+ BIS_fnc_selectRandom = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selectRandom.sqf"; //Checks which actions for nearby casualty
fnc_buildWeightedArray = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildWeightedArray.sqf"; //Checks which actions for nearby casualty
fnc_usec_damageVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerVehicle.sqf"; //Event handler run on damage
zombie_initialize = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\zombie_init.sqf";
@@ -452,10 +463,8 @@ if (isServer) then {
fnc_isInsideBuilding = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
dayz_zombieSpeak = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_speak.sqf"; //Used to generate random speech for a unit
vehicle_getHitpoints = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_getHitpoints.sqf";
- local_gutObject = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObject.sqf"; //Generated on the server (or local to unit) when gutting an object
- local_gutObjectZ = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_gutObjectZ.sqf"; //Generated on the server (or local to unit) when gutting an object
local_zombieDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerZ.sqf"; //Generated by the client who created a zombie to track damage
- local_sefFuel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_setFuel.sqf"; //Generated when someone refuels a vehicle
+ local_setFuel = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_setFuel.sqf"; //Generated when someone refuels a vehicle
local_eventKill = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_eventKill.sqf"; //Generated when something is killed
//player_weaponCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_weaponCheck.sqf"; //Run by the player or server to monitor whether they have picked up a new weapon
curTimeStr = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_curTimeStr.sqf";
@@ -500,4 +509,15 @@ if (isServer) then {
_medical
};
+
+ //Server Only
+ if (isServer) then {
+ call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\server_functions.sqf";
+ } else {
+ eh_localCleanup = {};
+ };
+
+
+ //Start Dynamic Weather
+ execVM "\z\addons\dayz_code\external\DynamicWeatherEffects.sqf";
initialized = true;
\ No newline at end of file
diff --git a/dayz_code/init/publicEH.sqf b/dayz_code/init/publicEH.sqf
index 20724a2c4..f44e75c2d 100644
--- a/dayz_code/init/publicEH.sqf
+++ b/dayz_code/init/publicEH.sqf
@@ -1,46 +1,82 @@
-"dayzSetFuel" addPublicVariableEventHandler {(_this select 1) call local_sefFuel};
+rpcCodeVarName = { format["%1_code",_this] };
+rpcDirectCall = { call compile format["[%1,%2] call %3;",str(_this),_this,_this call rpcCodeVarName]; };
-if (isServer) then {
- "dayzDeath" addPublicVariableEventHandler {(_this select 1) call server_playerDied};
- "dayzDiscoAdd" addPublicVariableEventHandler {dayz_disco set [count dayz_disco,(_this select 1)];};
- "dayzDiscoRem" addPublicVariableEventHandler {dayz_disco = dayz_disco - [(_this select 1)];};
- "dayzPlayerSave" addPublicVariableEventHandler {(_this select 1) call server_playerSync;};
- "dayzPublishObj" addPublicVariableEventHandler {(_this select 1) call server_publishObj};
- "dayzUpdateVehicle" addPublicVariableEventHandler {(_this select 1) call server_updateObject};
- "dayzDeleteObj" addPublicVariableEventHandler {(_this select 1) call local_deleteObj};
- "dayzPublishVeh" addPublicVariableEventHandler {(_this select 1) call server_publishVeh}; // for vehicle traders
- "dayzTradeObject" addPublicVariableEventHandler {(_this select 1) call server_tradeObj}; // for vehicle traders
- "dayzTraderMenu" addPublicVariableEventHandler {(_this select 1) call server_traders}; // for all traders
- "dayzLogin" addPublicVariableEventHandler {(_this select 1) call server_playerLogin};
- "dayzLogin2" addPublicVariableEventHandler {(_this select 1) call server_playerSetup};
- "dayzPlayerMorph" addPublicVariableEventHandler {(_this select 1) call server_playerMorph};
- "dayzLoginRecord" addPublicVariableEventHandler {(_this select 1) call dayz_recordLogin};
- "dayzCharDisco" addPublicVariableEventHandler {(_this select 1) call server_characterSync};
- "dayzSetFix" addPublicVariableEventHandler {(_this select 1) call object_setFixServer};
- "dayzGutBody" addPublicVariableEventHandler {(_this select 1) spawn local_gutObject};
-
- "usecMorphine" addPublicVariableEventHandler {
- (_this select 1) select 0 setVariable["hit_legs",0];
- (_this select 1) select 0 setVariable["hit_hands",0];
- };
+//run on all clients
+broadcastRpcCallAll = {
+ private["_name","_val"];
+ _name = _this select 0;
+ _val = _this select 1;
+ call compile format["%1 = _val;",_name]; //set the value locally
+ _name call rpcDirectCall; //call on this client
+ publicVariable _name; //call on other clients
};
-if (!isDedicated) then {
- "norrnRaLW" addPublicVariableEventHandler {[_this select 1] execVM "\z\addons\dayz_code\medical\publicEH\load_wounded.sqf"};
- "norrnRLact" addPublicVariableEventHandler {[_this select 1] execVM "\z\addons\dayz_code\medical\load\load_wounded.sqf"};
- "usecMorphine" addPublicVariableEventHandler {(_this select 1) call player_medMorphine};
- "usecBleed" addPublicVariableEventHandler {_id = (_this select 1) spawn fnc_usec_damageBleed};
- "usecBandage" addPublicVariableEventHandler {(_this select 1) call player_medBandage};
- "usecEpi" addPublicVariableEventHandler {(_this select 1) call player_medEpi};
- "usecTransfuse" addPublicVariableEventHandler {(_this select 1) call player_medTransfuse};
- "usecPainK" addPublicVariableEventHandler {(_this select 1) call player_medPainkiller};
- "dayzHideBody" addPublicVariableEventHandler {hideBody (_this select 1)};
- "dayzHumanity" addPublicVariableEventHandler {(_this select 1) spawn player_humanityChange};
- "dayzHitV" addPublicVariableEventHandler {(_this select 1) call fnc_usec_damageVehicle};
+//run on client which has the object ownership
+broadcastRpcCallIfLocal = {
+ private["_name","_val","_reqObj"];
+ _name = _this select 0;
+ _val = _this select 1;
+ _reqObj = _this select 2;
- "dayzSetDate" addPublicVariableEventHandler {setDate (_this select 1)};
- "dayzFlies" addPublicVariableEventHandler {(_this select 1) call spawn_flies};
- "dayzRoadFlare" addPublicVariableEventHandler {(_this select 1) spawn object_roadFlare};
- "norrnRaDrag" addPublicVariableEventHandler {[_this select 1] execVM "\z\addons\dayz_code\medical\publicEH\animDrag.sqf"};
- "dayzFire" addPublicVariableEventHandler {nul=(_this select 1) spawn BIS_Effects_Burn};
+ call compile format["%1 = _val;",_name]; //set the value locally
+ if (local _reqObj) then {
+ _name call rpcDirectCall; //call on this client
+ } else {
+ publicVariable _name; //call on other clients
+ }
+};
+
+//only run on server
+callRpcProcedure = {
+ private["_name","_val"];
+ _name = _this select 0;
+ _val = _this select 1;
+ call compile format["%1 = _val;",_name]; //set the value locally
+ if (isServer) then {
+ _name call rpcDirectCall; //call here since we are the server
+ } else {
+ publicVariableServer _name; //call on the sever
+ };
+};
+
+//register client->client rpc
+registerBroadcastRpc = {
+ private["_name","_code"];
+ _name = _this select 0;
+ _code = _this select 1;
+
+ call compile format["%1 = _code;",_name call rpcCodeVarName]; //set the global var containing the EH code
+ _name addPublicVariableEventHandler _code;
+};
+
+//both
+["dayzSetFuel", { (_this select 1) call local_setFuel; } ] call registerBroadcastRpc;
+["dayzSetFix", { (_this select 1) call object_setFixServer; } ] call registerBroadcastRpc;
+["dayzSetDate", { setDate (_this select 1); } ] call registerBroadcastRpc;
+//EHs that setVariable "medForceUpdate" need to run on the server too
+["usecMorphine", { (_this select 1) call player_medMorphine; } ] call registerBroadcastRpc;
+["usecBandage", { (_this select 1) call player_medBandage; } ] call registerBroadcastRpc;
+["usecEpi", { (_this select 1) call player_medEpi; } ] call registerBroadcastRpc;
+["usecTransfuse", { (_this select 1) call player_medTransfuse; } ] call registerBroadcastRpc;
+["usecPainK", { (_this select 1) call player_medPainkiller; } ] call registerBroadcastRpc;
+//BIS_Effects_Burn is empty on the server anyway, but this EH is called
+["dayzFire", { (_this select 1) spawn BIS_Effects_Burn; } ] call registerBroadcastRpc;
+
+//server only
+if (isServer) then {
+ call compile preprocessFileLineNumbers "\z\addons\dayz_server\init\publicEH_server.sqf";
+};
+
+//clients only
+if (!isDedicated) then {
+ ["norrnRaLW", { [_this select 1] execVM "\z\addons\dayz_code\medical\publicEH\load_wounded.sqf"; }] call registerBroadcastRpc;
+ ["norrnRLact", { [_this select 1] execVM "\z\addons\dayz_code\medical\load\load_wounded.sqf"; } ] call registerBroadcastRpc;
+ ["usecBleed", { (_this select 1) spawn fnc_usec_damageBleed; } ] call registerBroadcastRpc;
+ ["dayzHideBody", { hideBody (_this select 1); } ] call registerBroadcastRpc;
+ ["dayzHumanity", { (_this select 1) spawn player_humanityChange; } ] call registerBroadcastRpc;
+ ["dayzHitV", { (_this select 1) call fnc_usec_damageVehicle; } ] call registerBroadcastRpc;
+
+ ["dayzFlies", { (_this select 1) call spawn_flies; } ] call registerBroadcastRpc;
+ ["dayzRoadFlare", { (_this select 1) spawn object_roadFlare; } ] call registerBroadcastRpc;
+ ["norrnRaDrag", { [_this select 1] execVM "\z\addons\dayz_code\medical\publicEH\animDrag.sqf"; } ] call registerBroadcastRpc;
};
\ No newline at end of file
diff --git a/dayz_code/init/variables.sqf b/dayz_code/init/variables.sqf
index 603c6818d..d96eba050 100644
--- a/dayz_code/init/variables.sqf
+++ b/dayz_code/init/variables.sqf
@@ -51,9 +51,6 @@ SleepWater = 1440; //minutes (24 hours)
SleepTemperatur = 90 / 100; //Firs Value = Minutes untill Player reaches the coldest Point at night (without other effects! night factor expected to be -1) //TeeChange
//Server Variables
-dayZ_hivePipe1 = "\\.\pipe\dayz"; //The named pipe
-dayZ_hivePipeAuth = "\\.\pipe\dayzAuth"; //The named pipe
-hiveInUse = false;
allowConnection = false;
isSinglePlayer = false;
dayz_serverObjectMonitor = [];
@@ -93,6 +90,7 @@ dayz_resetSelfActions = {
s_player_deleteBuild = -1;
s_player_forceSave = -1;
s_player_flipveh = -1;
+ s_player_stats = -1;
s_player_sleep = -1;
s_player_movedog = -1;
s_player_speeddog = -1;
diff --git a/dayz_code/medical/bandage.sqf b/dayz_code/medical/bandage.sqf
index 285d849ff..9260ebb56 100644
--- a/dayz_code/medical/bandage.sqf
+++ b/dayz_code/medical/bandage.sqf
@@ -34,18 +34,14 @@ while {r_doLoop} do {
r_doLoop = false;
if (_finished) then {
-
-
- usecBandage = [_unit,player];
- publicVariable "usecBandage";
+ ["usecBandage",[_unit,player]] call broadcastRpcCallAll;
if (_unit == player) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medBandaged.sqf";
dayz_sourceBleeding = objNull;
} else {
- dayzHumanity = [player,20];
- _id = dayzHumanity spawn player_humanityChange;
+ ["dayzHumanity",[player,20]] call dayzHumanity_code;
};
{_unit setVariable[_x,false,true];} forEach USEC_woundHit;
diff --git a/dayz_code/medical/drag.sqf b/dayz_code/medical/drag.sqf
index df862471d..702e92f40 100644
--- a/dayz_code/medical/drag.sqf
+++ b/dayz_code/medical/drag.sqf
@@ -24,9 +24,7 @@ sleep 2;
//unconscious unit assumes dragging posture
//public EH
-norrnRaDrag = _dragee;
-publicVariable "norrnRaDrag";
-_dragee switchmove "ainjppnemstpsnonwrfldb_still";
+["norrnRaDrag",_dragee] call broadcastRpcCallAll;
_dragee attachto [_unit,[0.1, 1.01, 0]];
sleep 0.02;
diff --git a/dayz_code/medical/epinephrine.sqf b/dayz_code/medical/epinephrine.sqf
index 0dda5fdf6..6d77c01eb 100644
--- a/dayz_code/medical/epinephrine.sqf
+++ b/dayz_code/medical/epinephrine.sqf
@@ -12,9 +12,7 @@ if (!_isDead) then {
_unit setVariable ["NORRN_unconscious", false, true];
_unit setVariable ["USEC_isCardiac",false,true];
sleep 5;
- usecEpi = [_unit,player,"ItemEpinephrine"];
- publicVariable "usecEpi";
- _unit switchMove "AmovPpneMstpSnonWnonDnon_healed";
+ ["usecEpi",[_unit,player,"ItemEpinephrine"]] call broadcastRpcCallAll;
};
r_action = false;
\ No newline at end of file
diff --git a/dayz_code/medical/load/load_act.sqf b/dayz_code/medical/load/load_act.sqf
index 8914f35de..3b78e631b 100644
--- a/dayz_code/medical/load/load_act.sqf
+++ b/dayz_code/medical/load/load_act.sqf
@@ -20,9 +20,7 @@ if ((_vcl emptyPositions "cargo") > 0) then
_dragger switchMove "";
_wounded setVariable ["NORRN_LoadVcl", _vcl, true];
sleep 1;
- [_wounded] execVM "\z\addons\dayz_code\medical\load\load_wounded.sqf";
- norrnRLact = _wounded;
- publicVariable "norrnRLact";
+ ["norrnRLact",_wounded] call broadcastRpcCallAll;
player removeAction NORRN_dropAction;
}else{
diff --git a/dayz_code/medical/load/load_wounded.sqf b/dayz_code/medical/load/load_wounded.sqf
index bf2f40cf0..36fa62e38 100644
--- a/dayz_code/medical/load/load_wounded.sqf
+++ b/dayz_code/medical/load/load_wounded.sqf
@@ -14,9 +14,7 @@ _wounded setVariable ["NORRN_unit_dragged", true, true];
_wounded assignAsCargo _vcl;
_wounded moveInCargo _vcl;
sleep 1;
-norrnRALW = _wounded;
-publicVariable "norrnRALW";
-_wounded switchMove "kia_hmmwv_driver";
+["norrnRALW",_wounded] call broadcastRpcCallAll;
if (local _wounded) then
{
diff --git a/dayz_code/medical/load_wounded.sqf b/dayz_code/medical/load_wounded.sqf
index e0d998a2c..0e1b61d9c 100644
--- a/dayz_code/medical/load_wounded.sqf
+++ b/dayz_code/medical/load_wounded.sqf
@@ -16,9 +16,7 @@ _wounded setVariable ["NORRN_unit_dragged", true, true];
_wounded assignAsCargo _vcl;
_wounded moveInCargo _vcl;
sleep 1;
-norrnRALW = _wounded;
-publicVariable "norrnRALW";
-_wounded switchMove "kia_hmmwv_driver";
+["norrnRALW",_wounded] call broadcastRpcCallAll;
if (local _wounded) then
{
diff --git a/dayz_code/medical/morphine.sqf b/dayz_code/medical/morphine.sqf
index 87697725f..a2f096cc8 100644
--- a/dayz_code/medical/morphine.sqf
+++ b/dayz_code/medical/morphine.sqf
@@ -38,14 +38,12 @@ if (_finished) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medMorphine.sqf";
} else {
- dayzHumanity = [player,50];
- _id = dayzHumanity spawn player_humanityChange;
+ ["dayzHumanity",[player,50]] call dayzHumanity_code;
};
player removeMagazine "ItemMorphine";
- usecMorphine = [_unit,player];
- publicVariable "usecMorphine";
+ ["usecMorphine",[_unit,player]] call broadcastRpcCallAll;
} else {
r_interrupt = false;
[objNull, player, rSwitchMove,""] call RE;
diff --git a/dayz_code/medical/painkiller.sqf b/dayz_code/medical/painkiller.sqf
index c4161ee2f..49497ae6b 100644
--- a/dayz_code/medical/painkiller.sqf
+++ b/dayz_code/medical/painkiller.sqf
@@ -15,12 +15,11 @@ if (_unit == player) then {
//Self Healing
_id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medPainkiller.sqf";
} else {
- dayzHumanity = [player,20];
- _id = dayzHumanity spawn player_humanityChange;
+ ["dayzHumanity",[player,20]] call dayzHumanity_code;
};
player removeMagazine "ItemPainkiller";
sleep 1;
-usecPainK = [_unit,player];
-publicVariable "usecPainK";
+//clear the healed player's vision
+["usecPainK",[_unit,player]] call broadcastRpcCallAll;
diff --git a/dayz_code/medical/publicEH/medEpi.sqf b/dayz_code/medical/publicEH/medEpi.sqf
index cb1c9bbbf..c65ba85e5 100644
--- a/dayz_code/medical/publicEH/medEpi.sqf
+++ b/dayz_code/medical/publicEH/medEpi.sqf
@@ -9,14 +9,16 @@ if (local _unit) then {_unit setCaptive false};
if (!_isDead) then {
_unit switchMove "AmovPpneMstpSnonWnonDnon_healed";
- _unit setVariable ["NORRN_unconscious", false, true];
- _unit setVariable ["USEC_isCardiac",false,true];
+ //no need to public broadcast the variables since this runs on every peer
+ _unit setVariable ["NORRN_unconscious", false, false];
+ _unit setVariable ["USEC_isCardiac",false, false];
if (_unit == player) then {
r_player_unconscious = false;
disableUserInput false;
r_player_cardiac = false;
r_player_handler1 = false;
};
+
if (isServer) then {
_unit setVariable["medForceUpdate",true];
};
diff --git a/dayz_code/medical/publicEH/medMorphine.sqf b/dayz_code/medical/publicEH/medMorphine.sqf
index 58d9c9d15..241a8166d 100644
--- a/dayz_code/medical/publicEH/medMorphine.sqf
+++ b/dayz_code/medical/publicEH/medMorphine.sqf
@@ -18,8 +18,8 @@ if (_unit == player) then {
_id = false spawn dayz_disableRespawn;
};
-_unit setVariable ["hit_legs",0];
-_unit setVariable ["hit_hands",0];
+_unit setVariable ["hit_legs",0,false];
+_unit setVariable ["hit_hands",0,false];
if (isServer) then {
_unit setVariable["medForceUpdate",true];
diff --git a/dayz_code/medical/publicEH/medTransfuse.sqf b/dayz_code/medical/publicEH/medTransfuse.sqf
index d1619d280..809104a92 100644
--- a/dayz_code/medical/publicEH/medTransfuse.sqf
+++ b/dayz_code/medical/publicEH/medTransfuse.sqf
@@ -5,6 +5,9 @@ _array = _this; //_this select 0;
_unit = _array select 0;
_medic = _array select 1;
+_rndInfection = (random 15);
+_TransfusionInfection = (_rndInfection < 1);
+
if (_unit == player) then {
r_player_blood = r_player_bloodTotal;
r_player_lowblood = false;
@@ -12,6 +15,11 @@ if (_unit == player) then {
"dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;
"colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5;
+ if (_TransfusionInfection) then {
+ r_player_infected = true;
+ player setVariable["USEC_infected",true];
+ };
+
//Ensure Control is visible
_display = uiNamespace getVariable 'DAYZ_GUI_display';
_control = _display displayCtrl 1300;
diff --git a/dayz_code/medical/setup_functions_med.sqf b/dayz_code/medical/setup_functions_med.sqf
index 58b22db7b..8134bba6c 100644
--- a/dayz_code/medical/setup_functions_med.sqf
+++ b/dayz_code/medical/setup_functions_med.sqf
@@ -155,7 +155,7 @@ fnc_usec_damageBleed = {
/***********************************************************
PROCESS DAMAGE TO A UNIT
- Function
- - [_unit, _wound] call fnc_usec_damageBleed;
+ - [_unit, _wound, _injury] call fnc_usec_damageBleed;
************************************************************/
private["_unit","_wound","_injury","_modelPos","_point","_source"];
_unit = _this select 0;
@@ -229,6 +229,7 @@ fnc_usec_damageBleed = {
};
fnc_usec_recoverUncons = {
+ //same actions as in the EH, just timed differently
player setVariable ["NORRN_unconscious", false, true];
player setVariable ["unconsciousTime", 0, true];
player setVariable ["USEC_isCardiac",false,true];
diff --git a/dayz_code/medical/transfusion.sqf b/dayz_code/medical/transfusion.sqf
index 2362be9fe..f88964383 100644
--- a/dayz_code/medical/transfusion.sqf
+++ b/dayz_code/medical/transfusion.sqf
@@ -3,6 +3,9 @@ _unit = (_this select 3) select 0;
_lowBlood = _unit getVariable ["USEC_lowBlood", false];
_injured = _unit getVariable ["USEC_injured", false];
_inPain = _unit getVariable ["USEC_inPain", false];
+_lastused = _unit getVariable ["LastTransfusion", time];
+
+if (_lastused - time < 600) exitwith {cutText [format[(localize "str_actions_medical_18"),_text] , "PLAIN DOWN"]};
call fnc_usec_medic_removeActions;
r_action = false;
@@ -35,12 +38,12 @@ while {r_doLoop} do {
r_doLoop = false;
if (_finished) then {
+ _unit setVariable["LastTransfusion",time,true];
_unit setVariable["USEC_lowBlood",false,true];
player removeMagazine "ItemBloodbag";
- usecTransfuse = [_unit,player];
- publicVariable "usecTransfuse";
- dayzHumanity = [player,250];
- _id = dayzHumanity spawn player_humanityChange;
+ ["usecTransfuse",[_unit,player]] call broadcastRpcCallAll;
+
+ ["dayzHumanity",[player,250]] call dayzHumanity_code;
} else {
r_interrupt = false;
player switchMove "";
diff --git a/dayz_code/rscTitles.hpp b/dayz_code/rscTitles.hpp
index c5aed2f1f..3e6ed544a 100644
--- a/dayz_code/rscTitles.hpp
+++ b/dayz_code/rscTitles.hpp
@@ -87,7 +87,7 @@ class RscDisplayMain : RscStandardDisplay
class DAYZ_Version : CA_Version
{
idc = -1;
- text = "DayZ 1.7.5.M1D9";
+ text = "DayZ 1.7.5.M1D15";
y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)";
};
class CA_TitleMainMenu;
diff --git a/dayz_code/stringtable.xml b/dayz_code/stringtable.xml
index 7a541b893..0408bdaf3 100644
--- a/dayz_code/stringtable.xml
+++ b/dayz_code/stringtable.xml
@@ -167,6 +167,12 @@
Du hast eine(n) %1 gebaut
Вы построили %1.
+
+ You have failed to build %1.
+ You have failed to build %1.
+ You have failed to build %1.
+ You have failed to build %1.
+
You cannot make a fireplace here. The area must be flat, and free of other objects
You cannot make a fireplace here. The area must be flat, and free of other objects
@@ -609,6 +615,12 @@
%1 löschen
Погасить %1
+
+ You cannot perform another blood transfusion so fast
+ You cannot perform another blood transfusion so fast
+ You cannot perform another blood transfusion so fast
+ You cannot perform another blood transfusion so fast
+
Study Body
Study Body
@@ -639,6 +651,12 @@
Turn Over %1
Turn Over %1
+
+ Enable Stats
+ Enable Stats
+ Enable Stats
+ Enable Stats
+
Sleep
Sleep
@@ -724,4 +742,150 @@
Позвать собаку
+
+
+ Box of Wet Matches
+ Box of Wet Matches
+ Box of Wet Matches
+ Box of Wet Matches
+
+
+ Box of wet matches.
+ Box of wet matches.
+ Box of wet matches.
+ Box of wet matches.
+
+
+ Blunt Hatchet
+ Blunt Hatchet
+ Blunt Hatchet
+ Blunt Hatchet
+
+
+ Your Hatchet appears to be too bunt to be used.
+ Your Hatchet appears to be too bunt to be used.
+ Your Hatchet appears to be too bunt to be used.
+ Your Hatchet appears to be too bunt to be used.
+
+
+ Blunt Knife
+ Blunt Knife
+ Blunt Knife
+ Blunt Knife
+
+
+ Your Knife appears to be too bunt.
+ Your Knife appears to be too bunt.
+ Your Knife appears to be too bunt.
+ Your Knife appears to be too bunt.
+
+
+ Mutton Raw
+ Mutton Raw
+ Mutton Raw
+ Mutton Raw
+
+
+ Goat Meat to be used for sustainment, must be cooked prior to eating.
+ Goat Meat to be used for sustainment, must be cooked prior to eating.
+ Goat Meat to be used for sustainment, must be cooked prior to eating.
+ Goat Meat to be used for sustainment, must be cooked prior to eating.
+
+
+ Raw Chicken Leg
+ Raw Chicken Leg
+ Raw Chicken Leg
+ Raw Chicken Leg
+
+
+ Chicken Leg to be used for sustainment, must be cooked prior to eating.
+ Chicken Leg to be used for sustainment, must be cooked prior to eating.
+ Chicken Leg to be used for sustainment, must be cooked prior to eating.
+ Chicken Leg to be used for sustainment, must be cooked prior to eating.
+
+
+ Rabbit Raw
+ Rabbit Raw
+ Rabbit Raw
+ Rabbit Raw
+
+
+ Rabbit to be used for sustainment, must be cooked prior to eating.
+ Rabbit to be used for sustainment, must be cooked prior to eating.
+ Rabbit to be used for sustainment, must be cooked prior to eating.
+ Rabbit to be used for sustainment, must be cooked prior to eating.
+
+
+ Raw Bacon
+ Raw Bacon
+ Raw Bacon
+ Raw Bacon
+
+
+ Bacon to be used for sustainment, must be cooked prior to eating.
+ Bacon to be used for sustainment, must be cooked prior to eating.
+ Bacon to be used for sustainment, must be cooked prior to eating.
+ Bacon to be used for sustainment, must be cooked prior to eating.
+
+
+ Cooked Mutton
+ Cooked Mutton
+ Cooked Mutton
+ Cooked Mutton
+
+
+ Goat Meat to be used for sustainment.
+ Goat Meat to be used for sustainment.
+ Goat Meat to be used for sustainment.
+ Goat Meat to be used for sustainment.
+
+
+ Chicken Leg
+ Chicken Leg
+ Chicken Leg
+ Chicken Leg
+
+
+ Chicken Leg to be used for sustainment.
+ Chicken Leg to be used for sustainment.
+ Chicken Leg to be used for sustainment.
+ Chicken Leg to be used for sustainment.
+
+
+ Rabbit
+ Rabbit
+ Rabbit
+ Rabbit
+
+
+ Rabbit to be used for sustainmen.
+ Rabbit to be used for sustainment.
+ Rabbit to be used for sustainment.
+ Rabbit to be used for sustainment.
+
+
+ Bacon
+ Bacon
+ Bacon
+ Bacon
+
+
+ Bacon to be used for sustainment, must be cooked prior to eating.
+ Bacon to be used for sustainment, must be cooked prior to eating.
+ Bacon to be used for sustainment, must be cooked prior to eating.
+ Bacon to be used for sustainment, must be cooked prior to eating.
+
+
+ Angel Cookies
+ Angel Cookies
+ Angel Cookies
+ Angel Cookies
+
+
+ Angel Cookies to boost your moral up!
+ Angel Cookies to boost your moral up!
+ Angel Cookies to boost your moral up!
+ Angel Cookies to boost your moral up!
+
+
\ No newline at end of file
diff --git a/dayz_code/system/player_monitor.fsm b/dayz_code/system/player_monitor.fsm
index 3c8c532c1..d30e842e4 100644
--- a/dayz_code/system/player_monitor.fsm
+++ b/dayz_code/system/player_monitor.fsm
@@ -285,11 +285,9 @@ class FSM
" _temp = round(player getVariable [""temperature"",100]);" \n
" _currentState = [_currentWpn,_currentAnim,_temp];" \n
" " \n
- " //dayzCharDisco = [dayz_characterID,_playerPos,[weapons player,_magazineArray],[typeOf (unitbackpack player),getWeaponCargo (unitbackpack player),getMagazineCargo (unitbackpack player)],_medical,_currentState,_currentModel];" \n
+ " //[""dayzCharDisco"",[dayz_characterID,_playerPos,[weapons player,_magazineArray],[typeOf (unitbackpack player),getWeaponCargo (unitbackpack player),getMagazineCargo (unitbackpack player)],_medical,_currentState,_currentModel]] call callRpcProcedure;" \n
" //diag_log str(dayzCharDisco); " \n
"" \n
- " //publicVariableServer ""dayzCharDisco"";" \n
- " // remove isServer from player space" \n
" dayz_lastSave = time;" \n
" dayz_Magazines = [];" \n
"};"/*%FSM*/;
@@ -425,12 +423,9 @@ class FSM
"" \n
"_msg = [];" \n
"" \n
- "dayzLogin = [_playerUID,player];" \n
+ "[""dayzLogin"",[_playerUID,player]] call callRpcProcedure;" \n
"dayzPlayerLogin = [];" \n
- "publicVariableServer ""dayzLogin"";" \n
- "if (isServer) then {" \n
- " dayzLogin call server_playerLogin;" \n
- "};"/*%FSM*/;
+ ""/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
{
@@ -651,9 +646,7 @@ class FSM
"};" \n
"" \n
"dayzPlayerLogin2 = [];" \n
- "dayzLogin2 = [_charID,player,_playerUID];" \n
- "publicVariableServer ""dayzLogin2"";" \n
- "// remove isServer from player space" \n
+ "[""dayzLogin2"",[_charID,player,_playerUID]] call callRpcProcedure;" \n
"" \n
"dayz_loadScreenMsg = ""Requesting Character data from server"";" \n
"progressLoadingScreen 0.8;" \n
@@ -1096,15 +1089,9 @@ class FSM
"" \n
"dayz_animalCheck = [] spawn player_spawn_1;" \n
"" \n
- "dayz_lootCheck = [] spawn {" \n
+ "dayz_spawnCheck = [] spawn {" \n
" while {true} do {" \n
- " [""Loot""] call player_spawnCheck;" \n
- " sleep 10;" \n
- " };" \n
- "};" \n
- "dayz_zedCheck = [] spawn {" \n
- " while {true} do {" \n
- " [""Zeds""] call player_spawnCheck; " \n
+ " [""both""] call player_spawnCheck;" \n
" sleep 8;" \n
" };" \n
"};" \n
@@ -1154,8 +1141,8 @@ class FSM
init = /*%FSM*/"dayzGearSave = true;" \n
"dayz_myPosition = getPosATL player;" \n
"" \n
- "dayzLoginRecord = [_playerUID,_charID,0];" \n
- "publicVariableServer ""dayzLoginRecord"";"/*%FSM*/;
+ "[""dayzLoginRecord"",[_playerUID,_charID,0]] call callRpcProcedure;" \n
+ ""/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
{
diff --git a/dayz_code/system/player_spawn_2.sqf b/dayz_code/system/player_spawn_2.sqf
index 6bda5a7f0..934bd4593 100644
--- a/dayz_code/system/player_spawn_2.sqf
+++ b/dayz_code/system/player_spawn_2.sqf
@@ -106,7 +106,7 @@ while {true} do {
//Has infection?
if (r_player_infected) then {
- [player,"cough",8,false] call dayz_zombieSpeak;
+ [player,"cough",8,true] call dayz_zombieSpeak;
};
//Record Check
@@ -176,8 +176,9 @@ while {true} do {
//If has infection reduce blood
if (r_player_infected) then {
- if (r_player_blood > 6000) then {
+ if (r_player_blood > 3000) then {
r_player_blood = r_player_blood - 3;
+ player setVariable["USEC_BloodQty",r_player_blood];
};
};
@@ -219,8 +220,7 @@ while {true} do {
if ((time - dayz_damageCounter) > 180) then {
if (!r_player_unconscious) then {
dayz_canDisconnect = true;
- dayzDiscoRem = getPlayerUID player;
- publicVariableServer "dayzDiscoRem";
+ ["dayzDiscoRem",getPlayerUID player] call callRpcProcedure;
//Ensure Control is hidden
_display = uiNamespace getVariable 'DAYZ_GUI_display';
@@ -233,11 +233,8 @@ while {true} do {
//Save Checker
if (dayz_unsaved) then {
if ((time - dayz_lastSave) > _saveTime) then {
- dayzPlayerSave = [player,dayz_Magazines,false];
- publicVariableServer "dayzPlayerSave";
- if (isServer) then {
- dayzPlayerSave call server_playerSync;
- };
+ ["dayzPlayerSave",[player,dayz_Magazines,false]] call callRpcProcedure;
+
dayz_lastSave = time;
dayz_Magazines = [];
};
diff --git a/dayz_server/compile/server_deleteObj.sqf b/dayz_server/compile/server_deleteObj.sqf
new file mode 100644
index 000000000..277700dfd
--- /dev/null
+++ b/dayz_server/compile/server_deleteObj.sqf
@@ -0,0 +1,21 @@
+/*
+[_objectID,_objectUID] call server_deleteObj;
+*/
+private["_id","_uid","_key"];
+_id = _this select 0;
+_uid = _this select 1;
+
+if (isServer) then {
+ //remove from database
+ if (parseNumber _id > 0) then {
+ //Send request
+ _key = format["CHILD:304:%1:",_id];
+ _key call server_hiveWrite;
+ diag_log format["DELETE: Deleted by ID: %1",_id];
+ } else {
+ //Send request
+ _key = format["CHILD:310:%1:",_uid];
+ _key call server_hiveWrite;
+ diag_log format["DELETE: Deleted by UID: %1",_uid];
+ };
+};
\ No newline at end of file
diff --git a/dayz_server/compile/server_gutObject.sqf b/dayz_server/compile/server_gutObject.sqf
index 29238486d..d6707d65e 100644
--- a/dayz_server/compile/server_gutObject.sqf
+++ b/dayz_server/compile/server_gutObject.sqf
@@ -1,11 +1,32 @@
-private ["_qty","_item","_meat","_loop","_timer"];
+private["_item","_qty","_type","_meat","_loop"];
_item = _this select 0;
_qty = _this select 1;
+_type = typeOf _item;
_meat = 0;
_loop = true;
if (local _item) then {
for "_x" from 1 to _qty do {
- _item addMagazine "FoodSteakRaw";
+ diag_log ("Item Type: " +str(_item));
+ switch (_type) do {
+ case "Cow": {
+ _item addMagazine "FoodSteakRaw";
+ };
+ case "Goat": {
+ _item addMagazine "FoodSteakRaw";
+ };
+ case "Sheep": {
+ _item addMagazine "FoodSteakRaw";
+ };
+ case "WildBoar": {
+ _item addMagazine "FoodboarRaw";
+ };
+ case "hen": {
+ _item addMagazine "FoodSteakRaw";
+ };
+ case "Rabbit": {
+ _item addMagazine "FoodSteakRaw";
+ };
+ };
};
sleep 2;
_timer = time;
@@ -15,9 +36,11 @@ if (local _item) then {
if ((time - _timer) > 300) then {_loop = false};
sleep 1;
};
- dayzHideBody = _item;
- publicVariable "dayzHideBody";
- hideBody _item;
+ ["dayzHideBody",_item] call broadcastRpcCallAll;
sleep 10;
deleteVehicle _item;
+} else {
+ _ehLoc = "client";
+ if (isServer) then { _ehLoc = "server"; };
+ diag_log format["gutObject EH on %1 item not local ! Type: %2",_ehLoc,str(_item)];
};
\ No newline at end of file
diff --git a/dayz_server/compile/server_gutObjectZ.sqf b/dayz_server/compile/server_gutObjectZ.sqf
new file mode 100644
index 000000000..24865000e
--- /dev/null
+++ b/dayz_server/compile/server_gutObjectZ.sqf
@@ -0,0 +1,24 @@
+private["_item","_qty","_type","_meat","_loop"];
+_item = _this select 0;
+_qty = _this select 1;
+_type = typeOf _item;
+_meat = 0;
+_loop = true;
+if (local _item) then {
+ _item addMagazine "ItemZombieParts";
+ sleep 2;
+ _timer = time;
+ while {_loop} do {
+ _meat = count magazines _item;
+ if (_meat == 0) then {_loop = false};
+ if ((time - _timer) > 300) then {_loop = false};
+ sleep 1;
+ };
+ ["dayzHideBody",_item] call broadcastRpcCallAll;
+ sleep 10;
+ deleteVehicle _item;
+} else {
+ _ehLoc = "client";
+ if (isServer) then { _ehLoc = "server"; };
+ diag_log format["gutObject EH on %1 item not local ! Type: %2",_ehLoc,str(_item)];
+};
\ No newline at end of file
diff --git a/dayz_server/compile/server_playerLogin.sqf b/dayz_server/compile/server_playerLogin.sqf
index a04c22d07..a3497ba05 100644
--- a/dayz_server/compile/server_playerLogin.sqf
+++ b/dayz_server/compile/server_playerLogin.sqf
@@ -12,8 +12,6 @@ if (count _this > 2) then {
dayz_players = dayz_players - [_this select 2];
};
-//waitUntil{allowConnection};
-
//Variables
_inventory = [];
_backpack = [];
@@ -45,7 +43,7 @@ diag_log ("LOGIN ATTEMPT: " + str(_playerID) + " " + _playerName);
_doLoop = 0;
while {_doLoop < 5} do {
_key = format["CHILD:101:%1:%2:%3:",_playerID,dayZ_instance,_playerName];
- _primary = [_key,false,dayZ_hivePipeAuth] call server_hiveReadWrite;
+ _primary = _key call server_hiveReadWrite;
if (count _primary > 0) then {
if ((_primary select 0) != "ERROR") then {
_doLoop = 9;
diff --git a/dayz_server/compile/server_playerSetup.sqf b/dayz_server/compile/server_playerSetup.sqf
index 806abb54c..7f989c5d4 100644
--- a/dayz_server/compile/server_playerSetup.sqf
+++ b/dayz_server/compile/server_playerSetup.sqf
@@ -34,7 +34,7 @@ _state = [];
_doLoop = 0;
while {_doLoop < 5} do {
_key = format["CHILD:102:%1:",_characterID];
- _primary = [_key,false,dayZ_hivePipeAuth] call server_hiveReadWrite;
+ _primary = _key call server_hiveReadWrite;
if (count _primary > 0) then {
if ((_primary select 0) != "ERROR") then {
_doLoop = 9;
@@ -116,9 +116,7 @@ if (count _medical > 0) then {
//Add Wounds
{
_playerObj setVariable[_x,true,true];
- [_playerObj,_x,_hit] spawn fnc_usec_damageBleed;
- usecBleed = [_playerObj,_x,0];
- publicVariable "usecBleed";
+ ["usecBleed",[_playerObj,_x,_hit]] call broadcastRpcCallAll;
} forEach (_medical select 8);
//Add fractures
diff --git a/dayz_server/compile/server_playerSync.sqf b/dayz_server/compile/server_playerSync.sqf
index c263e98f4..4941550f4 100644
--- a/dayz_server/compile/server_playerSync.sqf
+++ b/dayz_server/compile/server_playerSync.sqf
@@ -4,10 +4,13 @@ private["_character","_magazines","_force","_characterID","_charPos","_isInVehic
//waituntil {(typeName(_this) == "ARRAY");sleep 0.01;}; //seems to cause often infinite waits (but not for first n players)
-if ( typeName(_this) == "OBJECT" ) then {
+//this only happens when we don't follow the correct parameter format...
+//(like supplying just the player object instead of the array in player_eat.sqf)
+//i've fixed this in player_eat so i can comment this part out
+/*if ( typeName(_this) == "OBJECT" ) then {
_this = [_this,[],true];
//diag_log ("DW_DEBUG: #manual fix _this: " + str(_this));
-};
+};*/
//correct
//"UPDATE: [B 1-1-B:1 (THE BEAST) REMOTE,[],true]"
diff --git a/dayz_server/compile/server_spawnCrashSite.sqf b/dayz_server/compile/server_spawnCrashSite.sqf
index 1b9aa955f..020a13213 100644
--- a/dayz_server/compile/server_spawnCrashSite.sqf
+++ b/dayz_server/compile/server_spawnCrashSite.sqf
@@ -1,7 +1,5 @@
private["_position","_num","_config","_itemType","_itemChance","_weights","_index","_iArray","_crashModel","_lootTable","_guaranteedLoot","_randomizedLoot","_frequency","_variance","_spawnChance","_spawnMarker","_spawnRadius","_spawnFire","_permanentFire","_crashName"];
-waitUntil{!isNil "BIS_fnc_selectRandom"};
-
//_crashModel = _this select 0;
//_lootTable = _this select 1;
_guaranteedLoot = _this select 0;
@@ -78,9 +76,7 @@ while {true} do {
_crash setVariable ["ObjectID",1,true];
if (_spawnFire) then {
- dayzFire = [_crash,2,time,false,_fadeFire];
- publicVariable "dayzFire";
- nul=dayzFire spawn BIS_Effects_Burn;
+ ["dayzFire",[_crash,2,time,false,_fadeFire]] call broadcastRpcCallAll;
_crash setvariable ["fadeFire",_fadeFire,true];
};
@@ -92,8 +88,6 @@ while {true} do {
_weights = dayz_CBLChances select _index;
_cntWeights = count _weights;
- waituntil {!isnil "fnc_buildWeightedArray"};
-
for "_x" from 1 to _num do {
//create loot
_index = floor(random _cntWeights);
diff --git a/dayz_server/config.cpp b/dayz_server/config.cpp
new file mode 100644
index 000000000..47897fa2a
--- /dev/null
+++ b/dayz_server/config.cpp
@@ -0,0 +1,8 @@
+class CfgPatches {
+ class dayz_server {
+ units[] = {};
+ weapons[] = {};
+ requiredVersion = 0.1;
+ requiredAddons[] = {"dayz_code"};
+ };
+};
\ No newline at end of file
diff --git a/dayz_server/init/publicEH_server.sqf b/dayz_server/init/publicEH_server.sqf
new file mode 100644
index 000000000..025414203
--- /dev/null
+++ b/dayz_server/init/publicEH_server.sqf
@@ -0,0 +1,27 @@
+//register client->server rpc
+registerServerRpc = {
+ if (isServer) then {
+ _this call registerBroadcastRpc;
+ };
+};
+
+["dayzDeath", { (_this select 1) call server_playerDied; } ] call registerServerRpc;
+["dayzDiscoAdd", { dayz_disco set [count dayz_disco,(_this select 1)]; } ] call registerServerRpc;
+["dayzDiscoRem", { dayz_disco = dayz_disco - [(_this select 1)]; } ] call registerServerRpc;
+["dayzPlayerSave", { (_this select 1) call server_playerSync; } ] call registerServerRpc;
+["dayzPublishObj", { (_this select 1) call server_publishObj; } ] call registerServerRpc;
+["dayzUpdateVehicle", { (_this select 1) call server_updateObject; } ] call registerServerRpc;
+["dayzDeleteObj", { (_this select 1) call server_deleteObj; } ] call registerServerRpc;
+["dayzLogin", { (_this select 1) call server_playerLogin; } ] call registerServerRpc;
+["dayzLogin2", { (_this select 1) call server_playerSetup; } ] call registerServerRpc;
+//missing sqf for server_playerMorph
+//["dayzPlayerMorph", { (_this select 1) call server_playerMorph; } ] call registerServerRpc;
+["dayzLoginRecord", { (_this select 1) call dayz_recordLogin; } ] call registerServerRpc;
+["dayzCharDisco", { (_this select 1) call server_characterSync; } ] call registerServerRpc;
+["dayzGutBody", { (_this select 1) spawn server_gutObject; } ] call registerServerRpc;
+// DayZ Epoch Custom
+["dayzGutBodyZ", { (_this select 1) spawn server_gutObjectZ; } ] call registerServerRpc;
+["dayzPublishVeh", { (_this select 1) spawn server_publishVeh; } ] call registerServerRpc;
+["dayzTradeObject", { (_this select 1) spawn server_tradeObj; } ] call registerServerRpc;
+["dayzTraderMenu", { (_this select 1) spawn server_traders; } ] call registerServerRpc;
+
\ No newline at end of file
diff --git a/dayz_server/init/server_functions.sqf b/dayz_server/init/server_functions.sqf
index d285b443a..9b1e89dca 100644
--- a/dayz_server/init/server_functions.sqf
+++ b/dayz_server/init/server_functions.sqf
@@ -7,21 +7,18 @@ BIS_MPF_remoteExecutionServer = {
};
BIS_Effects_Burn = {};
-object_spawnDamVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_spawnDamVehicle.sqf";
server_playerLogin = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerLogin.sqf";
server_playerSetup = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerSetup.sqf";
server_onPlayerDisconnect = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_onPlayerDisconnect.sqf";
server_updateObject = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateObject.sqf";
server_playerDied = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerDied.sqf";
-server_publishObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishObject.sqf";
+server_publishObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishObject.sqf"; //Creates the object in DB
+server_deleteObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_deleteObj.sqf"; //Removes the object from the DB
+server_gutObject = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_gutObject.sqf"; //Generated on the server when gutting an object
+server_gutObjectZ = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_gutObjectZ.sqf"; //Generated on the server when gutting an object
server_publishVeh = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_publishVehicle.sqf"; // Custom to add vehicles
-
-server_tradeObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_tradeObject.sqf";
-
+server_tradeObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_tradeObject.sqf";
server_traders = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_traders.sqf";
-local_publishObj = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_publishObj.sqf"; //Creates the object in DB
-local_deleteObj = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_deleteObj.sqf"; //Creates the object in DB
-local_createObj = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_createObj.sqf"; //Creates the object in DB
server_playerSync = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerSync.sqf";
zombie_findOwner = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\zombie_findOwner.sqf";
server_updateNearbyObjects = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateNearbyObjects.sqf";
@@ -63,7 +60,7 @@ check_publishobject = {
_allowed = true;
};
- _allowed;
+ _allowed
};
//event Handlers
@@ -95,6 +92,23 @@ eh_localCleanup = {
}];
};
+server_hiveWrite = {
+ private["_data"];
+ //diag_log ("ATTEMPT WRITE: " + _this);
+ _data = "HiveExt" callExtension _this;
+ diag_log ("WRITE: " + _data);
+};
+
+server_hiveReadWrite = {
+ private["_key","_resultArray","_data"];
+ _key = _this;
+ //diag_log ("ATTEMPT READ/WRITE: " + _key);
+ _data = "HiveExt" callExtension _key;
+ diag_log ("READ/WRITE: " + _data);
+ _resultArray = call compile format ["%1",_data];
+ _resultArray
+};
+
server_characterSync = {
private ["_characterID","_playerPos","_playerGear","_playerBackp","_medical","_currentState","_currentModel","_key"];
_characterID = _this select 0;
@@ -110,28 +124,9 @@ server_characterSync = {
_key call server_hiveWrite;
};
-//was missing for server
-fnc_buildWeightedArray = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildWeightedArray.sqf"; //Checks which actions for nearby casualty
-
//onPlayerConnected "[_uid,_name] spawn server_onPlayerConnect;";
onPlayerDisconnected "[_uid,_name] call server_onPlayerDisconnect;";
-server_hiveWrite = {
- private["_data"];
- //diag_log ("ATTEMPT WRITE: " + _this);
- _data = "HiveEXT" callExtension _this;
- diag_log ("WRITE: " + _data);
-};
-
-server_hiveReadWrite = {
- private["_key","_resultArray","_data"];
- _key = _this select 0;
- //diag_log ("ATTEMPT READ/WRITE: " + _key);
- _data = "HiveEXT" callExtension _key;
- diag_log ("READ/WRITE: " + _data);
- _resultArray = call compile format ["%1;",_data];
- _resultArray;
-};
// Setup globals allow overwrite from init.sqf
if(isnil "dayz_MapArea") then {
@@ -144,38 +139,6 @@ if(isnil "HeliCrashArea") then {
HeliCrashArea = dayz_MapArea / 2;
};
-
-spawn_heliCrash = {
- private["_position","_veh","_config","_itemType","_itemTypes","_weights","_cntWeights","_index","_num","_i"];
-
- _position = [getMarkerPos "center",0,HeliCrashArea,10,0,2000,0] call BIS_fnc_findSafePos;
- _veh = createVehicle ["UH1Wreck_DZ",_position, [], 0, "CAN_COLLIDE"];
- dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_veh];
- _veh setVariable ["ObjectID",1,true];
- dayzFire = [_veh,2,time,false,false];
- publicVariable "dayzFire";
-
- _config = configFile >> "CfgBuildingLoot" >> "HeliCrash";
- _itemTypes = [] + getArray (_config >> "itemType");
- _index = dayz_CBLCounts find (count _itemTypes);
- _weights = dayz_CBLChances select _index;
- _cntWeights = count _weights;
- _num = round(random 4) + 3;
- for "_i" from 1 to _num do {
- //create loot
- _index = floor(random _cntWeights);
- _index = _weights select _index;
- _itemType = _itemTypes select _index;
- [_itemType select 0, _itemType select 1, _position, 5] call spawn_loot;
- _nearby = _position nearObjects ["WeaponHolder", 5];
- {
- _x setVariable ["permaLoot",true];
- } forEach _nearBy;
- };
-};
-
-
-
// Get all buildings and roads only once
MarkerPosition = getMarkerPos "center";
RoadList = MarkerPosition nearRoads DynamicVehicleArea;
@@ -462,6 +425,5 @@ dayz_objectUID2 = {
dayz_recordLogin = {
private["_key"];
_key = format["CHILD:103:%1:%2:%3:",_this select 0,_this select 1,_this select 2];
- diag_log ("HIVE: WRITE: "+ str(_key));
_key call server_hiveWrite;
};
diff --git a/dayz_server/system/server_cleanup.fsm b/dayz_server/system/server_cleanup.fsm
index 3c7ea0c57..41ac64bab 100644
--- a/dayz_server/system/server_cleanup.fsm
+++ b/dayz_server/system/server_cleanup.fsm
@@ -251,16 +251,14 @@ class FSM
name = "sync_the_time";
init = /*%FSM*/"//Send request" \n
"_key = ""CHILD:307:"";" \n
- "_result = [_key] call server_hiveReadWrite;" \n
+ "_result = _key call server_hiveReadWrite;" \n
"_outcome = _result select 0;" \n
"if(_outcome == ""PASS"") then {" \n
" _date = _result select 1; " \n
" _dateNum = dateToNumber(_date); " \n
" _diff = ( _dateNum - dateToNumber (date) )*365*24*60;" \n
" if ( abs(_diff)>5 ) then {" \n
- " setDate _date;" \n
- " dayzSetDate = _date;" \n
- " publicVariable ""dayzSetDate"";" \n
+ " [""dayzSetDate"",_date] call broadcastRpcCallAll;" \n
" diag_log (""TIME SYNC: Local Time set to "" + str(_date));" \n
" };" \n
"};" \n
diff --git a/dayz_server/system/server_monitor.sqf b/dayz_server/system/server_monitor.sqf
index c825c219f..f849e1773 100644
--- a/dayz_server/system/server_monitor.sqf
+++ b/dayz_server/system/server_monitor.sqf
@@ -9,7 +9,7 @@ if ((count playableUnits == 0) and !isDedicated) then {
isSinglePlayer = true;
};
-waitUntil{initialized};
+waitUntil{initialized}; //means all the functions are now defined
diag_log "HIVE: Starting";
@@ -17,12 +17,11 @@ diag_log "HIVE: Starting";
/* STREAM OBJECTS */
//Send the key
_key = format["CHILD:302:%1:",dayZ_instance];
- _data = "HiveEXT" callExtension _key;
+ _result = _key call server_hiveReadWrite;
diag_log "HIVE: Request sent";
//Process result
- _result = call compile format ["%1",_data];
_status = _result select 0;
_myArray = [];
@@ -31,8 +30,7 @@ diag_log "HIVE: Starting";
//Stream Objects
diag_log ("HIVE: Commence Object Streaming...");
for "_i" from 1 to _val do {
- _data = "HiveEXT" callExtension _key;
- _result = call compile format ["%1",_data];
+ _result = _key call server_hiveReadWrite;
_status = _result select 0;
_myArray set [count _myArray,_result];
@@ -184,14 +182,12 @@ diag_log "HIVE: Starting";
//Set the Time
//Send request
_key = "CHILD:307:";
- _result = [_key] call server_hiveReadWrite;
+ _result = _key call server_hiveReadWrite;
_outcome = _result select 0;
if(_outcome == "PASS") then {
_date = _result select 1;
if(isDedicated) then {
- setDate _date;
- dayzSetDate = _date;
- publicVariable "dayzSetDate";
+ ["dayzSetDate",_date] call broadcastRpcCallAll;
};
diag_log ("HIVE: Local Time set to " + str(_date));
@@ -201,7 +197,6 @@ diag_log "HIVE: Starting";
if (isDedicated) then {
endLoadingScreen;
};
- hiveInUse = false;
if (isDedicated) then {
_id = [] execFSM "\z\addons\dayz_server\system\server_cleanup.fsm";
@@ -242,7 +237,6 @@ for "_x" from 1 to MaxDynamicDebris do {
allowConnection = true;
-
// [_guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire]
nul = [3, 4, (50 * 60), (15 * 60), 0.75, 'center', 4000, true, false] spawn server_spawnCrashSite;