2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2016-05-18 15:16:35 +00:00
|
|
|
/*
|
|
|
|
* Author: SilentSpike
|
|
|
|
* Zeus module function to teleport players on dialog confirmation
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Teleport to <OBJECT>
|
|
|
|
* 1: Player UID <STRING>
|
|
|
|
* 2: Teleport group <BOOL>
|
|
|
|
*
|
|
|
|
* Return Value:
|
2016-11-15 12:07:48 +00:00
|
|
|
* None
|
2016-05-18 15:16:35 +00:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player, "5854854754", false] call ace_zeus_fnc_moduleTeleportPlayers
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2016-05-15 20:02:40 +00:00
|
|
|
|
|
|
|
params ["_logic","_uid","_group"];
|
|
|
|
|
|
|
|
// Get the chosen unit
|
|
|
|
private _player = [_uid] call BIS_fnc_getUnitByUID;
|
|
|
|
|
|
|
|
// Handle if group mode was selected
|
|
|
|
if (_group) then {
|
|
|
|
_player = units _player;
|
|
|
|
} else {
|
|
|
|
_player = [_player];
|
|
|
|
};
|
|
|
|
|
|
|
|
// Handle teleportation
|
|
|
|
{
|
2016-05-21 16:43:25 +00:00
|
|
|
moveOut _x;
|
2016-05-15 20:02:40 +00:00
|
|
|
|
2016-05-21 16:43:25 +00:00
|
|
|
private _attached = attachedTo _logic;
|
|
|
|
if (isNull _attached) then {
|
2017-05-26 15:07:33 +00:00
|
|
|
// Function takes position AGL and must be ran where local
|
|
|
|
[QGVAR(moveToRespawnPosition), [_x, _logic modelToWorld [0,0,0]], _x] call CBA_fnc_targetEvent;
|
2016-05-15 20:02:40 +00:00
|
|
|
} else {
|
2017-05-26 15:07:33 +00:00
|
|
|
[QGVAR(moveToRespawnPosition), [_x, _attached], _x] call CBA_fnc_targetEvent;
|
2016-05-15 20:02:40 +00:00
|
|
|
};
|
|
|
|
} forEach _player;
|
2016-09-10 12:33:19 +00:00
|
|
|
|
|
|
|
deleteVehicle _logic;
|