mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-18 01:30:26 +03:00
Less Scripts + Fix RPT Error if nothing is nearby
This commit is contained in:
15
SQF/dayz_code/compile/object_removeNearby.sqf
Normal file
15
SQF/dayz_code/compile/object_removeNearby.sqf
Normal file
@@ -0,0 +1,15 @@
|
||||
private ["_nearByObjects","_targetObject"];
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
|
||||
|
||||
_nearByObjects = nearestObjects _this;
|
||||
|
||||
if (count _nearByObjects == 0) exitWith {
|
||||
cutText [(localize "str_epoch_player_8"), "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
_targetObject = _nearByObjects select 0;
|
||||
if (!isNull _targetObject and _canDo) then {
|
||||
[0,1,2,_targetObject] spawn player_removeObject;
|
||||
};
|
||||
@@ -1,13 +0,0 @@
|
||||
private ["_nearNets","_nearNet"];
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
|
||||
|
||||
_nearNets = nearestObjects [player, ["DesertLargeCamoNet","ForestCamoNet_DZ","DesertLargeCamoNet_DZ","ForestLargeCamoNet_DZ"], 5];
|
||||
_nearNet = _nearNets select 0;
|
||||
|
||||
if (!isNull _nearNet and _canDo) then {
|
||||
[0,1,2,_nearNet] spawn player_removeObject;
|
||||
} else {
|
||||
cutText [(localize "str_epoch_player_8"), "PLAIN DOWN"];
|
||||
};
|
||||
@@ -1,13 +0,0 @@
|
||||
private ["_nearTankTraps","_nearTankTrap"];
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
|
||||
|
||||
_nearTankTraps = nearestObjects [player, ["Hedgehog_DZ"], 1];
|
||||
_nearTankTrap = _nearTankTraps select 0;
|
||||
|
||||
if (!isNull _nearTankTrap and _canDo) then {
|
||||
[0,1,2,_nearTankTrap] spawn player_removeObject;
|
||||
} else {
|
||||
cutText [(localize "STR_EPOCH_ACTIONS_14"), "PLAIN DOWN"];
|
||||
};
|
||||
Reference in New Issue
Block a user