Skip to content

Commit

Permalink
close #59 kill on unconscious
Browse files Browse the repository at this point in the history
  • Loading branch information
McDiod committed Apr 30, 2020
1 parent a0557d9 commit 66b47e6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions functions/events/cfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class gungame_events {
class onIncreasedScore {};
class onPlayerKilled {};
class onPlayerRespawn {};
class onUnconscious {};
class onUnitKilledServer {};
class respawnPlayer {};
class upgradeWeaponTitleOnLoad {};
Expand Down
8 changes: 8 additions & 0 deletions functions/events/fn_onUnconscious.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "component.hpp"

params [["_unit",objNull],["_isUnconscious",false]];

if (!local _unit) exitWith {};
if (!_isUnconscious) exitWith {};

_unit setDamage 1;
2 changes: 2 additions & 0 deletions functions/missionSetup/fn_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

[{!isNull player || isDedicated},{

["ace_unconscious",EFUNC(events,onUnconscious)] call CBA_fnc_addEventHandler;

// PLAYER ==================================================================
if (hasInterface) then {
[] call FUNC(moveToMapStartPos);
Expand Down

0 comments on commit 66b47e6

Please sign in to comment.