mirror of
https://github.com/hpy/Enigma_Exile_Revive.git
synced 2024-08-30 16:52:15 +00:00
Update Enigma_RevivePlyr.sqf
Prevent reviving if another player is close by, this prevents it bugging the player out
This commit is contained in:
parent
588042c37d
commit
1b9fea5aad
@ -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];
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user