ACE3/addons/concertina_wire/functions/fnc_dismountSuccess.sqf

43 lines
794 B
Plaintext
Raw Normal View History

/*
* Author: Rocko, Ruthberg
*
* Dismounts the concertina wire
*
* Arguments:
* 0: wire <OBJECT>
*
* Return Value:
* None
2015-08-09 00:19:34 +00:00
*
* Public: No
*/
2015-06-04 15:11:09 +00:00
#include "script_component.hpp"
PARAMS_1(_wire);
{
_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 {
private ["_dir", "_pos", "_wirecoil"];
2015-08-09 00:19:34 +00:00
2015-06-04 15:11:09 +00:00
_dir = getDir _wire;
_pos = getPosASL _wire;
2015-08-09 00:19:34 +00:00
2015-06-04 15:11:09 +00:00
_wirecoil = "ACE_ConcertinaWireCoil" createvehicle [0, 0, 0];
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;