2015-01-12 10:24:58 +00:00
|
|
|
/*
|
2015-04-17 21:51:27 +00:00
|
|
|
* Author: commy2
|
|
|
|
* teleports a unit to a rallypoint
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: unit <OBJECT>
|
|
|
|
* 1: side? <OBJECT>
|
|
|
|
* 2: teleport to base <BOOLEAN>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Nothing
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [,,] call ACE_Respawn_fnc_teleportToRallypoint;
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-12 10:24:58 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-12 09:07:03 +00:00
|
|
|
|
2015-04-17 21:51:27 +00:00
|
|
|
PARAMS_3(_unit,_side,_rallypoint);
|
2015-01-12 09:07:03 +00:00
|
|
|
|
2015-04-17 21:51:27 +00:00
|
|
|
private ["_toBase"];
|
2015-01-12 09:07:03 +00:00
|
|
|
|
2015-01-12 09:49:21 +00:00
|
|
|
// rallypoint names are defined in CfgVehicles.hpp
|
|
|
|
|
2015-04-17 21:51:27 +00:00
|
|
|
//IGNORE_PRIVATE_WARNING("_Base")
|
2015-04-14 23:50:58 +00:00
|
|
|
_toBase = _rallypoint find "_Base" != -1;
|
|
|
|
|
|
|
|
_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-01-13 15:29:35 +00:00
|
|
|
[[localize "STR_ACE_Respawn_TeleportedToRallypoint", localize "STR_ACE_Respawn_TeleportedToBase"] select _toBase] call EFUNC(common,displayTextStructured);
|