ACE3/addons/concertina_wire/functions/fnc_dismountSuccess.sqf

45 lines
841 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
/*
* Author: Rocko, Ruthberg
*
* Dismounts the concertina wire
*
* Arguments:
* 0: wire <OBJECT>
*
* Return Value:
* None
2015-08-09 00:19:34 +00:00
*
* Example:
* [wire] call ace_concertina_wire_fnc_dismountSuccess
*
2015-08-09 00:19:34 +00:00
* Public: No
*/
2015-06-04 15:11:09 +00:00
params ["_wire"];
2015-06-04 15:11:09 +00:00
{
_wire animate [_x, 1];
2015-08-09 00:19:34 +00:00
} count WIRE_FAST;
2015-06-04 15:11:09 +00:00
[{
2015-08-09 00:19:34 +00:00
params ["_args", "_idPFH"];
_args params ["_wire"];
2015-06-04 15:11:09 +00:00
if (_wire animationPhase "wire_2" == 1) then {
2015-08-09 00:19:34 +00:00
private _dir = getDir _wire;
private _pos = getPosASL _wire;
2015-08-09 00:19:34 +00:00
private _wirecoil = "ACE_ConcertinaWireCoil" createvehicle [0, 0, 0];
2015-06-04 15:11:09 +00:00
deleteVehicle _wire;
2015-08-09 00:19:34 +00:00
2015-06-04 15:11:09 +00:00
_wirecoil setDir _dir;
_wirecoil setPosASL _pos;
_wirecoil setVelocity [0, 0, 0];
2015-08-09 00:19:34 +00:00
[_idPFH] call CBA_fnc_removePerFrameHandler;
2015-06-04 15:11:09 +00:00
};
}, 0, [_wire]] call CBA_fnc_addPerFrameHandler;