ACE3/addons/hearing/functions/fnc_explosionNear.sqf

28 lines
664 B
Plaintext
Raw Normal View History

/*
* Author: KoffeinFlummi, commy2
* Handles deafness due to explosions going off near the player.
*
* Arguments:
2015-03-15 21:40:47 +00:00
* 0: vehicle - Object the event handler is assigned to (player) <OBJECT>
* 1: damage - Damage inflicted to the object <NUMBER>
*
* Return Value:
2015-03-15 21:40:47 +00:00
* None
*
* Example:
* [clientExplosionEvent] call ace_hearing_fnc_explosionNear
*
* Public: No
*/
2015-01-14 01:41:53 +00:00
#include "script_component.hpp"
private ["_unit", "_damage", "_strength"];
_unit = _this select 0;
_damage = _this select 1;
_strength = (_damage * 2) min 1;
if (_strength < 0.01) exitWith {};
2015-03-15 21:46:06 +00:00
[{_this call FUNC(earRinging)}, [_unit, _strength], 0.2, 0] call EFUNC(common,waitAndExecute);