ACE3/addons/zeus/functions/fnc_moduleTeleportPlayers.sqf
SilentSpike 2ca3716277 Fix Zeus teleport players module (#5175)
* Add dummy function to zeus UI modules

This removes the message about the module having no function when in SP.

* Fix zeus teleport module for non-local units

BI made a change to the function this module was using. So now it has to
be ran local to the player in question.
2017-05-26 16:07:33 +01:00

47 lines
1.0 KiB
Plaintext

/*
* 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:
* None
*
* Example:
* [player, "5854854754", false] call ace_zeus_fnc_moduleTeleportPlayers
*
* Public: No
*/
#include "script_component.hpp"
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
{
moveOut _x;
private _attached = attachedTo _logic;
if (isNull _attached) then {
// Function takes position AGL and must be ran where local
[QGVAR(moveToRespawnPosition), [_x, _logic modelToWorld [0,0,0]], _x] call CBA_fnc_targetEvent;
} else {
[QGVAR(moveToRespawnPosition), [_x, _attached], _x] call CBA_fnc_targetEvent;
};
} forEach _player;
deleteVehicle _logic;