diff --git a/dayz_code/actions/buy_db.sqf b/dayz_code/actions/buy_db.sqf index 8f6bb0ad1..97b6be0e7 100644 --- a/dayz_code/actions/buy_db.sqf +++ b/dayz_code/actions/buy_db.sqf @@ -44,12 +44,12 @@ diag_log format["DEBUG Buy: %1", dayzTraderMenuResult]; _out = 1; _in = _cost; - _textCurrency = getText(configFile >> "CfgMagazines" >> _part_in >> "displayName"); + _textCurrency = getText(configFile >> _stype >> _part_in >> "displayName"); - _Display = "Buy " + _textPart + " for " + str(_cost) + " " + _textCurrency; - - // trade_items.sqf | [part_out, part_in, qty_out, qty_in,]; - _part = player addAction [_Display, _File,[_part_out,_part_in,_out,_in], _order, true, true, "",""]; + _Display = format["Buy %1 for %2 %3", _textPart, _cost, _textCurrency]; + + // trade_items.sqf | [part_out, part_in, qty_out, qty_in,_textPart,_textCurrency]; + _part = player addAction [_Display, _File,[_part_out,_part_in,_out,_in,"buy",_textPart,_textCurrency], _order, true, true, "",""]; diag_log format["DEBUG TRADER: %1", _part]; s_player_parts set [count s_player_parts,_part]; diff --git a/dayz_code/actions/lock_veh.sqf b/dayz_code/actions/lock_veh.sqf new file mode 100644 index 000000000..c37f5de9d --- /dev/null +++ b/dayz_code/actions/lock_veh.sqf @@ -0,0 +1,6 @@ +private["_vehicle"]; +_vehicle = _this select 3; + +_vehicle setVehicleInit "this lock true"; +_vehicle setVehicleInit "this lockCargo true"; +processInitCommands; diff --git a/dayz_code/actions/player_wearClothes.sqf b/dayz_code/actions/player_wearClothes.sqf index 5457a82e3..df562ed57 100644 --- a/dayz_code/actions/player_wearClothes.sqf +++ b/dayz_code/actions/player_wearClothes.sqf @@ -45,20 +45,11 @@ switch (_item) do { }; case "Skin_Survivor2_DZ": { _model = "Survivor2_DZ"; - if (_isFemale) then { - _model = "SurvivorW2_DZ"; - }; if (_isBandit) then { _model = "Bandit1_DZ"; - if (_isFemale) then { - _model = "BanditW1_DZ"; - }; }; if (_isHero) then { _model = "Survivor3_DZ"; - if (_isFemale) then { - _model = "SurvivorW2_DZ"; - }; }; }; }; diff --git a/dayz_code/actions/sell_db.sqf b/dayz_code/actions/sell_db.sqf index a79b9d35c..3f0a6dc74 100644 --- a/dayz_code/actions/sell_db.sqf +++ b/dayz_code/actions/sell_db.sqf @@ -35,7 +35,7 @@ diag_log format["DEBUG Sell: %1", dayzTraderMenuResult]; _tid = _x select 12; _actionFile = _x select 13; - _textPart = getText(configFile >> _stype >> _name >> "displayName"); + _textPart = getText(configFile >> _stype >> _scurrency >> "displayName"); _File = "\z\addons\dayz_code\actions\" + _actionFile + ".sqf"; @@ -44,12 +44,12 @@ diag_log format["DEBUG Sell: %1", dayzTraderMenuResult]; _out = _sell; _in = 1; - _textCurrency = getText(configFile >> "CfgMagazines" >> _part_out >> "displayName"); + _textCurrency = getText(configFile >> _btype >> _part_in >> "displayName"); - _Display = "Sell " + _textPart + " for " + str(_sell) + " " + _textCurrency; + _Display = format["Sell %1 for %2 %3", _textPart, _sell, _textCurrency]; - // trade_items.sqf | [part_out, part_in, qty_out, qty_in,]; - _part = player addAction [_Display, _File,[_part_out,_part_in,_out,_in], _order, true, true, "",""]; + // trade_items.sqf | [part_out, part_in, qty_out, qty_in,"buy",_textPart,_textCurrency]; + _part = player addAction [_Display, _File,[_part_out,_part_in,_out,_in,"sell",_textPart,_textCurrency], _order, true, true, "",""]; //diag_log format["DEBUG TRADER: %1", _part]; s_player_parts set [count s_player_parts,_part]; diff --git a/dayz_code/actions/trade_any_vehicle.sqf b/dayz_code/actions/trade_any_vehicle.sqf new file mode 100644 index 000000000..4e12ee6bd --- /dev/null +++ b/dayz_code/actions/trade_any_vehicle.sqf @@ -0,0 +1,79 @@ +private["_position","_veh","_location","_isOk","_backpack","_vehType","_trg","_key","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID"]; + +// [part_out,part_in, qty_out, qty_in, loc]; + +_part_out = (_this select 3) select 0; +_part_in = (_this select 3) select 1; +_qty_out = (_this select 3) select 2; +_qty_in = (_this select 3) select 3; +_buy_o_sell = (_this select 3) select 4; +_textPartIn = (_this select 3) select 5; +_textPartOut = (_this select 3) select 6; + +if(_buy_o_sell == "buy") then { + _qty = {_x == _part_in} count magazines player; +} else { + _obj = nearestObjects [(getPosATL player), [_part_in], 10]; + _qty = count _obj; +}; + + +if (_qty >= _qty_in) then { + + if(_buy_o_sell == "buy") then { + for "_x" from 1 to _qty_in do { + player removeMagazine _part_in; + }; + + _dir = 90; + + _location = [(position player),0,20,1,0,20,0] call BIS_fnc_findSafePos; + + //place tent (local) + _veh = createVehicle [_part_out, _location, [], 0, "CAN_COLLIDE"]; + _veh setdir _dir; + _veh setpos _location; + + //_veh setPosATL _position; + + player reveal _veh; + _location = getPosATL _veh; + + _veh setVariable ["characterID",dayz_characterID,true]; + + // server_publishVeh [_veh,[_dir,_objPosition],_vehicle,true,dayz_characterID] + dayzPublishVeh = [_veh,[_dir,_location],_part_out,false,dayz_characterID]; + + publicVariable "dayzPublishVeh"; + if (isServer) then { + dayzPublishVeh spawn server_publishVeh; + }; + + cutText [format[("Bought %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"]; + } else { + // Sell Vehicle + for "_x" from 1 to _qty_out do { + player addMagazine _part_out; + }; + + _obj = _obj select 0; + _objectID = _obj getVariable ["ObjectID","0"]; + _objectUID = _obj getVariable ["ObjectUID","0"]; + + dayzDeleteObj = [_objectID,_objectUID]; + publicVariableServer "dayzDeleteObj"; + if (isServer) then { + dayzDeleteObj call local_deleteObj; + }; + + deleteVehicle _obj; + + cutText [format[("Sold %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"]; + }; + + {player removeAction _x} forEach s_player_parts;s_player_parts = []; + s_player_parts_crtl = -1; + +} else { + cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"]; +}; \ No newline at end of file diff --git a/dayz_code/actions/trade_cancel.sqf b/dayz_code/actions/trade_cancel.sqf index eba622cd7..d6ff9413a 100644 --- a/dayz_code/actions/trade_cancel.sqf +++ b/dayz_code/actions/trade_cancel.sqf @@ -1,4 +1,4 @@ -private["none"]; +private["_none"]; {player removeAction _x} forEach s_player_parts;s_player_parts = []; //{player removeAction _x} forEach s_player_bank;s_player_bank = []; diff --git a/dayz_code/actions/trade_items.sqf b/dayz_code/actions/trade_items.sqf index 2bf4f33c1..90c8197f2 100644 --- a/dayz_code/actions/trade_items.sqf +++ b/dayz_code/actions/trade_items.sqf @@ -1,23 +1,16 @@ -private["_iarray","_part_out","_part_in","_qty_out","_qty_in","_qty"]; +private["_iarray","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_textPartIn","_textPartOut"]; // [part_out,part_in, qty_out, qty_in,]; _part_out = (_this select 3) select 0; _part_in = (_this select 3) select 1; _qty_out = (_this select 3) select 2; _qty_in = (_this select 3) select 3; - - -_textPartIn = getText(configFile >> "CfgMagazines" >> _part_in >> "displayName"); -_textPartOut = getText(configFile >> "CfgMagazines" >> _part_out >> "displayName"); - - -// not portable yet -//{player removeAction _x} forEach s_player_metals;s_player_metals = []; -//s_player_metal_crtl = -1; +_buy_o_sell = (_this select 3) select 4; +_textPartIn = (_this select 3) select 5; +_textPartOut = (_this select 3) select 6; _qty = {_x == _part_in} count magazines player; - if (_qty >= _qty_in) then { for "_x" from 1 to _qty_in do { @@ -28,8 +21,11 @@ if (_qty >= _qty_in) then { player addMagazine _part_out; }; - [player,"repair",0,false] call dayz_zombieSpeak; + // [player,"repair",0,false] call dayz_zombieSpeak; cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"]; + + {player removeAction _x} forEach s_player_parts;s_player_parts = []; + s_player_parts_crtl = -1; } else { _needed = _qty_in - _qty; cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"]; diff --git a/dayz_code/actions/trade_weapons.sqf b/dayz_code/actions/trade_weapons.sqf new file mode 100644 index 000000000..c5957693a --- /dev/null +++ b/dayz_code/actions/trade_weapons.sqf @@ -0,0 +1,47 @@ +private["_iarray","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell"]; +// [part_out,part_in, qty_out, qty_in,"buy"]; + +_part_out = (_this select 3) select 0; +_part_in = (_this select 3) select 1; +_qty_out = (_this select 3) select 2; +_qty_in = (_this select 3) select 3; +_buy_o_sell = (_this select 3) select 4; +_textPartIn = (_this select 3) select 5; +_textPartOut = (_this select 3) select 6; + +if(_buy_o_sell == "buy") then { + _qty = {_x == _part_in} count magazines player; +} else { + _qty = {_x == _part_in} count weapons player; +}; + +if (_qty >= _qty_in) then { + + for "_x" from 1 to _qty_in do { + if(_buy_o_sell == "buy") then { + player removeMagazine _part_in; + } else { + player removeWeapon _part_in; + }; + }; + + for "_x" from 1 to _qty_out do { + if(_buy_o_sell == "buy") then { + player addWeapon _part_out; + } else { + player addMagazine _part_out; + }; + }; + + + // [player,"repair",0,false] call dayz_zombieSpeak; + cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"]; + + {player removeAction _x} forEach s_player_parts;s_player_parts = []; + s_player_parts_crtl = -1; + + +} else { + _needed = _qty_in - _qty; + cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"]; +}; \ No newline at end of file diff --git a/dayz_code/actions/unlock_veh.sqf b/dayz_code/actions/unlock_veh.sqf new file mode 100644 index 000000000..d2aa55755 --- /dev/null +++ b/dayz_code/actions/unlock_veh.sqf @@ -0,0 +1,6 @@ +private["_vehicle"]; +_vehicle = _this select 3; + +_vehicle setVehicleInit "this lock false"; +_vehicle setVehicleInit "this lockCargo false"; +processInitCommands; diff --git a/dayz_code/cfgVehicles.hpp b/dayz_code/cfgVehicles.hpp index 6c6e02301..f00307da5 100644 --- a/dayz_code/cfgVehicles.hpp +++ b/dayz_code/cfgVehicles.hpp @@ -194,12 +194,9 @@ class CfgVehicles { gunnerCanSee = 2+16+32; driverCanSee = 2+16+32; }; - //HMMWV_Ambulance_CZ_DES_EP1 - class HMMWV_Ambulance; - class HMMWV_Ambulance_DZ: HMMWV_Ambulance + //Mi17_TK_EP1 + class Mi17_TK_EP1 { - radartype = 0; - displayName = "HMMWV_Ambulance_DZ"; scope = 2; side = 2; crew = ""; @@ -210,29 +207,17 @@ class CfgVehicles { weapons[] = {}; magazines[] = {}; gunnerHasFlares = false; + commanderCanSee = 2+16+32; + gunnerCanSee = 2+16+32; + driverCanSee = 2+16+32; }; - //Mi17_Civilian - class Mi17_Civilian; - class Mi17_DZ: Mi17_Civilian + class Mi17_DZ: Mi17_TK_EP1 { - radartype = 0; displayName = "Mi17_DZ"; - scope = 2; - side = 2; - crew = ""; - typicalCargo[] = {}; - hiddenSelections[] = {}; - class TransportMagazines{}; - class TransportWeapons{}; - weapons[] = {}; - magazines[] = {}; - gunnerHasFlares = false; }; //An2_TK_EP1 - class An2_TK_EP1; - class AN2_DZ: An2_TK_EP1 { - radartype = 0; - displayName = "AN2_DZ"; + class An2_TK_EP1 + { scope = 2; side = 2; crew = ""; @@ -243,28 +228,17 @@ class CfgVehicles { weapons[] = {}; magazines[] = {}; gunnerHasFlares = false; + commanderCanSee = 2+16+32; + gunnerCanSee = 2+16+32; + driverCanSee = 2+16+32; }; - //UH60M_MEV_EP1 - class UH60M_MEV_EP1; - class UH60M_DZ: UH60M_MEV_EP1 { - radartype = 0; - displayName = "UH60M_DZ"; - scope = 2; - side = 2; - crew = ""; - typicalCargo[] = {}; - hiddenSelections[] = {}; - class TransportMagazines{}; - class TransportWeapons{}; - weapons[] = {}; - magazines[] = {}; - gunnerHasFlares = false; + class AN2_DZ: An2_TK_EP1 + { + displayName = "AN2_DZ"; }; //AH6X_EP1 - class AH6X_EP1; - class AH6X_DZ: AH6X_EP1 { - radartype = 0; - displayName = "AH6X_DZ"; + class AH6X_EP1 + { scope = 2; side = 2; crew = ""; @@ -275,6 +249,13 @@ class CfgVehicles { weapons[] = {}; magazines[] = {}; gunnerHasFlares = false; + commanderCanSee = 2+16+32; + gunnerCanSee = 2+16+32; + driverCanSee = 2+16+32; + }; + class AH6X_DZ: AH6X_EP1 + { + displayName = "AH6X_DZ"; }; class House { class DestructionEffects; diff --git a/dayz_code/compile/building_spawnLoot.sqf b/dayz_code/compile/building_spawnLoot.sqf index 280221650..cc7d0b043 100644 --- a/dayz_code/compile/building_spawnLoot.sqf +++ b/dayz_code/compile/building_spawnLoot.sqf @@ -19,7 +19,7 @@ _itemChance = [] + getArray (_config >> "itemChance"); { private["_iPos2"]; _iPos2 = _obj modelToWorld _x; - _rnd = random 3; + _rnd = random 1; //Place something at each position if (player distance _iPos2 > 5) then { if (_rnd < _lootChance) then { diff --git a/dayz_code/compile/fn_damageHandler.sqf b/dayz_code/compile/fn_damageHandler.sqf index a6fa774a6..904c94f39 100644 --- a/dayz_code/compile/fn_damageHandler.sqf +++ b/dayz_code/compile/fn_damageHandler.sqf @@ -46,6 +46,10 @@ if (_isPlayer) then { if (_unit == player) then { if (_hit == "") then { if ((_source != player) and _isPlayer) then { + //Enable aggressor Actions + if (_source isKindOf "CAManBase") then { + _source setVariable["startcombattimer",1]; + }; _canHitFree = player getVariable ["freeTarget",false]; _isBandit = (typeOf player) == "Bandit1_DZ"; if (!_canHitFree and !_isBandit) then { diff --git a/dayz_code/compile/fn_selfActions.sqf b/dayz_code/compile/fn_selfActions.sqf index 0bcdbf16f..29cd0ab9b 100644 --- a/dayz_code/compile/fn_selfActions.sqf +++ b/dayz_code/compile/fn_selfActions.sqf @@ -4,7 +4,7 @@ scriptName "Functions\misc\fn_selfActions.sqf"; - Function - [] call fnc_usec_selfActions; ************************************************************/ -private["_menClose","_hasBandage","_hasEpi","_hasMorphine","_hasBlood","_vehicle","_inVehicle","_color","_part"]; +private["_menClose","_hasBandage","_hasEpi","_hasMorphine","_hasBlood","_vehicle","_inVehicle","_color","_part","_traderType"]; _vehicle = vehicle player; _inVehicle = (_vehicle != player); @@ -46,6 +46,7 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4)) _isHarvested = cursorTarget getVariable["meatHarvested",false]; _isVehicle = cursorTarget isKindOf "AllVehicles"; _isMan = cursorTarget isKindOf "Man"; + _traderType = typeOf cursorTarget; _ownerID = cursorTarget getVariable ["characterID","0"]; _isAnimal = cursorTarget isKindOf "Animal"; _isZombie = cursorTarget isKindOf "zZombie_base"; @@ -70,7 +71,7 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4)) }; // Bank Vault Code Misc_cargo_cont_tiny - if (!_isMan and _type == "Misc_cargo_cont_tiny") then { + if (!_isMan and _traderType == bank_atm) then { if (s_player_bankvault_crtl < 0) then { @@ -226,11 +227,6 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4)) _string = format["Repair%1",_cmpt,_color]; //Repair - Part _handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\repair.sqf",[_vehicle,_part,_x], 0, false, true, "",""]; s_player_repairActions set [count s_player_repairActions,_handle]; - } else { - _color = "color='#70bf44'"; //green - _string = format["Take%1",_cmpt,_color]; //Take - Part - _handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\repair.sqf",[_vehicle,_part,_x], 0, false, true, "",""]; - s_player_repairActions set [count s_player_repairActions,_handle]; }; } forEach _hitpoints; @@ -240,7 +236,7 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4)) }; // Parts Trader Worker3 - if (_isMan and cursorTarget == parts_trader_1) then { + if (_isMan and _traderType == parts_trader) then { if (s_player_parts_crtl < 0) then { @@ -256,16 +252,90 @@ if (!isNull cursorTarget and !_inVehicle and (player distance cursorTarget < 4)) }; - // Dr_Hladik_EP1 - if (_isMan and cursorTarget == mad_sci) then { + // hintSilent format["DEBUG TRADER TARGET: %1 %2", cursorTarget,weapon_trader_1]; + + //weapon_trader_1 + if (_isMan and _traderType == weapon_trader) then { - if (s_player_madsci_crtl < 0) then { + if (s_player_parts_crtl < 0) then { + + // [_trader_id, _category, ]; + _buy = player addAction ["Buy Weapons", "\z\addons\dayz_code\actions\buy_db.sqf",[4,"Weapons"], 99, true, false, "",""]; + _sell = player addAction ["Sell Weapons", "\z\addons\dayz_code\actions\sell_db.sqf",[4,"Weapons"], 98, true, false, "",""]; + + s_player_parts set [count s_player_parts,_buy]; + s_player_parts set [count s_player_parts,_sell]; + + s_player_parts_crtl = 1; + }; + + }; + + // can_trader_1 + if (_isMan and _traderType == can_trader) then { + + if (s_player_parts_crtl < 0) then { + + // [_trader_id, _category, ]; + _buy = player addAction ["Buy Food", "\z\addons\dayz_code\actions\buy_db.sqf",[5,"Food"], 99, true, false, "",""]; + _sell = player addAction ["Sell Food", "\z\addons\dayz_code\actions\sell_db.sqf",[5,"Food"], 98, true, false, "",""]; + + s_player_parts set [count s_player_parts,_buy]; + s_player_parts set [count s_player_parts,_sell]; + + s_player_parts_crtl = 1; + }; + + }; + + //ammo_trader_1 + if (_isMan and _traderType == ammo_trader) then { + + if (s_player_parts_crtl < 0) then { + + // [_trader_id, _category, ]; + _buy = player addAction ["Buy Ammo", "\z\addons\dayz_code\actions\buy_db.sqf",[2,"Ammo"], 99, true, false, "",""]; + _sell = player addAction ["Sell Ammo", "\z\addons\dayz_code\actions\sell_db.sqf",[2,"Ammo"], 98, true, false, "",""]; + + s_player_parts set [count s_player_parts,_buy]; + s_player_parts set [count s_player_parts,_sell]; + + s_player_parts_crtl = 1; + }; + + }; + + //auto_trader_1 + if (_isMan and _traderType == auto_trader) then { + + if (s_player_parts_crtl < 0) then { + + // [_trader_id, _category, ]; + _buy = player addAction ["Buy Vehicle", "\z\addons\dayz_code\actions\buy_db.sqf",[6,"Vehicle"], 99, true, false, "",""]; + _sell = player addAction ["Sell Vehicle", "\z\addons\dayz_code\actions\sell_db.sqf",[6,"Vehicle"], 98, true, false, "",""]; + + s_player_parts set [count s_player_parts,_buy]; + s_player_parts set [count s_player_parts,_sell]; + + s_player_parts_crtl = 1; + }; + + }; + + // mad_sci + if (_isMan and _traderType == mad_sci) then { + + if (s_player_parts_crtl < 0) then { // [part_out, part_in, qty_out, qty_in,]; - _zparts1 = player addAction ["Trade Zombie Parts for Bio Meat", "\z\addons\dayz_code\actions\trade_items.sqf",["FoodBioMeat","ItemZombieParts",2,1], 99, true, true, "",""]; + _zparts1 = player addAction ["Trade Zombie Parts for Bio Meat", "\z\addons\dayz_code\actions\trade_items.sqf",["FoodBioMeat","ItemZombieParts",1,1], 99, true, true, "",""]; + _zparts2 = player addAction ["Buy Medical", "\z\addons\dayz_code\actions\buy_db.sqf",[3,"Medical"], 97, true, false, "",""]; + _zparts3 = player addAction ["Sell Medical", "\z\addons\dayz_code\actions\sell_db.sqf",[3,"Medical"], 96, true, false, "",""]; - s_player_madsci set [count s_player_madsci,_zparts1]; - s_player_madsci_crtl = 1; + s_player_parts set [count s_player_parts,_zparts1]; + s_player_parts set [count s_player_parts,_zparts2]; + s_player_parts set [count s_player_parts,_zparts3]; + s_player_parts_crtl = 1; }; }; diff --git a/dayz_code/compile/player_animalCheck.sqf b/dayz_code/compile/player_animalCheck.sqf index ff83b46dd..1dc147617 100644 --- a/dayz_code/compile/player_animalCheck.sqf +++ b/dayz_code/compile/player_animalCheck.sqf @@ -4,13 +4,30 @@ _list = getposATL player nearEntities [["CAAnimalBase"],dayz_animalDistance]; if (count _list < dayz_maxAnimals) then { //Find where animal likes - _animalssupported = ["hen","Cow","Sheep","WildBoar","WildBoar","WildBoar","Goat","Rabbit","Rabbit","DZ_Fin","DZ_Pastor"]; - //_animalssupported = ["DZ_Fin","DZ_Pastor"]; + _animalssupported = ["Chicken","Cow","Sheep","WildBoar","WildBoar","WildBoar","Goat","Rabbit","Rabbit","Dog"]; + _type = (_animalssupported select floor(random(count _animalssupported))); if (_type == "Cow") then { - _animalssupported = ["Cow01","Cow02","Cow03","Cow04"]; + _animalssupported = ["Cow01","Cow02","Cow03","Cow04","Cow01_EP1"]; _type = (_animalssupported select floor(random(count _animalssupported))); }; + if (_type == "Goat") then { + _animalssupported = ["Goat01_EP1","Goat02_EP1","Goat"]; + _type = (_animalssupported select floor(random(count _animalssupported))); + }; + if (_type == "Sheep") then { + _animalssupported = ["Sheep","Sheep02_EP1","Sheep01_EP1"]; + _type = (_animalssupported select floor(random(count _animalssupported))); + }; + if (_type == "Chicken") then { + _animalssupported = ["Hen","Cock"]; + _type = (_animalssupported select floor(random(count _animalssupported))); + }; + if (_type == "Dog") then { + _animalssupported = ["DZ_Fin","DZ_Pastor"]; + _type = (_animalssupported select floor(random(count _animalssupported))); + }; + _root = configFile >> "CfgVehicles" >> _type; _favouritezones = getText ( _root >> "favouritezones"); diff --git a/dayz_code/compile/player_gearSync.sqf b/dayz_code/compile/player_gearSync.sqf index a511a0609..1e015013e 100644 --- a/dayz_code/compile/player_gearSync.sqf +++ b/dayz_code/compile/player_gearSync.sqf @@ -5,46 +5,9 @@ _objects = nearestObjects [getPosATL player, ["Car", "Helicopter", "Motorcycle", publicVariableServer "dayzUpdateVehicle"; } foreach _objects; -private ["_backpackWpnQtys","_backpackWpnTypes","_backpackWpn","_backpackMag","_countr"]; -dayz_myBackpack = unitBackpack player; -_backpackWpn = getWeaponCargo unitBackpack player; -_backpackMag = getMagazineCargo unitBackpack player; - -clearWeaponCargoGlobal unitBackpack player; -clearMagazineCargoGlobal unitBackpack player; - -//Fill backpack contents -//Weapons -_backpackWpnTypes = []; -_backpackWpnQtys = []; -if (count _backpackWpn > 0) then { - _backpackWpnTypes = _backpackWpn select 0; - _backpackWpnQtys = _backpackWpn select 1; -}; -_countr = 0; -{ - dayz_myBackpack addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)]; - _countr = _countr + 1; -} forEach _backpackWpnTypes; -//magazines -_backpackmagTypes = []; -_backpackmagQtys = []; -if (count _backpackmag > 0) then { - _backpackmagTypes = _backpackMag select 0; - _backpackmagQtys = _backpackMag select 1; -}; -_countr = 0; -{ - dayz_myBackpack addmagazineCargoGlobal [_x,(_backpackmagQtys select _countr)]; - _countr = _countr + 1; -} forEach _backpackmagTypes; - private["_dialog","_magazineArray","_control","_item","_val","_max"]; -diag_log ("REQUESTING GEAR SYNC"); -disableSerialization; -//if (!dayzGearSave) exitWith {}; -diag_log ("CONDUCTING GEAR SYNC"); +disableSerialization; _dialog = _this select 0; _magazineArray = []; diff --git a/dayz_code/compile/player_weaponFiredNear.sqf b/dayz_code/compile/player_weaponFiredNear.sqf index 25e2e0922..36498f205 100644 --- a/dayz_code/compile/player_weaponFiredNear.sqf +++ b/dayz_code/compile/player_weaponFiredNear.sqf @@ -19,10 +19,10 @@ private["_unit","_magazine","_used","_quantity","_magsNet","_magsWhole","_key"," _evType = ""; _recordable = false; - // Both the firer and those nearby (<=15m) go into "combat" to prevent ALT-F4 + // Both the firer and those nearby (<=8m) go into "combat" to prevent ALT-F4 _firer setVariable["startcombattimer", 1, true]; - if (_distance <= 15) then { + if (_distance <= 8) then { _unit setVariable["startcombattimer", 1, true]; }; diff --git a/dayz_code/config.cpp b/dayz_code/config.cpp index 38372fa72..2549a0076 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.4"; + version = "1.7.4-D8"; hiveVersion = 0.96; //0.93 }; }; @@ -755,7 +755,7 @@ class CfgBuildingLoot { }; //Qty: 2 class Land_A_TVTower_Base: Industrial { lootPos[] = {{-0.982422,-1.92627,-2.21573},{-2.01782,-4.2417,-2.21918},{-0.759277,1.42139,-2.21573}}; - } + }; class Land_Mil_House: Military { vehPos[] = {{13.439,3.25244,-5.71244,84}}; lootPos[] = {{12.457,1.4248,-5.81439},{11.0391,4.85278,-5.81439},{13.667,4.42139,-5.81439}}; diff --git a/dayz_code/init/compiles.sqf b/dayz_code/init/compiles.sqf index 866e35fed..d3edd639a 100644 --- a/dayz_code/init/compiles.sqf +++ b/dayz_code/init/compiles.sqf @@ -98,7 +98,7 @@ if (!isDedicated) then { [] spawn { private["_timeOut"]; _timeOut = 0; - while { _timeOut < 90 } do { + while { _timeOut < 60 } do { _timeOut = _timeOut + 1; sleep 1; }; diff --git a/dayz_code/init/publicEH.sqf b/dayz_code/init/publicEH.sqf index 6954a33dd..6b10d85e3 100644 --- a/dayz_code/init/publicEH.sqf +++ b/dayz_code/init/publicEH.sqf @@ -27,8 +27,9 @@ if (isServer) then { "dayzDiscoRem" addPublicVariableEventHandler {dayz_disco = dayz_disco - [(_this select 1)];}; "dayzPlayerSave" addPublicVariableEventHandler {_id = (_this select 1) spawn server_playerSync;}; "dayzPublishObj" addPublicVariableEventHandler {(_this select 1) call server_publishObj}; + "dayzPublishVeh" addPublicVariableEventHandler {(_this select 1) call server_publishVeh}; // for vehicle traders // "dayzPublishBank" addPublicVariableEventHandler {(_this select 1) call server_publishBank}; - "dayzTraderMenu" addPublicVariableEventHandler {(_this select 1) call server_traders}; + "dayzTraderMenu" addPublicVariableEventHandler {(_this select 1) call server_traders}; // for all traders "dayzUpdateVehicle" addPublicVariableEventHandler {_id = (_this select 1) spawn server_updateObject}; "dayzDeleteObj" addPublicVariableEventHandler {_id = (_this select 1) spawn local_deleteObj}; "dayzLogin" addPublicVariableEventHandler {_id = (_this select 1) spawn server_playerLogin}; diff --git a/dayz_code/init/variables.sqf b/dayz_code/init/variables.sqf index b791939bc..51c5b787e 100644 --- a/dayz_code/init/variables.sqf +++ b/dayz_code/init/variables.sqf @@ -170,7 +170,7 @@ dayz_zombieTargetList = [ dayzHit = []; dayzPublishObj = []; //used for eventhandler to spawn a mirror of players tent dayzHideBody = objNull; - +dayzPublishVeh = []; // for vehicle traders // dayzPublishBank = []; dayzTraderMenu = []; diff --git a/dayz_code/rscTitles.hpp b/dayz_code/rscTitles.hpp index bc1d56d4d..7ec78d5dc 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.4"; + text = "DayZ 1.7.4-D8"; y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)"; }; class CA_TitleMainMenu; diff --git a/dayz_equip/stringtable.xml b/dayz_equip/stringtable.xml index 067951210..fcf6f21be 100644 --- a/dayz_equip/stringtable.xml +++ b/dayz_equip/stringtable.xml @@ -326,8 +326,8 @@ Банка консервированных сардин. Срок хранения до 5 лет. - Can (Frank & Beans) - Can (Frank & Beans) + Can (Frank n Beans) + Can (Frank n Beans) Dose (Bohnen und Würste) Банка (Фасоль с мясом) diff --git a/dayz_server/compile/server_gutObject.sqf b/dayz_server/compile/server_gutObject.sqf index 2c94d4934..29238486d 100644 --- a/dayz_server/compile/server_gutObject.sqf +++ b/dayz_server/compile/server_gutObject.sqf @@ -1,4 +1,4 @@ -private["_qty","_item","_meat"]; +private ["_qty","_item","_meat","_loop","_timer"]; _item = _this select 0; _qty = _this select 1; _meat = 0; diff --git a/dayz_server/compile/server_onPlayerDisconnect.sqf b/dayz_server/compile/server_onPlayerDisconnect.sqf index 3d64e2afe..8fd64b054 100644 --- a/dayz_server/compile/server_onPlayerDisconnect.sqf +++ b/dayz_server/compile/server_onPlayerDisconnect.sqf @@ -1,11 +1,22 @@ /* */ -private["_hasDel","_serial","_object","_objects","_updates","_myGroup","_nearVeh"]; +private ["_object","_myGroup","_id","_playerID","_playerName","_characterID","_playerIDtoarray","_timeout"]; _playerID = _this select 0; _playerName = _this select 1; _object = call compile format["player%1",_playerID]; _characterID = _object getVariable ["characterID","0"]; +_timeout = _object getVariable["combattimeout",0]; + +_playerIDtoarray = []; +_playerIDtoarray = toArray _playerID; + +if (59 in _playerIDtoarray) exitWith {}; + +if ((_timeout - time) > 0) then { + diag_log("DEBUG: COMBAT LOG TIMER: " + str(_timeout)); + _playerName call player_combatLogged; +}; if (vehicle _object != _object) then { _object action ["eject", vehicle _object]; diff --git a/dayz_server/compile/server_playerDied.sqf b/dayz_server/compile/server_playerDied.sqf index f065b1694..88b786fea 100644 --- a/dayz_server/compile/server_playerDied.sqf +++ b/dayz_server/compile/server_playerDied.sqf @@ -1,4 +1,4 @@ -private["_characterID","_minutes","_newObject","_playerID","_playerName","_playerID","_myGroup","_group"]; +private ["_characterID","_minutes","_newObject","_playerID","_key"]; //[unit, weapon, muzzle, mode, ammo, magazine, projectile] _characterID = _this select 0; _minutes = _this select 1; @@ -16,9 +16,12 @@ diag_log ("DW_DEBUG: _newObject: " + str(_newObject)); }; */ +_characterID = parseNumber _characterID; +_minutes = parseNumber "_minutes"; + if !(isnil "_characterID") then { -if (_characterID != "0") then { +if (_characterID != 0) then { _key = format["CHILD:202:%1:%2:",_characterID,_minutes]; //diag_log ("HIVE: WRITE: "+ str(_key)); _key call server_hiveWrite; diff --git a/dayz_server/compile/server_playerLogin.sqf b/dayz_server/compile/server_playerLogin.sqf index e6e21b9ee..3f76e2f21 100644 --- a/dayz_server/compile/server_playerLogin.sqf +++ b/dayz_server/compile/server_playerLogin.sqf @@ -56,6 +56,10 @@ if (isNull _playerObj or !isPlayer _playerObj) exitWith { diag_log ("LOGIN RESULT: Exiting, player object null: " + str(_playerObj)); }; +if ((_primary select 0) == "ERROR") exitWith { + diag_log format ["LOGIN RESULT: Exiting, failed to load _primary: %1 for player: %2 ",_primary,_playerID]; +}; + //Process request _newPlayer = _primary select 1; _isNew = count _primary < 6; //_result select 1; diff --git a/dayz_server/compile/server_playerSetup.sqf b/dayz_server/compile/server_playerSetup.sqf index 5c2481443..b0a79d28d 100644 --- a/dayz_server/compile/server_playerSetup.sqf +++ b/dayz_server/compile/server_playerSetup.sqf @@ -1,11 +1,10 @@ -private["_int","_characterID","_doLoop","_newModel","_wait","_playerID","_playerObj","_randomSpot","_publishTo","_primary","_secondary","_key","_result","_charID","_playerObj","_playerName","_finished","_spawnPos","_spawnDir","_items","_counter","_magazines","_weapons","_group","_backpack","_worldspace","_direction","_newUnit","_score","_position","_pos","_isIsland","_isNew","_inventory","_backpack","_medical","_survival","_stats","_state","_lastinstance"]; -//Set Variables +private ["_characterID","_doLoop","_playerID","_playerObj","_randomSpot","_primary","_key","_worldspace","_score","_position","_pos","_isIsland","_medical","_stats","_state","_dummy","_debug","_distance","_hit","_fractures","_w","_findSpot","_humanity","_clientID","_lastinstance"]; //Wait for HIVE to be free //diag_log ("SETUP: attempted with " + str(_this)); _characterID = _this select 0; _playerObj = _this select 1; -_playerID = _this select 2; +_playerID = getPlayerUID _playerObj; if (isNull _playerObj) exitWith { diag_log ("SETUP INIT FAILED: Exiting, player object null: " + str(_playerObj)); @@ -28,8 +27,7 @@ if ( _playerID != _dummy ) then { //Variables _worldspace = []; -_survival = [0,0,0]; -_tent = []; + _state = []; //Do Connection Attempt @@ -65,7 +63,7 @@ _randomSpot = false; //diag_log ("WORLDSPACE: " + str(_worldspace)); if (count _worldspace > 0) then { - _direction = _worldspace select 0; + _position = _worldspace select 1; if (count _position < 3) then { //prevent debug world! @@ -88,7 +86,6 @@ if (count _worldspace > 0) then { } //_playerObj setPosATL _position; - //_playerObj setDir _direction; } else { _randomSpot = true; }; diff --git a/dayz_server/compile/server_playerSync.sqf b/dayz_server/compile/server_playerSync.sqf index fac8ecb36..2e0e2928f 100644 --- a/dayz_server/compile/server_playerSync.sqf +++ b/dayz_server/compile/server_playerSync.sqf @@ -1,4 +1,4 @@ -private["_characterID","_currentModelCheck","_temp","_isSync","_currentWpn","_currentMag","_magazines","_force","_qty","_qtyT","_val","_isNewPos","_isNewBackp","_humanity","_isNewGear","_doUpdate","_currentModel","_modelChk","_playerPos","_playerGear","_playerBackp","_backpack","_updates","_killsB","_killsH","_medical","_isNewMed","_character","_timeSince","_charPos","_isInVehicle","_justAte","_justDrank","_distanceFoot","_lastPos","_legs","_arms","_kills","_headShots","_killsCHK","_headShotsCHK","_timeGross","_timeLeft","_onLadder","_isTerminal"]; +private ["_characterID","_temp","_currentWpn","_magazines","_force","_isNewPos","_humanity","_isNewGear","_currentModel","_modelChk","_playerPos","_playerGear","_playerBackp","_backpack","_killsB","_killsH","_medical","_isNewMed","_character","_timeSince","_charPos","_isInVehicle","_distanceFoot","_lastPos","_kills","_headShots","_timeGross","_timeLeft","_onLadder","_isTerminal","_currentAnim","_muzzles","_array","_key","_lastTime","_config","_currentState","_pos"]; //[player,array] //diag_log ("UPDATE: " + str(_this) ); @@ -19,7 +19,7 @@ _magazines = _this select 1; _force = _this select 2; _force = true; -_doUpdate = false; + _characterID = _character getVariable ["characterID","0"]; _charPos = getPosATL _character; _isInVehicle = vehicle _character != _character; @@ -45,6 +45,13 @@ if (_characterID == "0") exitWith { diag_log ("ERROR: Cannot Sync Character " + (name _character) + " as no characterID"); }; +private["_debug","_distance"]; +_debug = getMarkerpos "respawn_west"; +_distance = _debug distance _charPos; +if (_distance < 2000) exitWith { + diag_log format["ERROR: server_playerSync: Cannot Sync Player %1 [%2]. Position in debug! %3",name _character,_characterID,_charPos]; +}; + //Check for server initiated updates _isNewMed = _character getVariable["medForceUpdate",false]; //Med Update is forced when a player receives some kind of med incident _isNewPos = _character getVariable["posForceUpdate",false]; //Med Update is forced when a player receives some kind of med incident @@ -92,7 +99,6 @@ if (_characterID != "0") then { }; if (_isNewMed or _force) then { //diag_log ("medical..."); sleep 0.05; - _wounds = []; if (!(_character getVariable["USEC_isDead",false])) then { //diag_log ("medical check..."); sleep 0.05; _medical = _character call player_sumMedical; diff --git a/dayz_server/compile/server_publishObject.sqf b/dayz_server/compile/server_publishObject.sqf index 1eefe7a6d..03428a22a 100644 --- a/dayz_server/compile/server_publishObject.sqf +++ b/dayz_server/compile/server_publishObject.sqf @@ -1,18 +1,16 @@ -private["_type","_location","_dir","_character","_tent","_class","_id","_uid"]; +private ["_class","_uid","_charID","_object","_worldspace","_key"]; //[dayz_characterID,_tent,[_dir,_location],"TentStorage"] _charID = _this select 0; _object = _this select 1; _worldspace = _this select 2; _class = _this select 3; -_id = 0; + if (!(_object isKindOf "Building")) exitWith { deleteVehicle _object; }; //diag_log ("PUBLISH: Attempt " + str(_object)); -_dir = _worldspace select 0; -_location = _worldspace select 1; //get UID _uid = _worldspace call dayz_objectUID2; diff --git a/dayz_server/compile/server_publishVehicle.sqf b/dayz_server/compile/server_publishVehicle.sqf index b9c03705b..4e0f466d2 100644 --- a/dayz_server/compile/server_publishVehicle.sqf +++ b/dayz_server/compile/server_publishVehicle.sqf @@ -1,11 +1,12 @@ -private["_object","_worldspace","_location","_dir","_character","_tent","_class","_id","_uid","_dam","_hitpoints","_selection","_array","_damage","_randFuel","_fuel","_key","_result","_outcome","_totaldam","_parts","_retry","_done"]; -//[_veh,[_dir,_location],"V3S_Civ"] +private["_object","_worldspace","_location","_dir","_character","_tent","_class","_id","_uid","_dam","_hitpoints","_selection","_array","_damage","_randFuel","_fuel","_key","_result","_outcome","_totaldam","_parts","_retry","_done","_spawnDMG"]; +//[_veh,[_dir,_location],"V3S_Civ",true] _object = _this select 0; _worldspace = _this select 1; _class = _this select 2; -_uid = _this select 3; +_spawnDMG = _this select 3; +_characterID = _this select 4; -_fuel = 0; +_fuel = 1; _damage = 0; _array = []; @@ -17,64 +18,65 @@ _location = _worldspace select 1; _uid = _worldspace call dayz_objectUID2; // _uid = format["%1%2",dayZ_instance,_uid]; -if (getNumber(configFile >> "CfgVehicles" >> _class >> "isBicycle") != 1) then { +if (_spawnDMG) then { + _fuel = 0; + if (getNumber(configFile >> "CfgVehicles" >> _class >> "isBicycle") != 1) then { - // Create randomly damaged parts + // Create randomly damaged parts - _totaldam = 0; - _hitpoints = _object call vehicle_getHitpoints; - { - _dam = 0; - if(["Body",_x,false] call fnc_inString) then { - _dam = call generate_new_damage; - }; - if(["Engine",_x,false] call fnc_inString) then { - _dam = call generate_exp_damage; - }; - if(["HRotor",_x,false] call fnc_inString) then { - _dam = call generate_new_damage; - }; - if(["Fuel",_x,false] call fnc_inString) then { - _dam = call generate_exp_damage; - }; - if(["Wheel",_x,false] call fnc_inString) then { - _dam = call generate_new_damage; - }; - if(["Glass",_x,false] call fnc_inString) then { - _dam = call generate_new_damage; - }; + _totaldam = 0; + _hitpoints = _object call vehicle_getHitpoints; + { + _dam = 0; + if(["Body",_x,false] call fnc_inString) then { + _dam = call generate_new_damage; + }; + if(["Engine",_x,false] call fnc_inString) then { + _dam = call generate_exp_damage; + }; + if(["HRotor",_x,false] call fnc_inString) then { + _dam = call generate_new_damage; + }; + if(["Fuel",_x,false] call fnc_inString) then { + _dam = call generate_exp_damage; + }; + if(["Wheel",_x,false] call fnc_inString) then { + _dam = call generate_new_damage; + }; + if(["Glass",_x,false] call fnc_inString) then { + _dam = call generate_new_damage; + }; - _selection = getText(configFile >> "cfgVehicles" >> _class >> "HitPoints" >> _x >> "name"); + _selection = getText(configFile >> "cfgVehicles" >> _class >> "HitPoints" >> _x >> "name"); - if (_dam > 0) then { - _array set [count _array,[_selection,_dam]]; - _totaldam = _totaldam + _dam; + if (_dam > 0) then { + _array set [count _array,[_selection,_dam]]; + _totaldam = _totaldam + _dam; + }; + } forEach _hitpoints; + + + // just set low base dmg - may change later + _damage = 0; + + // 50% chance that vehicle will have a little gas + _randFuel = random(1); + if(_randFuel > 0.5) then { + _fuel = random(0.5); }; - } forEach _hitpoints; - - // just set low base dmg - may change later - _damage = 0; - - // 50% chance that vehicle will have a little gas - _randFuel = random(1); - if(_randFuel > 0.5) then { - _fuel = random(0.5); }; - }; //Send request -_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, _damage , 0, _worldspace, [], _array, _fuel,_uid]; // Change this to dynamic parts damage and fuel +_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:",dayZ_instance, _class, _damage , _characterID, _worldspace, [], _array, _fuel,_uid]; // Change this to dynamic parts damage and fuel diag_log ("HIVE: WRITE: "+ str(_key)); _key call server_hiveWrite; -// Wait just a little -sleep 0.1; - _done = false; _retry = 0; -while{not _done} do { +// TODO: Needs major overhaul +while {_retry < 99} do { // GET DB ID _key = format["CHILD:388:%1:",_uid]; @@ -86,16 +88,17 @@ while{not _done} do { _object setVariable ["ObjectID", _oid, true]; diag_log("CUSTOM: Selected " + str(_oid)); _done = true; + _retry = 100; } else { diag_log("CUSTOM: trying again to get id for: " + str(_uid)); _done = false; _retry = _retry + 1; - sleep 0.1; }; - if(_retry == 5) exitWith { deleteVehicle _object; diag_log("CUSTOM: failed to get id for : " + str(_uid)); }; }; +if(!_done) exitWith { deleteVehicle _object; diag_log("CUSTOM: failed to get id for : " + str(_uid)); }; + // disable marker later //_marker = createMarker [str(_location) , _location]; //_marker setMarkerShape "ICON"; @@ -107,7 +110,7 @@ while{not _done} do { // _object setVariable ["ObjectUID", _uid, true]; _object setVariable ["lastUpdate",time]; -_object setVariable ["CharacterID", "0", true]; +_object setVariable ["CharacterID", _characterID, true]; _object setDamage _damage; diff --git a/dayz_server/compile/server_traders.sqf b/dayz_server/compile/server_traders.sqf index 7be92ec64..dc0a100a1 100644 --- a/dayz_server/compile/server_traders.sqf +++ b/dayz_server/compile/server_traders.sqf @@ -21,7 +21,7 @@ _myArray = []; if (_status == "ObjectStreamStart") then { _val = _result select 1; //Stream Objects - diag_log ("HIVE: Commence Object Streaming..."); + diag_log ("HIVE: Commence Menu Streaming..."); for "_i" from 1 to _val do { _data = "HiveEXT" callExtension _key; _result = call compile format ["%1",_data]; diff --git a/dayz_server/compile/server_updateNearbyObjects.sqf b/dayz_server/compile/server_updateNearbyObjects.sqf index d8c77c6c4..3cac4bef4 100644 --- a/dayz_server/compile/server_updateNearbyObjects.sqf +++ b/dayz_server/compile/server_updateNearbyObjects.sqf @@ -1,4 +1,4 @@ -private["_pos","_objects"]; +private["_pos"]; _pos = _this select 0; { diff --git a/dayz_server/init/server_functions.sqf b/dayz_server/init/server_functions.sqf index 99d82b4ca..39e67ed02 100644 --- a/dayz_server/init/server_functions.sqf +++ b/dayz_server/init/server_functions.sqf @@ -150,71 +150,19 @@ BuildingList = MarkerPosition nearObjects ["House",DynamicVehicleArea]; spawn_vehicles = { private["_vehicle","_isAir","_isShip","_position","_roadlist","_buildinglist","_istoomany","_marker","_veh","_objPosition","_weights","_index","_uid"]; - // TODO: change this part either to DB or mission config. - - // 1 : Motocycles - // 2 : Bicycles, ATV's - // 3 : Trucks Unarmed - // 4 : Trucks - // 5 : Cars - // 6 : Jeeps - // 7 : Bus, Tractor, SUV, Vans - // 8 : Helicopters - // 9 : Helicopters Unarmed - // 10: Military Unarmed - // 11: Military - // 12: Boat Unarmed - // 13: Boat - // 14: Heavy Armor Unarmed - // 15: Fuel Trucks - - _AllowedVehiclesList = ["M1030_US_DES_EP1","TT650_TK_CIV_EP1","Old_moto_TK_Civ_EP1","TT650_Civ","TT650_Ins", - "MMT_Civ","Old_bike_TK_INS_EP1","ATV_US_EP1","BAF_ATV_D","ATV_CZ_EP1", - "hilux1_civil_3_open_EP1","hilux1_civil_2_covered","hilux1_civil_1_open","datsun1_civil_3_open","datsun1_civil_2_covered","datsun1_civil_1_open", - "Pickup_PK_TK_GUE_EP1","Offroad_DSHKM_TK_GUE_EP1","Offroad_SPG9_TK_GUE_EP1","Pickup_PK_GUE","Pickup_PK_INS", - "policecar","Octavia_ACR","Lada1","Lada2","LadaLM","Skoda","SkodaBlue","SkodaGreen","SkodaRed","VWGolf","car_hatchback","car_sedan","Lada1_TK_CIV_EP1","Lada2_TK_CIV_EP1","VolhaLimo_TK_CIV_EP1","Volha_1_TK_CIV_EP1","Volha_2_TK_CIV_EP1", - "UAZ_CDF","UAZ_INS","UAZ_RU","UAZ_Unarmed_TK_CIV_EP1","UAZ_Unarmed_TK_EP1","UAZ_Unarmed_UN_EP1", - "Ikarus","Ikarus_TK_CIV_EP1","tractor","TowingTractor","SUV_TK_CIV_EP1","S1203_TK_CIV_EP1","S1203_ambulance_EP1", - "UH1H_DZ","UH1H_TK_EP1","CH_47F_EP1","Mi17_TK_EP1","Mi17_UN_CDF_EP1","Mi171Sh_CZ_EP1","UH60M_EP1","Mi17_CDF","MH60S","UH1Y", - "Mi17_Civilian","MH6J_EP1","UH60M_MEV_EP1","MV22", - "LandRover_ACR","LandRover_CZ_EP1","LandRover_TK_CIV_EP1","HMMWV","HMMWV_DES_EP1","HMMWV_M1035_DES_EP1","HMMWV_Ambulance","HMMWV_Ambulance_CZ_DES_EP1","GAZ_Vodnik_MedEvac","Ural_TK_CIV_EP1","Ural_UN_EP1","V3S_Open_TK_CIV_EP1","V3S_Open_TK_EP1","MTVR_DES_EP1","Kamaz", - "HMMWV_M998A2_SOV_DES_EP1","HMMWV_M1151_M2_CZ_DES_EP1","LandRover_Special_CZ_EP1","LandRover_MG_TK_EP1","ArmoredSUV_PMC", - "Fishing_Boat","PBX","PBX_ACR","Smallboat_1","Smallboat_2","Zodiac", - "RHIB","RHIB2Turret", - "M113Ambul_UN_EP1","M113Ambul_TK_EP1","BMP2_Ambul_CDF","BMP2_Ambul_INS", - "KamazRefuel","MtvrRefuel_DES_EP1","UralRefuel_TK_EP1","V3S_Refuel_TK_GUE_EP1","T810Refuel_Des_ACR","T810Refuel_ACR"]; - - - _AllowedVehiclesChance = [0.55,0.65,0.25,0.35,0.45, - 0.25,0.75,0.45,0.45,0.45, - 0.40,0.35,0.35,0.25,0.20,0.25, - 0.25,0.75,0.45,0.45,0.45, - 0.2,0.25,0.45,0.45,0.45,0.45,0.45,0.45,0.45,0.35,0.40,0.40,0.40,0.25,0.45,0.45,0.45, - 0.30,0.30,0.30,0.30,0.30,0.30, - 0.15,0.15,0.15,0.05,0.05,0.30,0.15, - 0.05,0.05,0.01,0.025,0.025,0.025,0.025,0.02,0.02,0.02, - 0.09,0.08,0.07,0.01, - 0.11,0.11,0.11,0.10,0.10,0.10,0.05,0.05,0.05,0.05,0.10,0.10,0.10,0.10,0.10, - 0.05,0.05,0.01,0.05,0.01, - 0.15,0.15,0.15,0.15,0.15,0.15, - 0.01,0.01, - 0.001,0.001,0.001,0.001, - 0.001,0.001,0.001,0.001,0.001,0.001]; - - if (isDedicated) then { waituntil {!isnil "fnc_buildWeightedArray"}; _weights = []; - _weights = [_AllowedVehiclesList,_AllowedVehiclesChance] call fnc_buildWeightedArray; + _weights = [AllowedVehiclesList,AllowedVehiclesChance] call fnc_buildWeightedArray; waitUntil{!isNil "BIS_fnc_selectRandom"}; // get index from fnc_buildWeightedArray _index = _weights call BIS_fnc_selectRandom; // select vehicle - _vehicle = _AllowedVehiclesList select _index; + _vehicle = AllowedVehiclesList select _index; // Find Vehicle Type to better control spawns _isAir = _vehicle isKindOf "Air"; @@ -287,7 +235,7 @@ spawn_vehicles = { clearWeaponCargoGlobal _veh; clearMagazineCargoGlobal _veh; - [_veh,[_dir,_objPosition],_vehicle,_uid] call server_publishVeh; + [_veh,[_dir,_objPosition],_vehicle,true,"0"] call server_publishVeh; }; }; };