From dbe830198e6938e64a251194dff71550d3ff9419 Mon Sep 17 00:00:00 2001 From: happydayz Date: Thu, 7 Jul 2016 23:00:17 +1000 Subject: [PATCH] possible hotfix --- .../Custom/EnigmaRevive/Enigma_RevivePlyr.sqf | 131 ++++++++------- ...t_object_player_death_startBleedingOut.sqf | 154 +++++++----------- Exile.Altis/Custom/EnigmaRevive/init.sqf | 1 + 3 files changed, 133 insertions(+), 153 deletions(-) diff --git a/Exile.Altis/Custom/EnigmaRevive/Enigma_RevivePlyr.sqf b/Exile.Altis/Custom/EnigmaRevive/Enigma_RevivePlyr.sqf index 3d7edee..98665a5 100644 --- a/Exile.Altis/Custom/EnigmaRevive/Enigma_RevivePlyr.sqf +++ b/Exile.Altis/Custom/EnigmaRevive/Enigma_RevivePlyr.sqf @@ -22,84 +22,97 @@ _defibangle = 30; if !(isPlayer _target) exitWith {systemChat Format ["Theres no pulse..."]}; -if (_target getVariable "EnigmaRevivePermitted") then { +if (_target getVariable "EnigmaRevivePermitted") then +{ - if (magazines player find "Exile_Item_Defibrillator" >= 0) then { + if (magazines player find "Exile_Item_Defibrillator" >= 0) then + { - if ((player distance (_target modelToWorld _bodypos2))<((_target modelToWorld _bodypos1) distance player)) then { - _healPlace = "_bodypos2"; - _action = "medicStart"; - _bodypos = _bodypos2; - _defibpos = [0,0.9,0]; - _defibangle = 180; - }; + if ((player distance (_target modelToWorld _bodypos2))<((_target modelToWorld _bodypos1) distance player)) then + { + _healPlace = "_bodypos2"; + _action = "medicStart"; + _bodypos = _bodypos2; + _defibpos = [0,0.9,0]; + _defibangle = 180; + }; player attachTo [_target, _bodypos]; - _posh = player modelToWorld [0,0,0]; - _posi = _target modelToWorld _bodypos3; - _dy = (_posh select 1) - (_posi select 1); - _dx = (_posh select 0) - (_posi select 0); - _dir = getDir player; - player setDir (270 - (_dy atan2 _dx) - direction _target); + _posh = player modelToWorld [0,0,0]; + _posi = _target modelToWorld _bodypos3; + _dy = (_posh select 1) - (_posi select 1); + _dx = (_posh select 0) - (_posi select 0); + _dir = getDir player; + player setDir (270 - (_dy atan2 _dx) - direction _target); - sleep 0.001; + sleep 0.001; + + player removeMagazine "Exile_Item_Defibrillator"; + _position = _target modelToWorld _defibpos; + _lootHolder = createVehicle ["LootWeaponHolder", _position, [], 0, "CAN_COLLIDE"]; + _lootHolder setPosATL _position; + _lootHolder addItemCargoGlobal ["Exile_Item_Defibrillator",1]; + _lootHolder setDir ((getDir _target) + _defibangle); - player removeMagazine "Exile_Item_Defibrillator"; - _position = _target modelToWorld _defibpos; - _lootHolder = createVehicle ["LootWeaponHolder", _position, [], 0, "CAN_COLLIDE"]; - _lootHolder setPosATL _position; - _lootHolder addItemCargoGlobal ["Exile_Item_Defibrillator",1]; - _lootHolder setDir ((getDir _target) + _defibangle); + if (_primaryw == "") then + { - - if (_primaryw == "") then { - - _target switchMove "AinjPpneMstpSnonWrflDnon"; - sleep 0.2; - player playMove "AinvPknlMstpSlayWrflDnon_medic"; + _target switchMove "AinjPpneMstpSnonWrflDnon"; + sleep 0.2; + player playMove "AinvPknlMstpSlayWrflDnon_medic"; - } else { - - if (currentWeapon player != _primaryw) then { - player selectWeapon _primaryw; - sleep 2; - }; + } + else + { + if (currentWeapon player != _primaryw) then + { + player selectWeapon _primaryw; + sleep 2; + }; + player playActionNow _action; _timer = 15; waitUntil { animationState player in _Anims }; -}; + }; sleep _timer; detach player; -if (_primaryw == "") then { - player switchmove ""; - } else { - player switchAction "medicStart"; - player playActionNow "medicStop"; -}; - - if (_target getVariable["REVIVE", true]) then { - -_targetsbleedoutcountdown = _target getVariable "BleedoutCountDownEnd"; - -_secondsRemaining = _targetsbleedoutcountdown - time; -if (_secondsRemaining >= 17) then -{ - _target setVariable["antidupe", -1, true]; - ENIGMA_revivePlayer = [_target,player,1]; - publicVariableServer "ENIGMA_revivePlayer"; -} else { -systemChat Format ["RIP %1! They are too far gone!",_targetname]; + if (_primaryw == "") then + { + player switchmove ""; + } + else + { + player switchAction "medicStart"; + player playActionNow "medicStop"; }; - } else { - systemChat Format ["RIP %1! They suffered a fatal injury!",_targetname]; + if (_target getVariable["REVIVE", true]) then + { + _targetsbleedoutcountdown = _target getVariable "BleedoutCountDownEnd"; + _secondsRemaining = _targetsbleedoutcountdown - time; + if (_secondsRemaining >= 17) then + { + _target setVariable["antidupe", -1, true]; + ENIGMA_revivePlayer = [_target,player,1]; + publicVariableServer "ENIGMA_revivePlayer"; + } + else + { + systemChat Format ["RIP %1! They are too far gone!",_targetname]; + }; + } + else + { + systemChat Format ["RIP %1! They suffered a fatal injury!",_targetname]; }; }; -} else { - systemChat Format ["RIP %1! They suffered a fatal injury!",_targetname]; - }; \ No newline at end of file +} +else +{ + systemChat Format ["RIP %1! They suffered a fatal injury!",_targetname]; +}; \ No newline at end of file diff --git a/Exile.Altis/Custom/EnigmaRevive/ExileClient_object_player_death_startBleedingOut.sqf b/Exile.Altis/Custom/EnigmaRevive/ExileClient_object_player_death_startBleedingOut.sqf index 44e0f78..dd9388f 100644 --- a/Exile.Altis/Custom/EnigmaRevive/ExileClient_object_player_death_startBleedingOut.sqf +++ b/Exile.Altis/Custom/EnigmaRevive/ExileClient_object_player_death_startBleedingOut.sqf @@ -11,111 +11,77 @@ private["_respawnDelay","_layer","_descriptions"]; _respawnDelay = _this; - -/////////////////////////////////added by happydayz///////////////////////////////////// oldgroup = group player; -if (player getVariable["REVIVE", true]) then { -_descriptions = -[ +if (player getVariable["REVIVE", true]) then +{ + + _descriptions = + [ "KNOCKED OUT", "CRITICALLY WOUNDED", "BLEEDING OUT", "ON DEATHS DOOR" ]; -player setVariable ['EnigmaRevivePermitted', true, true]; //adds action to be revived - -[100] call BIS_fnc_bloodEffect; -ExileClientPostProcessingColorCorrections ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0.39, 0.32, 0.25, 0], [0.5,0.5,0.5,0], [0,0,0,0,0,0,4]]; -ExileClientPostProcessingColorCorrections ppEffectCommit 0; -ExileClientPostProcessingColorCorrections ppEffectAdjust [1, 1, 0, [0.4, 0.2, 0.3, 0], [0.3, 0.05, 0, 0], [0.5,0.5,0.5,0], [0,0,0,0,0,0,4]]; -ExileClientPostProcessingColorCorrections ppEffectCommit _respawnDelay; -ExileClientPostProcessingBackgroundBlur ppEffectAdjust [0]; -ExileClientPostProcessingBackgroundBlur ppEffectCommit 0; -ExileClientPostProcessingBackgroundBlur ppEffectEnable true; -ExileClientPostProcessingBackgroundBlur ppEffectAdjust [2]; -ExileClientPostProcessingBackgroundBlur ppEffectCommit _respawnDelay; -ExileClientBleedOutHeartbeatPlaying = false; -ExileClientBleedOutCountDownDuration = _respawnDelay; -ExileClientBleedOutCountDownEnd = time + _respawnDelay; -_layer = "BIS_fnc_respawnCounter" call bis_fnc_rscLayer; -_layer cutText ["", "plain"]; -_descriptions = - -player setVariable ["BleedoutCountDownEnd", ExileClientBleedOutCountDownEnd, true]; - -_layer = "BIS_fnc_respawnCounter" call bis_fnc_rscLayer; -_layer cutText ["", "plain"]; - -missionnamespace setvariable ["RscRespawnCounter_description", format ["%1",selectRandom _descriptions]]; -missionnamespace setvariable ["RscRespawnCounter_colorID", 0]; -missionnamespace setvariable ["RscRespawnCounter_Custom", _respawnDelay]; -_layer cutRsc ["RscRespawnCounter", "plain"]; -showChat true; -"Start bleeding out..." call ExileClient_util_log; -if(ExileClientBleedOutThread isEqualTo -1)then -{ - ExileClientBleedOutThread = [2, ExileClient_object_player_thread_bleedToDeath, [], true] call ExileClient_system_thread_addtask; -}; + player setVariable ['EnigmaRevivePermitted', true, true]; } else { -//////////////////////////////////////////////////////////////////////////////////////// - - - -[100] call BIS_fnc_bloodEffect; -ExileClientPostProcessingColorCorrections ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0.39, 0.32, 0.25, 0], [0.5,0.5,0.5,0], [0,0,0,0,0,0,4]]; -ExileClientPostProcessingColorCorrections ppEffectCommit 0; -ExileClientPostProcessingColorCorrections ppEffectAdjust [1, 1, 0, [0.4, 0.2, 0.3, 0], [0.3, 0.05, 0, 0], [0.5,0.5,0.5,0], [0,0,0,0,0,0,4]]; -ExileClientPostProcessingColorCorrections ppEffectCommit _respawnDelay; -ExileClientPostProcessingBackgroundBlur ppEffectAdjust [0]; -ExileClientPostProcessingBackgroundBlur ppEffectCommit 0; -ExileClientPostProcessingBackgroundBlur ppEffectEnable true; -ExileClientPostProcessingBackgroundBlur ppEffectAdjust [2]; -ExileClientPostProcessingBackgroundBlur ppEffectCommit _respawnDelay; -ExileClientBleedOutHeartbeatPlaying = false; -ExileClientBleedOutCountDownDuration = _respawnDelay; -ExileClientBleedOutCountDownEnd = time + _respawnDelay; -_layer = "BIS_fnc_respawnCounter" call bis_fnc_rscLayer; -_layer cutText ["", "plain"]; -_descriptions = -[ - "WRECKED", - "REKT", - "STOMPED", - "WASTED", - "SCREWED", - "TOASTED", - "REST IN PIECES", - "TERMINATED", - "KILLED", - "EXILED", - "ANNIHILATED", - "HAMMERED", - "NEUTRALIZED", - "DUMPED", - "ZAPPED", - "SLAIN", - "FRIED", - "WIPED OUT", - "VANQUISHED", - "BUSTED", - "PULVERIZED", - "SMASHED", - "SHREDDED", - "CRUSHED" -]; -missionnamespace setvariable ["RscRespawnCounter_description", format ["%1",selectRandom _descriptions]]; -missionnamespace setvariable ["RscRespawnCounter_colorID", 0]; -missionnamespace setvariable ["RscRespawnCounter_Custom", _respawnDelay]; -_layer cutRsc ["RscRespawnCounter", "plain"]; -showChat true; -"Start bleeding out..." call ExileClient_util_log; -if(ExileClientBleedOutThread isEqualTo -1)then -{ - ExileClientBleedOutThread = [2, ExileClient_object_player_thread_bleedToDeath, [], true] call ExileClient_system_thread_addtask; + _descriptions = + [ + "WRECKED", + "REKT", + "STOMPED", + "WASTED", + "SCREWED", + "TOASTED", + "REST IN PIECES", + "TERMINATED", + "KILLED", + "EXILED", + "ANNIHILATED", + "HAMMERED", + "NEUTRALIZED", + "DUMPED", + "ZAPPED", + "SLAIN", + "FRIED", + "WIPED OUT", + "VANQUISHED", + "BUSTED", + "PULVERIZED", + "SMASHED", + "SHREDDED", + "CRUSHED" + ]; }; + + [100] call BIS_fnc_bloodEffect; + ExileClientPostProcessingColorCorrections ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0.39, 0.32, 0.25, 0], [0.5,0.5,0.5,0], [0,0,0,0,0,0,4]]; + ExileClientPostProcessingColorCorrections ppEffectCommit 0; + ExileClientPostProcessingColorCorrections ppEffectAdjust [1, 1, 0, [0.4, 0.2, 0.3, 0], [0.3, 0.05, 0, 0], [0.5,0.5,0.5,0], [0,0,0,0,0,0,4]]; + ExileClientPostProcessingColorCorrections ppEffectCommit _respawnDelay; + ExileClientPostProcessingBackgroundBlur ppEffectAdjust [0]; + ExileClientPostProcessingBackgroundBlur ppEffectCommit 0; + ExileClientPostProcessingBackgroundBlur ppEffectEnable true; + ExileClientPostProcessingBackgroundBlur ppEffectAdjust [2]; + ExileClientPostProcessingBackgroundBlur ppEffectCommit _respawnDelay; + ExileClientBleedOutHeartbeatPlaying = false; + ExileClientBleedOutCountDownDuration = _respawnDelay; + ExileClientBleedOutCountDownEnd = time + _respawnDelay; + _layer = "BIS_fnc_respawnCounter" call bis_fnc_rscLayer; + _layer cutText ["", "plain"]; + missionnamespace setvariable ["RscRespawnCounter_description", format ["%1",selectRandom _descriptions]]; + missionnamespace setvariable ["RscRespawnCounter_colorID", 0]; + missionnamespace setvariable ["RscRespawnCounter_Custom", _respawnDelay]; + _layer cutRsc ["RscRespawnCounter", "plain"]; + showChat true; + "Start bleeding out..." call ExileClient_util_log; + if(ExileClientBleedOutThread isEqualTo -1)then + { + ExileClientBleedOutThread = [2, ExileClient_object_player_thread_bleedToDeath, [], true] call ExileClient_system_thread_addtask; }; + + true \ No newline at end of file diff --git a/Exile.Altis/Custom/EnigmaRevive/init.sqf b/Exile.Altis/Custom/EnigmaRevive/init.sqf index 00d8f66..78510bf 100644 --- a/Exile.Altis/Custom/EnigmaRevive/init.sqf +++ b/Exile.Altis/Custom/EnigmaRevive/init.sqf @@ -60,6 +60,7 @@ if (hasInterface) then { [] execVM "Custom\EnigmaRevive\compiles.sqf"; player setVariable ['EnigmaRevivePermitted', false, true]; player setVariable["antidupe", 1, true]; +player setVariable ["REVIVE", true, true]; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////EventHandlers////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////