Files
DayZ-Epoch/SQF/dayz_code/compile/object_removeNearby.sqf
ebaydayz 6a6db58291 Compiles.sqf cleanup
- Moved player_countMagazines to \compile\ folder
- Removed several unused and obsolete files
- Moved some epoch functions out of compiles.sqf into individual files
- Synced order and formatting with 1.8.7. Much easier to compare now.

Any changes I make to official DayZ Mod code and files I also submit as
a pull request to them.
2016-03-17 16:34:15 -04:00

22 lines
723 B
Plaintext

private ["_nearByObjects","_targetObject","_error","_range","_objects"];
//Object Array, Range, Error Message (@Skaronator)
_objects = _this select 0;
_range = _this select 1;
_error = _this select 2;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
_nearByObjects = nearestObjects [player,_objects,_range];
if (count _nearByObjects == 0) exitWith {
cutText [(localize _error), "PLAIN DOWN"];
};
_targetObject = _nearByObjects select 0;
if (!isNull _targetObject && _canDo) then {
[0,1,2,_targetObject] spawn player_removeObject;
} else {
cutText [(localize _error), "PLAIN DOWN"];
};