Add option to push stuck planes

Also changed flip vehicle back to 1051 default which allowed players to
flip non-ATVs with help.
This commit is contained in:
ebaydayz
2016-08-21 16:43:52 -04:00
parent 9aa1784f23
commit 745e287202
7 changed files with 73 additions and 7 deletions

View File

@@ -47,6 +47,7 @@
[NEW] 35 new male clothing classes added. #1732 #1734 @AirWavesMan
[NEW] Added new BRDM2, AN2, HMMWV, Mi17 and Cessna _DZ classes with radar disabled. #1746 @AirWavesMan
[NEW] Added SCAR Mk16 and Mk17 variants, L86 and AA12 to loot tables and traders. #1743 @AirWavesMan
[NEW] Players can now manually push stuck planes backwards to free them. @ebaydayz
[CHANGED] Combattimeout now uses diag_tickTime instead of time.
[CHANGED] AmmoBoxSmall_556/762 is replaced with DZ_AmmoBoxUS/RU/EU/CZ and MedBox0 is replaced with DZ_MedBox (new model)

View File

@@ -1,12 +1,17 @@
private ["_object","_position"];
private ["_nearPlayers","_object"];
_object = _this select 3;
_nearPlayers = {(isPlayer _x && _x != player)} count (player nearEntities ["CAManBase",8]);
if (!(_object isKindOf "ATV_Base_EP1") && _nearPlayers < 1) exitWith {
localize "STR_EPOCH_NEED_HELP" call dayz_rollingMessages;
};
//Kneel Down
player playMove "amovpknlmstpslowwrfldnon_amovpercmstpsraswrfldnon";
waitUntil { animationState player != "amovpknlmstpslowwrfldnon_amovpercmstpsraswrfldnon"};
//_object setpos _position;
_object setvectorup [0,0,1];
_object setVectorUp [0,0,1];
// Alert Zombies
[player,20,true,(getPosATL player)] call player_alertZombies;

View File

@@ -0,0 +1,30 @@
private ["_dir","_nearPlayers","_object","_speed","_vel"];
_object = _this select 3;
player removeAction s_player_pushPlane;
s_player_pushPlane = -1;
if (!local _object) exitWith {
localize "str_actions_pilot_seat" call dayz_rollingMessages;
};
_nearPlayers = {(isPlayer _x && _x != player)} count (player nearEntities ["CAManBase",8]);
if ((_object isKindOf "C130J_US_EP1" or _object isKindOf "MV22") && _nearPlayers < 1) exitWith {
localize "STR_EPOCH_NEED_HELP" call dayz_rollingMessages;
};
_vel = velocity _object;
_dir = direction _object;
_speed = -1;
_object setVelocity [
(_vel select 0) + (sin _dir * _speed),
(_vel select 1) + (cos _dir * _speed),
(_vel select 2)
];
// Alert Zombies
[player,20,true,(getPosATL player)] call player_alertZombies;
// Added Nutrition-Factor for work
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;

View File

