1.0.1.7 DEV TEST

+ [CHANGED] Can now fill empty fuel barrels on standard fuel tanks.
+ [CHANGED] Increased range of crafting from 2m to 3m
+ [FIXED] Removed repair action from tow truck with VIL_asistvan_DZE
+ [ADDED] Tow truck VIL_asistvan_DZE can tow vehicles that fit within
the bounding box of the model.
+ [ADDED] Ability for fuel trucks to fill nearby vehicles 30m when
engine is running.
+ [CHANGED] Reworked Epoch events scheduler and made it more accurate.
+ [REMOVED] Road debris no longer spawn loot, helps with performance and
we have added extra loot positions in the world.
+ and more
This commit is contained in:
[VB]AWOL
2013-08-05 11:09:26 -05:00
parent 9b1a3b3927
commit 9e5957b89d
40 changed files with 641 additions and 599 deletions

View File

@@ -14,17 +14,10 @@ class Flare : GrenadeLauncher {
"FoodCanDemonEmpty",
"FoodCanFraggleosEmpty",
"FoodCanHerpyEmpty",
"FoodCanDerpyEmpty",
"FoodCanOrlokEmpty",
"FoodCanPowellEmpty",
"FoodCanTylersEmpty",
"FoodCanUnlabeledEmpty",
"FoodCanRusUnlabeledEmpty",
"FoodCanRusPorkEmpty",
"FoodCanRusPeasEmpty",
"FoodCanRusMilkEmpty",
"FoodCanRusCornEmpty",
"FoodCanRusStewEmpty",
"ItemSodaCokeEmpty",
"ItemSodaPepsiEmpty",
"ItemSodaMdewEmpty",

View File

@@ -1,10 +1,10 @@
class ItemCrowbar: ItemCore
{
scope=2;
displayName=$STR_EQUIP_NAME_CROWBAR;
displayName="Crowbar";
model="\dayz_equip\models\crowbar.p3d";
picture="\z\addons\dayz_communityassets\pictures\equip_crowbar_CA.paa";
descriptionShort=$STR_EQUIP_DESC_CROWBAR;
descriptionShort="A tool consisting of a metal bar with a single curved end and flattened points, often with a small fissure on one or both ends for removing nails.";
class ItemActions
{
class Toolbelt

View File

@@ -1,10 +1,21 @@
class ItemHatchet : ItemCore {
displayName = $STR_EQUIP_NAME_HATCHET;
descriptionShort = $STR_EQUIP_DESC_HATCHET;
displayName="$STR_EQUIP_NAME_41";
descriptionShort="$STR_EQUIP_DESC_41";
class ItemActions {
class Toolbelt {
text = $STR_ACTIONS_RFROMTB;
class Toolbelt
{
text="Remove from Toolbelt";
script="spawn player_addToolbelt;";
use[]=
{
"ItemHatchet"
};
output[]=
{
"MeleeHatchet"
};
};
};
};

View File

@@ -1,15 +1,15 @@
class ItemMachete: ItemCore
{
scope=2;
displayName="$STR_EQUIP_NAME_MACHETE";
displayName="Machete";
model="\z\addons\dayz_communityassets\models\machete.p3d";
picture="\z\addons\dayz_communityassets\pictures\equip_machete_CA.paa";
descriptionShort="$STR_EQUIP_DESC_MACHETE";
descriptionShort="An agricultural tool turned into a weapon, the Machete may be less versatile than the common hatchet, but it packs a punch.";
class ItemActions
{
class Toolbelt
{
text=$STR_ACTIONS_RFROMTB;
text="Remove from Toolbelt";
script="spawn player_addToolbelt;";
use[]=
{

View File

@@ -6,7 +6,7 @@ class MeleeCrowbar: MeleeWeapon
magazineReloadTime=0;
model="\dayz_weapons\models\crowbar_weaponized";
picture="\dayz_weapons\textures\equip_crowbar_CA.paa";
displayName=$STR_EQUIP_NAME_CROWBAR;
displayName="Crowbar";
droppeditem= "ItemCrowbar";
magazines[]=
{
@@ -21,7 +21,7 @@ class MeleeCrowbar: MeleeWeapon
{
class Toolbelt
{
text=$STR_ACTIONS_2TB;
text="Add to Toolbelt";
script="spawn player_addToolbelt;";
use[]=
{
@@ -32,20 +32,10 @@ class MeleeCrowbar: MeleeWeapon
"ItemCrowbar"
};
};
class Drop
{
text=$STR_ACTIONS_DROP;
script="spawn player_dropWeapon;";
use[]=
{
"Crowbar_Swing"
};
};
};
class Library
{
libTextDesc=$STR_EQUIP_DESC_CROWBAR;
libTextDesc="A tool consisting of a metal bar with a single curved end and flattened points, often with a small fissure on one or both ends for removing nails.";
};
descriptionShort=$STR_EQUIP_DESC_CROWBAR;
descriptionShort="A tool consisting of a metal bar with a single curved end and flattened points, often with a small fissure on one or both ends for removing nails.";
};

View File

@@ -15,7 +15,7 @@ class MeleeFishingPole: MeleeWeapon
class Use
{
text="Cast Fishing Pole";
script="spawn DZE_player_goFishing;";
script="spawn player_goFishing;";
};
class Toolbelt
{

View File

@@ -6,7 +6,7 @@ class MeleeHatchet: MeleeWeapon
magazineReloadTime=0;
model="\dayz_weapons\models\Hatchet_weaponized";
picture="\dayz_equip\textures\equip_hatchet_CA.paa";
displayName=$STR_EQUIP_NAME_HATCHET;
displayName="$STR_EQUIP_NAME_41";
droppeditem= "ItemHatchet";
magazines[]=
{
@@ -26,7 +26,7 @@ class MeleeHatchet: MeleeWeapon
};
class Toolbelt
{
text=$STR_ACTIONS_2TB;
text="Add to Toolbelt";
script="spawn player_addToolbelt;";
use[]=
{
@@ -37,21 +37,10 @@ class MeleeHatchet: MeleeWeapon
"ItemHatchet"
};
};
class Drop
{
text=$STR_ACTIONS_DROP;
script="spawn player_dropWeapon;";
use[]=
{
"Hatchet_Swing"
};
};
};
class Library
{
libTextDesc=$STR_EQUIP_DESC_HATCHET;
libTextDesc="$STR_EQUIP_DESC_41";
};
descriptionShort=$STR_EQUIP_DESC_HATCHET;
descriptionShort="$STR_EQUIP_DESC_41";
};

View File

@@ -6,7 +6,7 @@ class MeleeMachete: MeleeWeapon
magazineReloadTime=0;
model="\z\addons\dayz_communityassets\models\machete_weaponized.p3d";
picture="\z\addons\dayz_communityassets\pictures\equip_machete_CA.paa";
displayName="$STR_EQUIP_NAME_MACHETE";
displayName="Machete";
droppeditem= "MeleeMachete";
magazines[]=
{
@@ -19,21 +19,23 @@ class MeleeMachete: MeleeWeapon
};
class ItemActions
{
/*
class Drop
class Toolbelt
{
text=$STR_ACTIONS_DROP;
script="spawn player_dropWeapon;";
text="Add to Toolbelt";
script="spawn player_addToolbelt;";
use[]=
{
"Machete_Swing"
"MeleeMachete"
};
output[]=
{
"ItemMachete"
};
};
*/
};
class Library
{
libTextDesc="$STR_EQUIP_DESC_MACHETE";
libTextDesc="";
};
descriptionShort="$STR_EQUIP_DESC_MACHETE";
descriptionShort="An agricultural tool turned into a weapon, the Machete may be less versatile than the common hatchet, but it packs a punch.";
};

View File

@@ -24,6 +24,13 @@ class CfgVehicles {
};
};
};
class VIL_asistvan;
class VIL_asistvan_DZE: VIL_asistvan
{
transportrepair = 0;
};
class Mi17_base: Helicopter
{

View File

@@ -149,7 +149,7 @@ class RscDisplayMain : RscStandardDisplay
class DAYZ_Version : CA_Version
{
idc = -1;
text = "DayZ Epoch 1.0.1.6";
text = "DayZ Epoch 1.0.1.7";
y = "(SafeZoneH + SafeZoneY) - (1 - 0.95)";
};
delete CA_TitleMainMenu;

View File

@@ -3,11 +3,25 @@ private ["_vehicle","_curFuel","_newFuel","_started","_finished","_animState","_
if(TradeInprogress) exitWith { cutText ["Refuel already in progress." , "PLAIN DOWN"] };
TradeInprogress = true;
// Get all nearby vehicles within 10m
_findNearestVehicles = nearestObjects [player, ["AllVehicles"], 10];
_isVehicle = false;
_vehicleSrc = _this select 0;
if(_vehicleSrc != objNull) then {
_isVehicle = ((_vehicleSrc isKindOf "AllVehicles") and !(_vehicleSrc isKindOf "Man"));
// If fuel source is vehicle get actual capacity
_configSrcVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicleSrc);
_capacitySrc = getNumber(_configVeh >> "fuelCapacity");
_nameTextSrc = getText(_configVeh >> "displayName");
};
// Get all nearby vehicles within 30m
_findNearestVehicles = nearestObjects [player, ["AllVehicles"], 30];
_findNearestVehicle = [];
{
if (alive _x and !(_x isKindOf "Man")) then {
if (alive _x and _vehicleSrc != _x and !(_x isKindOf "Man")) then {
_findNearestVehicle set [(count _findNearestVehicle),_x];
};
} foreach _findNearestVehicles;
@@ -24,7 +38,6 @@ if(_IsNearVehicle >= 1) then {
_capacity = getNumber(_configVeh >> "fuelCapacity");
_nameText = getText(_configVeh >> "displayName");
_isOk = true;
// perform fuel up
while {_isOk} do {
@@ -76,25 +89,44 @@ if(_IsNearVehicle >= 1) then {
if (_finished) then {
// Get vehicle fuel levels again
_curFuel = ((fuel _vehicle) * _capacity);
_newFuel = (_curFuel + _canSize);
_isFillok = true;
if (_newFuel > _capacity) then {_newFuel = _capacity; _abort = true; };
// add checks for fuel level
if(_isVehicle) then {
_curFuelSrc = ((fuel _vehicleSrc) * _capacitySrc);
_newFuelSrc = (_curFuelSrc - _canSize);
// calculate minimum needed fuel
_newFuel = (_newFuel / _capacity);
dayzSetFuel = [_vehicle,_newFuel];
if (local _vehicle) then {
dayzSetFuel spawn local_setFuel;
// calculate new fuel
_newFuelSrc = (_newFuelSrc / _capacitySrc);
if (_newFuelSrc > 0) then {
dayzSetFuel = [_vehicleSrc,_newFuelSrc];
dayzSetFuel spawn local_setFuel;
publicVariable "dayzSetFuel";
} else {
_isFillok = false;
_abort = true;
};
};
publicVariable "dayzSetFuel";
if (_isFillok) then {
// Get vehicle fuel levels again
_curFuel = ((fuel _vehicle) * _capacity);
_newFuel = (_curFuel + _canSize);
// Play sound
[player,"refuel",0,false] call dayz_zombieSpeak;
if (_newFuel > _capacity) then {_newFuel = _capacity; _abort = true; };
cutText [format["%1 filled to %2 percent capacity.",_nameText,round(_newFuel*100)], "PLAIN DOWN"];
// calculate minimum needed fuel
_newFuel = (_newFuel / _capacity);
dayzSetFuel = [_vehicle,_newFuel];
dayzSetFuel spawn local_setFuel;
publicVariable "dayzSetFuel";
// Play sound
[player,"refuel",0,false] call dayz_zombieSpeak;
cutText [format["%1 filled to %2 percent capacity.",_nameText,round(_newFuel*100)], "PLAIN DOWN"];
};
};
if(_abort) exitWith {};

View File

@@ -9,18 +9,23 @@ s_player_fillfuel = 1;
_fillCounter = 0;
_abort = false;
_qty = {_x == "ItemJerrycanEmpty"} count magazines player;
_fuelCans = [];
for "_x" from 1 to _qty do {
{
if(_x == "ItemJerrycanEmpty" or _x == "ItemFuelBarrelEmpty") then {
_fuelCans set [(count _fuelCans),_x];
};
} forEach magazines player;
_qty = count _fuelCans;
{
_displayName = getText (configFile >> "cfgMagazines" >> _x >> "displayName");
_fillCounter = _fillCounter + 1;
if(_qty == 1) then {
cutText ["Preparing to siphon, stand still to fill empty jerry can.", "PLAIN DOWN"];
} else {
cutText [format[("Preparing to siphon, stand still to fill empty jerry can %1 of %2."),_fillCounter,_qty] , "PLAIN DOWN"];
};
cutText [format["Preparing to siphon, stand still to fill %1.",_displayName], "PLAIN DOWN"];
// force animation
player playActionNow "Medic";
// Play sound and alert zombies
@@ -64,22 +69,22 @@ for "_x" from 1 to _qty do {
};
if (_finished) then {
if ("ItemJerrycanEmpty" in magazines player) then {
player removeMagazine "ItemJerrycanEmpty";
player addMagazine "ItemJerrycan";
cutText [format[(localize "str_player_09"),1], "PLAIN DOWN"];
if(([player,_x] call BIS_fnc_invRemove) == 1) then {
if (_x == "ItemFuelBarrelEmpty") then {
player addMagazine "ItemFuelBarrel";
} else {
player addMagazine "ItemJerrycan";
};
cutText [format["You have filled %1 with fuel.",_displayName], "PLAIN DOWN"];
} else {
cutText [(localize "str_player_10") , "PLAIN DOWN"];
_abort = true;
};
};
sleep 1;
if(_abort) exitWith {};
};
} forEach _fuelCans;
s_player_fillfuel = -1;
TradeInprogress = false;

View File

@@ -2,7 +2,7 @@
DayZ Base Building
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
*/
private ["_location","_dir","_classname","_item","_hasrequireditem","_missing","_hastoolweapon","_cancel","_reason","_isBuilding","_started","_finished","_animState","_isMedic","_dis","_sfx","_hasbuilditem","_tmpbuilt","_buildings","_onLadder","_isWater","_require","_text","_offset","_IsNearPlot","_isOk","_location1","_location2","_counter","_limit","_proceed","_num_removed","_position","_object","_canBuildOnPlot","_friendlies","_nearestPole","_ownerID","_findNearestPoles","_findNearestPole"];
private ["_location","_dir","_classname","_item","_hasrequireditem","_missing","_hastoolweapon","_cancel","_reason","_started","_finished","_animState","_isMedic","_dis","_sfx","_hasbuilditem","_tmpbuilt","_onLadder","_isWater","_require","_text","_offset","_IsNearPlot","_isOk","_location1","_location2","_counter","_limit","_proceed","_num_removed","_position","_object","_canBuildOnPlot","_friendlies","_nearestPole","_ownerID","_findNearestPoles","_findNearestPole","_distance","_classnametmp","_ghost","_isPole","_needText"];
if(TradeInprogress) exitWith { cutText ["Building already in progress." , "PLAIN DOWN"]; };
TradeInprogress = true;
@@ -12,6 +12,9 @@ _isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming;
_cancel = false;
_reason = "";
_canBuildOnPlot = false;
DZE_BuildingZ = 0;
DZE_5 = false;
call gear_ui_init;
@@ -21,6 +24,7 @@ if(player getVariable["combattimeout", 0] >= time) exitWith {TradeInprogress = f
_item = _this;
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
_classnametmp = _classname;
_require = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Build" >> "require");
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
@@ -35,7 +39,6 @@ if(_isPole) then {
_distance = 45;
};
// check for near plot
_findNearestPoles = nearestObjects [(vehicle player), ["Plastic_Pole_EP1_DZ"], _distance];
_findNearestPole = [];
@@ -54,35 +57,24 @@ if(_isPole and _IsNearPlot > 0) exitWith { TradeInprogress = false; cutText ["C
if(_IsNearPlot == 0) then {
_canBuildOnPlot = true;
} else {
// Since there are plots nearby we check for ownership and then for friend status
// check nearby plots ownership and then for friend status
_nearestPole = _findNearestPole select 0;
if("Plastic_Pole_EP1_DZ" in _needNearby) then {
_nearestPole = _findNearestPole select 0;
// Find owner
_ownerID = _nearestPole getVariable["CharacterID","0"];
// Find owner
_ownerID = _nearestPole getVariable["CharacterID","0"];
// diag_log format["DEBUG BUILDING: %1 = %2", dayz_characterID, _ownerID];
// diag_log format["DEBUG BUILDING: %1 = %2", dayz_characterID, _ownerID];
// check if friendly to owner
if(dayz_characterID == _ownerID) then {
// owner can build anything within his plot except other plots
if(!_isPole) then {
_canBuildOnPlot = true;
};
} else {
// disallow building plot
if(!_isPole) then {
_friendlies = player getVariable ["friendlyTo",[]];
// check if friendly to owner
if(_ownerID in _friendlies) then {
_canBuildOnPlot = true;
};
};
};
// check if friendly to owner
if(dayz_characterID == _ownerID) then {
_canBuildOnPlot = true;
} else {
_canBuildOnPlot = true;
_friendlies = player getVariable ["friendlyTo",[]];
// check if friendly to owner
if(_ownerID in _friendlies) then {
_canBuildOnPlot = true;
};
};
};
@@ -103,75 +95,118 @@ if (!_hasrequireditem) exitWith {TradeInprogress = false; cutText [format["Missi
if (_hasrequireditem) then {
_location = [0,0,0];
_dir = getDir player;
player allowDamage false;
_position = player modeltoworld _offset;
_position = [(_position select 0),(_position select 1), 0];
if(isText (configFile >> "CfgVehicles" >> _classname >> "GhostPreview")) then {
_ghost = getText(configFile >> "CfgVehicles" >> _classname >> "GhostPreview");
};
// if ghost preview available use that instead
if(_ghost != "") then {
_classnametmp = _classname;
_classname = _ghost;
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
_classname = _classnametmp;
} else {
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
};
_object setDir _dir;
_object setPos _position;
_object allowDamage false;
_object attachTo [player];
_counter = 0;
_isOk = true;
while {_isOk} do {
if (player getVariable["combattimeout", 0] >= time) exitWith {
_isOk = false;
_cancel = true;
_reason = "Cannot build while in combat.";
if(_counter == 0) then {
// get inital players position
_location1 = getPosATL player;
_dir = getDir player;
_position = player modeltoworld _offset;
_position = [(_position select 0),(_position select 1), (_position select 2)];
hintSilent str (_position);
// if ghost preview available use that instead
_ghost = getText (configFile >> "CfgVehicles" >> _classname >> "ghostpreview");
if (_ghost == "") then {
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
} else {
_classname = _ghost;
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
};
_object setDir _dir;
_object setPos _position;
_object attachTo [player];
};
cutText ["Planning construction stand still 5 seconds to build.", "PLAIN DOWN"];
_zheightchanged = false;
if (DZE_Q) then {
DZE_Q = false;
DZE_BuildingZ = DZE_BuildingZ + 0.1;
_zheightchanged = true;
};
if (DZE_Z) then {
DZE_Z = false;
DZE_BuildingZ = DZE_BuildingZ - 0.1;
_zheightchanged = true;
};
_location1 = getPosATL player;
sleep 5;
if(_zheightchanged) then {
detach _object;
deleteVehicle _object;
_dir = getDir player;
_position = player modeltoworld _offset;
_position = [(_position select 0),(_position select 1), (_position select 2)+DZE_BuildingZ];
hintSilent str (_position);
// if ghost preview available use that instead
_ghost = getText (configFile >> "CfgVehicles" >> _classname >> "ghostpreview");
if (_ghost == "") then {
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
} else {
_classname = _ghost;
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
};
_object setDir _dir;
_object setPos _position;
_object attachTo [player];
};
cutText ["Planning construction numpad 8 = up, numpad 2 = down, and numpad 5 to start building.", "PLAIN DOWN"];
_location0 = getPosATL player;
sleep 1;
_location2 = getPosATL player;
if(_location1 distance _location2 < 0.1) exitWith {
if(DZE_5) exitWith {
_isOk = false;
detach _object;
deleteVehicle _object;
};
if(_location1 distance _location2 > 5) exitWith {
_isOk = false;
_cancel = true;
_reason = "Moving to fast.";
detach _object;
deleteVehicle _object;
};
if(_counter >= 3) exitWith {
if(_counter >= 45) exitWith {
_isOk = false;
_cancel = true;
_reason = "Ran out of time to find position.";
detach _object;
deleteVehicle _object;
};
_counter = _counter + 1;
if (player getVariable["combattimeout", 0] >= time) exitWith {
_isOk = false;
_cancel = true;
_reason = "Cannot build while in combat.";
detach _object;
deleteVehicle _object;
};
};
detach _object;
deleteVehicle _object;
_classname = _classnametmp;
// Start Build
@@ -182,31 +217,19 @@ if (_hasrequireditem) then {
// Get position based on player
_location = player modeltoworld _offset;
_location = [(_location select 0),(_location select 1),(_position select 2)];
hintSilent str (_location);
_tmpbuilt setpos _location;
// No building on roads
if (isOnRoad _location) then { _cancel = true; _reason = "Cannot build on a road."; };
// set building with ground
_location = [(_location select 0),(_location select 1), 0];
_tmpbuilt setpos _location;
// set building with offset
// _tmpbuilt setpos _location;
player allowDamage true;
// testing new way of finding building
_buildings = nearestObjects [(vehicle player), ["Building"], 100];
{
_isBuilding = [(vehicle player),_x] call fnc_isInsideBuilding;
if(_isBuilding) exitWith {
_cancel = true;
_reason = "Cannot build inside another building.";
};
} forEach _buildings;
// No building in trader zones
if(!canbuild) then { _cancel = true; _reason = "Cannot build in a city."; };
if(!placevault) then { _cancel = true; _reason = "Cannot build in a city."; };
if(!_cancel) then {

View File

@@ -11,7 +11,7 @@ TradeInprogress = true;
// temp array of removed parts
_temp_removed_array = [];
_abort = false;
_distance = 2;
_distance = 3;
_reason = "";
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;

View File

@@ -11,7 +11,7 @@ TradeInprogress = true;
// temp array of removed parts
_temp_removed_array = [];
_abort = false;
_distance = 2;
_distance = 3;
_reason = "";
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;

View File

@@ -11,7 +11,7 @@ TradeInprogress = true;
// temp array of removed parts
_temp_removed_array = [];
_abort = false;
_distance = 2;
_distance = 3;
_reason = "";
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;

View File

@@ -11,7 +11,7 @@ TradeInprogress = true;
// temp array of removed parts
_temp_removed_array = [];
_abort = false;
_distance = 2;
_distance = 3;
_reason = "";
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;

View File

@@ -11,7 +11,7 @@ TradeInprogress = true;
// temp array of removed parts
_temp_removed_array = [];
_abort = false;
_distance = 2;
_distance = 3;
_reason = "";
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;

View File

@@ -0,0 +1,87 @@
private ["_vehicle","_curFuel","_newFuel","_started","_finished","_animState","_isMedic","_abort","_canSize","_configVeh","_capacity","_nameText","_isOk","_findNearestVehicles","_findNearestVehicle","_IsNearVehicle"];
if(TradeInprogress) exitWith { cutText ["Already in progress." , "PLAIN DOWN"] };
TradeInprogress = true;
// Tow Truck
_towTruck = _this;
// Get all nearby vehicles within 10m
_findNearestVehicles = nearestObjects [_towTruck, ["Car"], 10];
_findNearestVehicle = [];
{
if (alive _x and _towTruck != _x) then {
// within brounding box
if([_x,_towTruck] call fnc_isInsideBuilding2) then {
_findNearestVehicle set [(count _findNearestVehicle),_x];
};
};
} foreach _findNearestVehicles;
_IsNearVehicle = count (_findNearestVehicle);
if(_IsNearVehicle >= 1) then {
// select the nearest one
_vehicle = _findNearestVehicle select 0;
// Static vehicle fuel information
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
_nameText = getText(_configVeh >> "displayName");
// alert zombies
[player,20,true,(getPosATL player)] spawn player_alertZombies;
_finished = false;
// force animation
player playActionNow "Medic";
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
if(!_finished) then {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
_abort = true;
};
if (_finished) then {
if(typeOf _towTruck == "VIL_asistvan_DZE" ) then {
_vehicle attachTo [_towTruck];
_towTruck setVariable ["DZEinTow", true, true];
_towTruck setVariable ["DZEvehicleInTow", _vehicle, true];
cutText [format["%1 has been attached to Tow Truck.",_nameText], "PLAIN DOWN"];
};
};
} else {
cutText ["No Vehicles Nearby.", "PLAIN DOWN"];
};
TradeInprogress = false;

View File

@@ -0,0 +1,72 @@
private ["_vehicle","_curFuel","_newFuel","_started","_finished","_animState","_isMedic","_abort","_canSize","_configVeh","_capacity","_nameText","_isOk","_findNearestVehicles","_findNearestVehicle","_IsNearVehicle"];
if(TradeInprogress) exitWith { cutText ["Already in progress." , "PLAIN DOWN"] };
TradeInprogress = true;
// Tow Truck
_towTruck = _this;
// exit if no vehicle is in tow.
_inTow = _towTruck getVariable ["DZEinTow", false]
if(!_inTow) then {
// select the nearest one
_vehicle = _towTruck getVariable ["DZEvehicleInTow", false];
// Static vehicle fuel information
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
_nameText = getText(_configVeh >> "displayName");
// alert zombies
[player,20,true,(getPosATL player)] spawn player_alertZombies;
_finished = false;
// force animation
player playActionNow "Medic";
r_interrupt = false;
_animState = animationState player;
r_doLoop = true;
_started = false;
while {r_doLoop} do {
_animState = animationState player;
_isMedic = ["medic",_animState] call fnc_inString;
if (_isMedic) then {
_started = true;
};
if (_started and !_isMedic) then {
r_doLoop = false;
_finished = true;
};
if (r_interrupt) then {
r_doLoop = false;
};
sleep 0.1;
};
r_doLoop = false;
if(!_finished) then {
r_interrupt = false;
if (vehicle player == player) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
_abort = true;
};
if (_finished) then {
detach _vehicle;
_towTruck setVariable ["DZEinTow", false, true];
_towTruck setVariable ["DZEvehicleInTow", objNull, true];
cutText [format["%1 has been dettached from Tow Truck.",_nameText], "PLAIN DOWN"];
};
} else {
cutText ["No Vehicles In Tow.", "PLAIN DOWN"];
};
TradeInprogress = false;

View File

@@ -112,6 +112,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
};
} forEach boil_tin_cans;
_hasFuelE = "ItemJerrycanEmpty" in _magazinesPlayer;
_hasFuelBarrelE = "ItemFuelBarrelEmpty" in _magazinesPlayer;
_itemsPlayer = items player;
@@ -154,7 +155,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
} forEach _rawmeat;
_isFuel = false;
if (_hasFuelE) then {
if (_hasFuelE or _hasFuelBarrelE) then {
{
if(_cursorTarget isKindOf _x) exitWith {_isFuel = true;};
} forEach dayz_fuelsources;
@@ -271,7 +272,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
};
//Allow player to fill jerrycan
if(_hasFuelE and _isFuel) then {
if((_hasFuelE or _hasFuelBarrelE) and _isFuel) then {
if (s_player_fillfuel < 0) then {
s_player_fillfuel = player addAction [localize "str_actions_self_10", "\z\addons\dayz_code\actions\jerry_fill.sqf",[], 1, false, true, "", ""];
};
@@ -453,7 +454,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
// show that pump needs power if no generator nearby.
if(_IsNearRunningGen > 0) then {
s_player_fuelauto = player addAction ["Fill Vehicle", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",[], 0, false, true, "",""];
s_player_fuelauto = player addAction ["Fill Vehicle", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",objNull, 0, false, true, "",""];
} else {
s_player_fuelauto = player addAction ["<t color='#ff0000'>Needs Power</t>", "",[], 0, false, true, "",""];
};
@@ -463,6 +464,21 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
s_player_fuelauto = -1;
};
//Fuel Pump on truck
if(_typeOfCursorTarget in DZE_fueltruckarray and alive _cursorTarget) then {
if (s_player_fuelauto2 < 0) then {
// show that fuel truck pump needs power.
if(isEngineOn _cursorTarget) then {
s_player_fuelauto2 = player addAction ["Fill Vehicle", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",_cursorTarget, 0, false, true, "",""];
} else {
s_player_fuelauto2 = player addAction ["<t color='#ff0000'>Needs Power</t>", "",[], 0, false, true, "",""];
};
};
} else {
player removeAction s_player_fuelauto2;
s_player_fuelauto2 = -1;
};
//Start Generator
if(_cursorTarget isKindOf "Generator_DZ") then {
if (s_player_fillgen < 0) then {
@@ -486,6 +502,21 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
s_player_fillgen = -1;
};
//Towing with tow truck
if(_typeOfCursorTarget == "VIL_asistvan_DZE") then {
if (s_player_towing < 0) then {
if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
s_player_towing = player addAction ["Attach Straps", "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true, "",""];
} else {
s_player_towing = player addAction ["Dettach Straps", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true, "",""];
};
};
} else {
player removeAction s_player_towing;
s_player_towing = -1;
};
//Sleep
if(_isTent and _ownerID == dayz_characterID) then {
if ((s_player_sleep < 0) and (player distance _cursorTarget < 3)) then {
@@ -693,8 +724,12 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
s_player_information = -1;
player removeAction s_player_fillgen;
s_player_fillgen = -1;
player removeAction s_player_towing;
s_player_towing = -1;
player removeAction s_player_fuelauto;
s_player_fuelauto = -1;
player removeAction s_player_fuelauto2;
s_player_fuelauto2 = -1;
};

View File

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

View File

@@ -85,9 +85,8 @@ if (_vehicle != player) then {
private[];
_tPos = (getPosASL _vehicle);
_zPos = (getPosASL _unit);
_onSameFloor = ((abs((_tPos select 2) - (_tPos select 2)) < 1.3));
_inAngle = [_zPos,(getdir _unit),50,_tPos] call fnc_inAngleSector;
if (_onSameFloor and _inAngle) then {
if (_inAngle) then {
//LOS check
_cantSee = [_unit,_vehicle] call dayz_losCheck;
if (!_cantSee) then {

View File

@@ -41,7 +41,7 @@ class CfgMods
hidePicture = 0;
hideName = 0;
action = "http://www.dayzepoch.com";
version = "1.0.1.6";
version = "1.0.1.7";
hiveVersion = 0.96; //0.93
};
};

View File

@@ -307,6 +307,18 @@ if (!isDedicated) then {
dayz_lastCheckBit = time;
_nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
};
//
if (_dikCode == 0x48) then {
DZE_Q = true;
};
if (_dikCode == 0x50) then {
DZE_Z = true;
};
if (_dikCode == 0x4C) then {
DZE_5 = true;
};
if ((_dikCode == 0x3E or _dikCode == 0x0F or _dikCode == 0xD3) and (time - dayz_lastCheckBit > 10)) then {
dayz_lastCheckBit = time;
call dayz_forceSave;

View File

@@ -235,7 +235,9 @@ dayz_resetSelfActions = {
s_player_repair_crtl = -1;
s_player_information = -1;
s_player_fuelauto = -1;
s_player_fuelauto2 = -1;
s_player_fillgen = -1;
s_player_towing = -1;
};
call dayz_resetSelfActions;
@@ -450,6 +452,7 @@ DZE_isNewStorage = ["VaultStorage","OutHouse_DZ","Wooden_shed_DZ","WoodShack_DZ"
// These work with just a running generator
dayz_fuelpumparray = ["FuelPump_DZ","Land_A_FuelStation_Feed","Land_Ind_FuelStation_Feed_EP1","Land_FuelStation_Feed_PMC","FuelStation","Land_ibr_FuelStation_Feed","Land_fuelstation_army","Land_fuelstation","land_fuelstation_w","Land_benzina_schnell"];
DZE_fueltruckarray = ["KamazRefuel_DZ","UralRefuel_TK_EP1_DZ","MtvrRefuel_DES_EP1_DZ","V3S_Refuel_TK_GUE_EP1_DZ"];
// Standard Fuel sources
dayz_fuelsources = ["Land_Ind_TankSmall","Land_fuel_tank_big","Land_fuel_tank_stairs","Land_fuel_tank_stairs_ep1","Land_wagon_tanker","Land_fuelstation","Land_fuelstation_army","land_fuelstation_w","Land_benzina_schnell"];
@@ -579,5 +582,8 @@ if(!isDedicated) then {
};
DZE_CanPickup = true;
DZE_Q = false;
DZE_Z = false;
DZE_5 = false;
};