From 210fa7d044951ec271efc1d87840587b2fb46847 Mon Sep 17 00:00:00 2001 From: Ghostrider-DbD- Date: Fri, 24 Feb 2017 20:02:47 -0500 Subject: [PATCH] Update GMS_fnc_playerInRange.sqf Added an optional check such that only players on foot are detected. --- .../Functions/GMS_fnc_playerInRange.sqf | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRange.sqf b/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRange.sqf index a2a4edb..ccc042c 100644 --- a/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRange.sqf +++ b/@epochhive/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRange.sqf @@ -4,16 +4,25 @@ for DBD Clan By Ghostrider-DBD- Copyright 2016 - Last Modified 1/22/17 + Last Modified 2/24/17 */ ///////////////////////////////////////////////////// private ["_result"]; -params["_pos","_dist"]; +params["_pos","_dist",["_onFootOnly",false]]; _result = false; +if !(_onFootOnly) then { - if ((_x distance2D _pos) < _dist) exitWith {_result = true;}; -} forEach allPlayers; + { + if ((_x distance2D _pos) < _dist) exitWith {_result = true;}; + } forEach allPlayers; +}; //diag_log format["_fnc_playerInRange:: -> _pos = %1 and _dist = %2 and _result = %3",_pos,_dist,_result]; -_result \ No newline at end of file +if (_onFootOnly) then +{ + { + if ( ((_x distance2D _pos) < _dist) && (vehicle _x isEqualTo _x)) exitWith {_result = true;}; + } forEach allPlayers; +}; +_result