ACE3/addons/respawn/functions/fnc_moveRallypoint.sqf

53 lines
1.4 KiB
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
/*
2015-09-26 14:26:41 +00:00
* Author: commy2
* Moves a rallypoint to the players location.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Side <SIDE>
*
* Return Value:
* None
*
* Example:
* [ACE_Player, side ACE_Player] call ace_respawn_fnc_moveRallypoint
*
* Public: No
*/
2015-01-12 09:07:03 +00:00
2015-09-26 14:26:41 +00:00
params ["_unit", "_side"];
2015-04-26 19:26:57 +00:00
private _rallypoint = [
2015-09-26 14:26:41 +00:00
objNull,
missionNamespace getVariable ["ACE_Rallypoint_West", objNull],
missionNamespace getVariable ["ACE_Rallypoint_East", objNull],
missionNamespace getVariable ["ACE_Rallypoint_Independent", objNull]
] select ([west, east, independent] find _side) + 1;
2015-01-13 14:28:03 +00:00
2015-09-26 14:26:41 +00:00
TRACE_3("moving rally",_unit,_rallypoint,typeOf _rallypoint);
2015-07-01 06:27:06 +00:00
if (isNull _rallypoint) exitWith {};
2015-01-12 09:07:03 +00:00
private _position = getPosATL _unit;
_position = _position findEmptyPosition [0, 2, typeOf _rallypoint];
2015-09-26 14:26:41 +00:00
if (_position isEqualTo []) then {_position = getPosATL _unit};
2015-01-12 09:07:03 +00:00
_position set [2, 0];
2015-01-12 09:07:03 +00:00
2015-05-28 19:59:04 +00:00
[localize LSTRING(Deploy)] call EFUNC(common,displayTextStructured);
2015-01-12 09:07:03 +00:00
2015-04-11 17:36:38 +00:00
[{
2015-10-01 19:34:40 +00:00
params ["_rallypoint", "_unit", "_position"];
2015-01-12 09:07:03 +00:00
2015-01-13 14:28:03 +00:00
_rallypoint setPosATL _position;
_unit reveal _rallypoint;
2015-01-12 09:07:03 +00:00
2015-10-04 00:15:38 +00:00
_rallypoint setVariable [QGVAR(markerDate), [dayTime, "HH:MM"] call BIS_fnc_timeToString, true];
2016-05-24 13:13:11 +00:00
["ace_rallypointMoved", [_rallypoint, _side, _position]] call CBA_fnc_globalEvent;
2015-01-12 09:07:03 +00:00
2015-05-28 19:59:04 +00:00
[localize LSTRING(Deployed)] call EFUNC(common,displayTextStructured);
}, [_rallypoint, _unit, _position], 5] call CBA_fnc_waitAndExecute;