Files
DayZ-Epoch/SQF/dayz_code/old/tow_DetachStraps.sqf
A Man e116caa815 Update fnc_isInsideBuilding
Made by @Victor-the-Cleaner

- If the player is inside a building but near a large open doorway or full height windows, or out on a balcony, they may be considered outside.
- The UI visual stealth icon will update accordingly, so the player will know if they need to step back from open doors or windows to regain stealth.
- dayz_inside global variable will now only affect player temperature, stealth vs zombies, and blizzard effects.
- The new dayz_insideBuilding global variable stores the building name the player is currently inside of, or null if player is outside. This may be used for modding purposes.
2022-04-02 12:22:56 +02:00

48 lines
1.3 KiB
Plaintext

private ["_vehicle","_finished","_configVeh","_nameText","_towTruck","_inTow"];
if (dayz_actionInProgress) exitWith {localize "str_epoch_player_96" call dayz_rollingMessages;};
dayz_actionInProgress = true;
player removeAction s_player_towing;
s_player_towing = 1;
// Tow Truck
_towTruck = _this select 3;
// exit if no vehicle is in tow.
_inTow = _towTruck getVariable ["DZEinTow", false];
if(_inTow) then {
// select vehicle in tow
_vehicle = _towTruck getVariable ["DZEvehicleInTow", objNull];
if(!(isNull _towTruck)) then {
// Static vehicle fuel information
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
_nameText = getText(_configVeh >> "displayName");
// alert zombies
[player,20,true,(getPosATL player)] spawn player_alertZombies;
_finished = ["Medic",1] call fn_loopAction;
if (_finished) then {
detach _vehicle;
_towTruck setVariable ["DZEinTow", false, true];
_towTruck setVariable ["DZEvehicleInTow", objNull, true];
format[localize "str_epoch_player_178",_nameText] call dayz_rollingMessages;
_vehicle setvelocity [0,0,1];
};
} else {
_towTruck setVariable ["DZEinTow", false, true];
_towTruck setVariable ["DZEvehicleInTow", objNull, true];
};
} else {
localize "str_epoch_player_102" call dayz_rollingMessages;
};
dayz_actionInProgress = false;
s_player_towing = -1;