ACE3/addons/zeus/functions/fnc_moduleTeleportPlayers.sqf
mharis001 bca8b01860 Various additions to ace_zeus (#6036)
* Add search to teleport players UI

* Change group side icons to look better

* Improve teleport UI and add stringtable entries

* Add Assign Repair Vehicle module

* Add Assign Repair Facility module

* Add Assign Engineer module

* Add Full Heal module

* Add Suicide Bomber module

* Make heal module work without ace_medical

* Add suicide bomber module translations

* Improve attribute cargo to use displayName

* Improve set engineer ui

* ACE_Curator for repair modules + author array

* Add angle param to getModuleDestination

* Prevent multiple suicide bomber modules on same target

* Heal module: support BI scripted revive system

* Requested changes
2018-02-24 11:44:57 -06:00

46 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;