ACE3/addons/interaction/functions/fnc_getDown.sqf

34 lines
665 B
Plaintext
Raw Normal View History

2015-01-11 19:32:51 +00:00
/*
* Author: KoffeinFlummi, commy2
* Forces a civilian to the ground with a chance of failure.
2015-01-11 23:13:47 +00:00
*
2015-01-11 19:32:51 +00:00
* Arguments:
* 0: Unit <OBJECT>
2015-09-28 16:06:25 +00:00
* 1: Target <OBJECT>
2015-01-11 19:32:51 +00:00
*
2015-09-28 16:06:25 +00:00
* Return Value:
* None
*
* Example:
* [civillian] call ace_interaction_fnc_getDown
*
* Public: No
2015-01-11 19:32:51 +00:00
*/
2015-01-11 23:13:47 +00:00
#include "script_component.hpp"
2015-01-11 19:32:51 +00:00
#define SEND_RADIUS 10
2015-01-11 19:32:51 +00:00
2015-09-28 16:06:25 +00:00
params ["_unit", "_target"];
2015-01-11 19:32:51 +00:00
_unit playActionNow "GestureGo";
2015-01-11 19:32:51 +00:00
private "_chance";
_chance = [0.5, 0.8] select (count weapons _unit > 0);
2015-01-11 19:32:51 +00:00
{
if (count weapons _x == 0 && {random 1 < _chance}) then {
2016-05-24 13:13:11 +00:00
["ace_getDown", [_x], [_x]] call CBA_fnc_targetEvent;
};
false
2015-09-28 16:06:25 +00:00
} count (_target nearEntities ["Civilian", SEND_RADIUS]);