ACE3/addons/respawn/functions/fnc_teleportToRallypoint.sqf

31 lines
714 B
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
/*
2015-04-17 21:51:27 +00:00
* Author: commy2
2015-09-26 14:26:41 +00:00
* Teleports a unit to a rallypoint
2015-04-17 21:51:27 +00:00
*
* Arguments:
2015-09-26 14:26:41 +00:00
* 0: Unit <OBJECT>
* 1: Side <SIDE>
* 2: Rallypoint name <STRING>
2015-04-17 21:51:27 +00:00
*
* Return Value:
2015-09-26 14:26:41 +00:00
* None
2015-04-17 21:51:27 +00:00
*
* Example:
2015-09-26 14:26:41 +00:00
* [ACE_player, side ACE_Player, rallypoint_name] call ace_respawn_fnc_teleportToRallypoint;
2015-04-17 21:51:27 +00:00
*
* Public: No
*/
2015-01-12 09:07:03 +00:00
2015-09-26 14:26:41 +00:00
params ["_unit", "_side", "_rallypoint"];
2015-01-12 09:07:03 +00:00
private _toBase = _rallypoint find "_Base" != -1;
2015-04-14 23:50:58 +00:00
2016-05-29 09:44:00 +00:00
_rallypoint = missionNamespace getVariable [_rallypoint, objNull];
2015-01-12 09:07:03 +00:00
if (isNull _rallypoint) exitWith {};
2015-04-14 23:50:58 +00:00
_unit setPosASL getPosASL _rallypoint;
2015-09-26 14:26:41 +00:00
2015-05-28 19:59:04 +00:00
[[localize LSTRING(TeleportedToRallypoint), localize LSTRING(TeleportedToBase)] select _toBase] call EFUNC(common,displayTextStructured);