Update Enigma_RevivePlyr.sqf

Prevent reviving if another player is close by, this prevents it bugging the player out
This commit is contained in:
MGT 2020-08-20 16:38:10 +01:00 committed by GitHub
parent 588042c37d
commit 1b9fea5aad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@ Enigma_RevivePlyr.sqf
© 2016 Enigma Team
*/
private ["_target","_targetname", "_bodypos1", "_bodypos2", "_bodypos3", "_healPlace", "_action", "_bodypos", "_animstate", "_primaryw", "_timer", "_Anims", "_defibpos", "_defibangle", "_posh", "_posi", "_dy", "_dx", "_dir", "_position", "_lootHolder", "_targetsbleedoutcountdown", "_secondsRemaining"];
private ["_target","_targetname", "_bodypos1", "_bodypos2", "_bodypos3", "_healPlace", "_action", "_bodypos", "_animstate", "_primaryw", "_timer", "_Anims", "_defibpos", "_defibangle", "_posh", "_posi", "_dy", "_dx", "_dir", "_position", "_lootHolder", "_targetsbleedoutcountdown", "_secondsRemaining", "_playersNearby"];
_target = _this select 0;
_targetname = name _target;
@ -22,6 +22,16 @@ _defibpos = [0.4,0.9,0];
_defibangle = 30;
if !(isPlayer _target) exitWith {systemChat Format ["Theres no pulse..."]};
//Prevent reviving if another player is close by, this prevents it bugging the player out
_playersNearby = [player, 10] call ExileClient_util_world_getAlivePlayerInfantryInRange;
{
if !(_x isEqualTo player) then
{
["ErrorTitleOnly", ["Another player is too close"]] call ExileClient_gui_toaster_addTemplateToast;
_exit = true;
};
}
forEach _playersNearby;
if (_target getVariable "EnigmaRevivePermitted") then
{
@ -116,4 +126,4 @@ if (_target getVariable "EnigmaRevivePermitted") then
else
{
systemChat Format ["RIP %1! They suffered a fatal injury!",_targetname];
};
};