mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-14 05:23:30 +00:00
improved extract info function to handle every step needed by ATAK
This commit is contained in:
23
addons/main/functions/extract_data/fn_extract_side.sqf
Normal file
23
addons/main/functions/extract_data/fn_extract_side.sqf
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
params["_unit"];
|
||||||
|
|
||||||
|
_side = "friendly";
|
||||||
|
|
||||||
|
switch (side _unit) do {
|
||||||
|
case WEST: {
|
||||||
|
_side = "friendly";
|
||||||
|
};
|
||||||
|
case EAST: {
|
||||||
|
_side = "hostile";
|
||||||
|
};
|
||||||
|
case INDEPENDENT: {
|
||||||
|
_side = "neutral";
|
||||||
|
};
|
||||||
|
case CIVILIAN: {
|
||||||
|
_side = "unknown";
|
||||||
|
};
|
||||||
|
default {
|
||||||
|
_side = "friendly";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
_side
|
||||||
@@ -3,28 +3,16 @@
|
|||||||
// function description: Receives a player's unit as param and return the information array needed to send the HTTP request
|
// function description: Receives a player's unit as param and return the information array needed to send the HTTP request
|
||||||
|
|
||||||
params["_unit"];
|
params["_unit"];
|
||||||
|
private _location = [_unit] call armatak_fnc_convert_location;
|
||||||
|
|
||||||
private _atak_uid = getPlayerUID _unit;
|
private _atak_uid = getPlayerUID _unit;
|
||||||
private _atak_latitude = getPos _unit select 0;
|
private _atak_latitude = _location select 0;
|
||||||
private _atak_longitude = getPos _unit select 1;
|
private _atak_longitude = _location select 1;
|
||||||
|
private _atak_side = [_unit] call armatak_fnc_extract_side;
|
||||||
private _atak_bearing = getDir _unit;
|
private _atak_bearing = getDir _unit;
|
||||||
private _atak_role = [_unit] call armatak_fnc_extract_role;
|
private _atak_role = [_unit] call armatak_fnc_extract_role;
|
||||||
private _atak_callsign = [_unit] call armatak_fnc_extract_callsign;
|
private _atak_callsign = [_unit] call armatak_fnc_extract_callsign;
|
||||||
|
|
||||||
/*
|
_unit_info = [_atak_uid, _atak_latitude, _atak_longitude, _atak_side, _atak_bearing, _atak_role, _atak_callsign];
|
||||||
desired object type
|
|
||||||
{
|
|
||||||
"longitude": -77.0104,
|
|
||||||
"latitude": 38.889,
|
|
||||||
"attitude": "hostile",
|
|
||||||
"bearing": 132, getDir function
|
|
||||||
"geoObject": "Gnd Combat Infantry Sniper", extract_role function
|
|
||||||
"how": "nonCoT", -- default and won't change
|
|
||||||
"name": "Putin",
|
|
||||||
"timeout": 600
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
_unit_info = [_atak_uid, _atak_latitude, _atak_longitude, _atak_bearing, _atak_role, _atak_callsign];
|
|
||||||
|
|
||||||
_unit_info
|
_unit_info
|
||||||
Reference in New Issue
Block a user