ACE3/addons/medical/functions/fnc_addPain.sqf

27 lines
496 B
Plaintext
Raw Normal View History

2016-10-10 14:44:03 +00:00
/*
* Author: commy2
* Adds pain to unit and plays a scream sound.
*
* Arguments:
2016-10-10 14:53:25 +00:00
* 0: Unit <OBJECT>
* 1: Pain to add <NUMBER>
2016-10-10 14:44:03 +00:00
*
* Return Value:
2016-10-10 14:53:25 +00:00
* Nothing
2016-10-10 14:44:03 +00:00
*
* Example:
2016-10-10 14:53:25 +00:00
* [player, 0.5] call ace_medical_fnc_addPain
2016-10-10 14:44:03 +00:00
*
2016-10-10 14:53:25 +00:00
* Public: No
2016-10-10 14:44:03 +00:00
*/
#include "script_component.hpp"
params ["_unit", "_painToAdd"];
_painToAdd = _painToAdd min 1;
private _pain = _unit getVariable [QEGVAR(medical,pain), 0];
_pain = _pain + _painToAdd * (1 - _pain);
_unit setVariable [QEGVAR(medical,pain), _pain];