From 60d0c12b20bb30584e774a6401b822b7534d96a4 Mon Sep 17 00:00:00 2001 From: happydayz Date: Fri, 2 Sep 2016 23:36:00 +1000 Subject: [PATCH] this should work with 1.0.1 --- @Enigma/addons/enigma_exile_revive.pbo | Bin 15253 -> 14940 bytes .../compile/Enigma/Exile_RevivePlayer.sqf | 17 +--- ...t_object_player_death_startBleedingOut.sqf | 83 ++++++++++-------- ..._object_player_event_onInventoryOpened.sqf | 81 +++++++++-------- Exile.Altis/Custom/EnigmaRevive/init.sqf | 23 +++-- 5 files changed, 109 insertions(+), 95 deletions(-) diff --git a/@Enigma/addons/enigma_exile_revive.pbo b/@Enigma/addons/enigma_exile_revive.pbo index 1eea71ed17e399fb834c8eff5cfa5f3f4f253655..4dc1c7c052a50e16ce2a4e878458a1520cb67c00 100644 GIT binary patch delta 137 zcmbPQey3zYBVUy<0~p-pJQZGLys>|WU_er0Zc=7IPGV(hk%Fy)MsiVVVo9odQGRKG zLS|k{YC$TH$ScuQfJlVqWtJ#JE4fx==A_1hIPnmzN;(SB20B0(yZMaJ2j$HN%nve) aOyb|$vZCbH?z?B2oFC48@vG^~zB&MkDK||3 delta 383 zcmXv|%}N4M6b@R*6$}y=wTa^dkx-amK}bl1v?wZ)bRjlOdc0n^-aE|PaT1B>2@0li z(W*C4rbUaEt$Kr?MLj^!BXnn?b2uO0;`=!t>dwEpnhA?j@!UVW)WhQB`gt}%9qHMy z6?_)vvoSX*szYbTK}+Gj6j+zMvm1#@sbsL7&a9b#mR77d5ll6V$~og`M%+B&)&L!2 z1xzkmmSR$bqx8?>Wj?RaRiGreh`>6ay37SvN!x|CXEQ-l$!JNV39fDV0yH1$BOa@A zL>r3w0U$(MmzjIuaSo;(m*sR8#(FZ0T!gflMRh*~qaqmXS;tuDvp&KqRAmo!v!LLk zP|%f*!_N2sd`AkJHA+C@fQD%YPwV-djzW$KYuIHij{lAN6GAQ`j3CcKe XbMLuqbG(pv{VwmleVyKp6|emQkN%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; - }; +// SPLASH +[100] call BIS_fnc_bloodEffect; + +// Fade to gray instantly +//ExileClientPostProcessingColorCorrections ppEffectAdjust [1, 1.1, -0.05, [0.4, 0.2, 0.3, -0.1], [0.79, 0.72, 0.62, 0], [0.5,0.5,0.5,0], [0,0,0,0,0,0,4]]; +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; + +// Fade to red slowy +//ExileClientPostProcessingColorCorrections ppEffectAdjust [1, 1.1, -0.05, [0.4, 0.2, 0.3, -0.1], [0.3, 0.05, 0, 0], [0.5,0.5,0.5,0], [0,0,0,0,0,0,4]]; +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; + +// Enable blur +ExileClientPostProcessingBackgroundBlur ppEffectAdjust [0]; +ExileClientPostProcessingBackgroundBlur ppEffectCommit 0; +ExileClientPostProcessingBackgroundBlur ppEffectEnable true; +ExileClientPostProcessingBackgroundBlur ppEffectAdjust [2]; +ExileClientPostProcessingBackgroundBlur ppEffectCommit _respawnDelay; + +// Our count down +ExileClientBleedOutHeartbeatPlaying = false; +ExileClientBleedOutCountDownDuration = _respawnDelay; +ExileClientBleedOutCountDownEnd = time + _respawnDelay; + +// BIS count down GUI +_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"]; + +// Force enable chat +showChat true; + +"Start bleeding out..." call ExileClient_util_log; + +// Bleed to death (every 2 seconds) +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/ExileClient_object_player_event_onInventoryOpened.sqf b/Exile.Altis/Custom/EnigmaRevive/ExileClient_object_player_event_onInventoryOpened.sqf index 53319fb..eaea28e 100644 --- a/Exile.Altis/Custom/EnigmaRevive/ExileClient_object_player_event_onInventoryOpened.sqf +++ b/Exile.Altis/Custom/EnigmaRevive/ExileClient_object_player_event_onInventoryOpened.sqf @@ -8,45 +8,56 @@ * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. */ - -private["_cancelEvent","_container"]; + _cancelEvent = false; _container = _this select 1; -if (ExileClientIsHandcuffed) then -{ - _cancelEvent = true; -} -else + +try { + if (ExileIsPlayingRussianRoulette) then + { + throw true; + }; + + if (ExileClientIsHandcuffed) then + { + throw true; + }; + if (ExileClientActionDelayShown) then { - _cancelEvent = true; - } - else - { - if (ExileClientIsInConstructionMode) then - { - _cancelEvent = true; - } - else - { - if ((locked _container) isEqualTo 2) then - { - _cancelEvent = true; - } - else - { - if ((_container getVariable ["ExileIsLocked", 1] isEqualTo -1) || (_container getVariable["antidupe", 1]) isEqualTo -1) then //added revive dupe test -- happdayz - { - _cancelEvent = true; - } - else - { - ExileClientInventoryOpened = true; - ExileClientCurrentInventoryContainer = _container; - }; - }; - }; + throw true; }; + + // Dont double-place walls while in construction mode + if (ExileClientIsInConstructionMode) then + { + throw true; + }; + + // Cannot access locked vehicles + if ((locked _container) isEqualTo 2) then + { + throw true; + }; + + // Cannot access locked containers + if (_container getVariable ["ExileIsLocked", 1] isEqualTo -1) then + { + throw true; + }; + // Cannot access in progress revive player inventories + if ((_container getVariable["antidupe", 1]) isEqualTo -1) then + { + throw true; + }; + + ExileClientInventoryOpened = true; + ExileClientCurrentInventoryContainer = _container; +} +catch +{ + _cancelEvent = _exception; }; -_cancelEvent // OKAY! \ No newline at end of file + +_cancelEvent \ No newline at end of file diff --git a/Exile.Altis/Custom/EnigmaRevive/init.sqf b/Exile.Altis/Custom/EnigmaRevive/init.sqf index f545c64..bc2d77a 100644 --- a/Exile.Altis/Custom/EnigmaRevive/init.sqf +++ b/Exile.Altis/Custom/EnigmaRevive/init.sqf @@ -64,11 +64,13 @@ player setVariable["antidupe", 1, true]; //////////////////////////////////////////////////////////////////////////////////////EventHandlers////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// "EnigmaRevive" addPublicVariableEventHandler { - private["_newPlayerObject","_oldPlayerObject","_packet","_weapon","_reviver"]; - _packet = _this select 1; - _newPlayerObject = _packet select 0; - if (alive _newPlayerObject) then - { +private["_newPlayerObject","_oldPlayerObject","_packet","_weapon","_reviver"]; +_packet = _this select 1; +_newPlayerObject = _packet select 0; +if (alive _newPlayerObject) then +{ + if (isPlayer _newPlayerObject) then + { cutText ["","BLACK IN",20]; [100] call BIS_fnc_bloodEffect; "Reviving player..." call ExileClient_util_log; @@ -85,14 +87,20 @@ player setVariable["antidupe", 1, true]; ExileClientPlayerIsBambi = false; false call ExileClient_gui_hud_toggleBambiIcon; player setVariable["antidupe", 1, true]; //remove the antidupe from the revived player! + } else { call ExileClient_object_player_death_forceRespawn; }; +} +else +{ + call ExileClient_object_player_death_forceRespawn; }; -"EnigmaReviveFail" addPublicVariableEventHandler { +"EnigmaReviveFail" addPublicVariableEventHandler +{ _packet = _this select 1; _requestingPlayer = _packet select 0; _revivername = _packet select 1; @@ -101,7 +109,8 @@ player setVariable["antidupe", 1, true]; call ExileClient_object_player_death_forceRespawn; //force kill player }; -"EnigmaReviveMSG" addPublicVariableEventHandler { +"EnigmaReviveMSG" addPublicVariableEventHandler +{ _packet = _this select 1; _msg = _packet select 0; systemChat Format ["%1",_msg];