mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 17:43:56 +00:00
Added whole websocket handling to the client addon
This commit is contained in:
30
addons/client/functions/fnc_extractClientPosition.sqf
Normal file
30
addons/client/functions/fnc_extractClientPosition.sqf
Normal file
@@ -0,0 +1,30 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
/*
|
||||
* Author: Valmo Trindade
|
||||
* This function is used to extract the position of a unit and convert it to a format suitable for SIMTAK.
|
||||
*
|
||||
* Argument:
|
||||
* 0: The first argument <OBJECT> is the unit whose position you want to extract.
|
||||
*
|
||||
* Return Value:
|
||||
* ARRAY -> [latitude, longitude, altitude, bearing]
|
||||
*
|
||||
* Example:
|
||||
* [player] call armatak_client_fnc_extractClientPosition;
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
params["_unit"];
|
||||
|
||||
private _location = (getPos _unit) call armatak_client_fnc_convertClientLocation;
|
||||
|
||||
private _atak_latitude = _location select 0;
|
||||
private _atak_longitude = _location select 1;
|
||||
private _atak_altitude = _location select 2;
|
||||
private _atak_bearing = parseNumber ((getDir _unit) toFixed 0);
|
||||
|
||||
_unit_info = [_atak_latitude,_atak_longitude,_atak_altitude,_atak_bearing];
|
||||
|
||||
_unit_info
|
||||
Reference in New Issue
Block a user