@@ -5,7 +5,16 @@ scriptName "Functions\misc\fn_selfActions.sqf";
- [] call fnc_usec_selfActions;
************************************************************/
if (DZE_ActionInProgress) exitWith {};
private ["_canPickLight","_text","_dir","_canDoThis","_w2m","_bb","_waterHoles","_unlock","_lock","_totalKeys","_temp_keys","_temp_keys_names","_hasKey","_oldOwner","_hasAttached","_isAnimal","_isZombie","_isHarvested","_isMan","_isFuel","_hasRawMeat","_hastinitem","_player_deleteBuild","_player_lockUnlock_crtl","_displayName","_hasIgnators","_menu","_menu1","_allowTow","_liftHeli","_found","_posL","_posC","_height","_attached","_combi","_findNearestGen","_humanity_logic","_low_high","_cancel","_buy","_buyV","_humanity","_traderMenu","_warn","_typeOfCursorTarget","_isVehicle","_isBicycle","_isDestructable","_isGenerator","_ownerID","_isVehicletype","_hasBarrel","_hasFuel20","_hasFuel5","_hasEmptyFuelCan","_itemsPlayer","_hasToolbox","_hasbottleitem","_isAlive","_isPlant","_istypeTent","_upgradeItems","_isCampSite","_isDisallowRefuel","_isDog","_isModular","_isModularDoor","_isHouse","_isGate","_isFence","_isLockableGate","_isUnlocked","_isOpen","_isClosed","_ownerArray","_ownerBuildLock","_ownerPID","_speed","_dog","_vehicle","_inVehicle","_cursorTarget","_primaryWeapon","_currentWeapon","_magazinesPlayer","_onLadder","_canDo","_nearLight","_vehicleOwnerID","_hasHotwireKit","_isPZombie","_dogHandle","_allowedDistance","_id","_upgrade","_weaponsPlayer","_hasCrowbar"];
private ["_canPickLight","_text","_dir","_canDoThis","_w2m","_bb","_waterHoles","_unlock","_lock","_totalKeys","_temp_keys","_temp_keys_names",
"_hasKey","_oldOwner","_hasAttached","_isAnimal","_isZombie","_isHarvested","_isMan","_isFuel","_hasRawMeat","_hastinitem","_player_deleteBuild",
"_player_lockUnlock_crtl","_displayName","_hasIgnators","_menu","_menu1","_allowTow","_liftHeli","_found","_posL","_posC","_height","_attached",
"_combi","_findNearestGen","_humanity_logic","_low_high","_cancel","_buy","_buyV","_humanity","_traderMenu","_warn","_typeOfCursorTarget",
"_isVehicle","_isBicycle","_isDestructable","_isGenerator","_ownerID","_isVehicletype","_hasBarrel","_hasFuel20","_hasFuel5","_hasEmptyFuelCan",
"_itemsPlayer","_hasToolbox","_hasbottleitem","_isAlive","_isPlant","_istypeTent","_upgradeItems","_isCampSite","_isDisallowRefuel","_isDog",
"_isModular","_isModularDoor","_isHouse","_isGate","_isFence","_isLockableGate","_isUnlocked","_isOpen","_isClosed","_ownerArray","_ownerBuildLock",
"_ownerPID","_speed","_dog","_vehicle","_inVehicle","_cursorTarget","_primaryWeapon","_currentWeapon","_magazinesPlayer","_onLadder","_canDo",
"_nearLight","_vehicleOwnerID","_hasHotwireKit","_isPZombie","_dogHandle","_allowedDistance","_id","_upgrade","_weaponsPlayer","_hasCrowbar",
"_isPlane"];
_vehicle = vehicle player;
_inVehicle = (_vehicle != player);
@@ -229,13 +238,14 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
_typeOfCursorTarget = typeOf _cursorTarget;
_isVehicle = _cursorTarget isKindOf "AllVehicles";
_isBicycle = _cursorTarget isKindOf "Bicycle";
_isPlane = _cursorTarget isKindOf "Plane";
_isMan = _cursorTarget isKindOf "Man";
_isAnimal = _cursorTarget isKindOf "Animal";
_isZombie = _cursorTarget isKindOf "zZombie_base";
_isDestructable = _cursorTarget isKindOf "BuiltItems";
_isHarvested = _cursorTarget getVariable["meatHarvested",false];
_isGenerator = _cursorTarget isKindOf "Generator_DZ";
_isVehicletype = _typeOfCursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"];
//_isVehicletype = _typeOfCursorTarget in ["ATV_US_EP1","ATV_CZ_EP1"]; //Checked in player_flipvehicle
_isFuel = false;
_hasBarrel = "ItemFuelBarrel" in _magazinesPlayer;
_hasFuel20 = "ItemJerrycan" in _magazinesPlayer;
@@ -282,7 +292,7 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
};
//flip vehicle
if (_isVehicletype && {!(canMove _cursorTarget)} && {_isAlive} && {player distance _cursorTarget >= 2} && {(count (crew _cursorTarget))== 0} && {((vectorUp _cursorTarget) select 2) < 0.5}) then {
if (_isVehicle && {!_isAnimal} && {!_isMan} && {!(canMove _cursorTarget)} && {_isAlive} && {player distance _cursorTarget >= 2} && {(count (crew _cursorTarget))== 0} && {((vectorUp _cursorTarget) select 2) < 0.5}) then {
if (s_player_flipveh < 0) then {
s_player_flipveh = player addAction [format[localize "str_actions_flipveh",_text], "\z\addons\dayz_code\actions\player_flipvehicle.sqf",_cursorTarget, 1, true, true];
};
@@ -291,6 +301,15 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
s_player_flipveh = -1;
};
if (_isPlane && _isAlive && count (crew _cursorTarget) == 0) then {
if (s_player_pushPlane < 0) then {
s_player_pushPlane = player addAction [format[localize "str_actions_push_plane",_text], "\z\addons\dayz_code\actions\player_pushPlane.sqf",_cursorTarget,1,true,true];
};
} else {
player removeAction s_player_pushPlane;
s_player_pushPlane = -1;
};
//Allow player to fill Fuel can
if (_hasEmptyFuelCan && {_isFuel} && {!a_player_jerryfilling}) then {
if (s_player_fillfuel < 0) then {
@@ -1094,6 +1113,8 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur
//s_player_forceSave = -1;
player removeAction s_player_flipveh;
s_player_flipveh = -1;
player removeAction s_player_pushPlane;
s_player_pushPlane = -1;
player removeAction s_player_sleep;
s_player_sleep = -1;
player removeAction s_player_deleteBuild;

View File

@@ -108,7 +108,6 @@ if (!isDedicated) then {
player_dropWeapon = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_dropWeapon.sqf";
//player_setTrap = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_setTrap.sqf";
object_pickup = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\object_pickup.sqf";
//player_flipvehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_flipvehicle.sqf";
//player_sleep = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_sleep.sqf";
player_combineMag = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_combineMags.sqf";
player_combineAntibiotics = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_combineAntibiotics.sqf";

View File

@@ -176,6 +176,7 @@ dayz_resetSelfActions = {
s_build_Wire_cat1 = -1;
s_player_deleteBuild = -1;
s_player_flipveh = -1;
s_player_pushPlane = -1;
s_player_stats = -1;
s_player_sleep = -1;
s_player_fillfuel210 = -1;

View File

@@ -671,6 +671,9 @@
<German>Fahrzeug ausschlachten</German>
<Dutch>Demonteer voertuig</Dutch>
</Key>
<Key ID="str_actions_pilot_seat">
<English>You must get into the pilot&apos;s seat first.</English>
</Key>
<Key ID="str_actions_helipilotseat">
<English>To pilot&apos;s seat</English>
<Spanish>Al asiento de piloto</Spanish>
@@ -860,6 +863,9 @@
<French>Retourner %1</French>
<Czech>Otočit %1</Czech>
</Key>
<Key ID="str_actions_push_plane">
<English>Push %1</English>
</Key>
<Key ID="str_actions_stats">
<English>Enable Stats</English>
<German>Statistik aktiveren</German>
@@ -16118,6 +16124,9 @@
<German>Abbrechen</German>
<Czech>Zrušit</Czech>
</Key>
<Key ID="STR_EPOCH_NEED_HELP">
<English>You need more people to help you push.</English>
</Key>
<Key ID="str_fireplace_noMatches">
<English>You need matches to build a fireplace</English>
</Key>