mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 14:43:29 +00:00
Added Clafghan Map Support
This commit is contained in:
@@ -1,22 +1,22 @@
|
|||||||
#include "..\script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Author: Valmo Trindade
|
* Author: Valmo Trindade
|
||||||
* This function is used to convert the position of a unit to the world world location.
|
* This function is used to convert the position of a unit to the world world location.
|
||||||
*
|
*
|
||||||
* Argument:
|
* Argument:
|
||||||
* 0: in game latitude <NUMBER> is the latitude of the unit.
|
* 0: in game latitude <NUMBER> is the latitude of the unit.
|
||||||
* 1: in game longitude <NUMBER> is the longitude of the unit.
|
* 1: in game longitude <NUMBER> is the longitude of the unit.
|
||||||
* 2: in game altitude <NUMBER> is the altitude of the unit.
|
* 2: in game altitude <NUMBER> is the altitude of the unit.
|
||||||
* 3: in game bearing <NUMBER> is the bearing of the unit.
|
* 3: in game bearing <NUMBER> is the bearing of the unit.
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* ARRAY -> [latitude, longitude, altitude, bearing]
|
* ARRAY -> [latitude, longitude, altitude, bearing]
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* [player] call armatak_client_fnc_convertClientLocation;
|
* [player] call armatak_client_fnc_convertClientLocation;
|
||||||
*
|
*
|
||||||
* Public: Yes
|
* Public: Yes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
params["_latitude", "_longitude", "_altitude"];
|
params["_latitude", "_longitude", "_altitude"];
|
||||||
@@ -101,6 +101,9 @@ switch (toLower worldName) do {
|
|||||||
case "umb_colombia": {
|
case "umb_colombia": {
|
||||||
_realLocation = _position call armatak_fnc_convert_to_colombia;
|
_realLocation = _position call armatak_fnc_convert_to_colombia;
|
||||||
};
|
};
|
||||||
|
case "clafghan": {
|
||||||
|
_realLocation = _position call armatak_fnc_convert_to_clafghan;
|
||||||
|
};
|
||||||
default {
|
default {
|
||||||
_warning = format ["<t color='#FF8021'>ARMATAK</t><br/> %1", "Unsupported Map"];
|
_warning = format ["<t color='#FF8021'>ARMATAK</t><br/> %1", "Unsupported Map"];
|
||||||
[[_warning, 1.5]] call CBA_fnc_notify;
|
[[_warning, 1.5]] call CBA_fnc_notify;
|
||||||
|
|||||||
@@ -116,6 +116,9 @@ class CfgFunctions {
|
|||||||
class convert_to_colombia {
|
class convert_to_colombia {
|
||||||
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_colombia.sqf";
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_colombia.sqf";
|
||||||
};
|
};
|
||||||
|
class convert_to_clafghan {
|
||||||
|
file = "\armatak\armatak\addons\main\functions\map\fn_convert_to_clafghan.sqf";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
23
addons/main/functions/map/fn_convert_to_clafghan.sqf
Normal file
23
addons/main/functions/map/fn_convert_to_clafghan.sqf
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
params["_latitude", "_longitude", "_altitude"];
|
||||||
|
|
||||||
|
_playerPosition = [_latitude, _longitude, _altitude];
|
||||||
|
|
||||||
|
_playerLatitude = _playerPosition select 0;
|
||||||
|
_playerLongitude = _playerPosition select 1;
|
||||||
|
|
||||||
|
_playerMaxLatitude = 20480;
|
||||||
|
_playerMaxLongitude = 20480;
|
||||||
|
|
||||||
|
_MapMaxLatitude = 33.728772;
|
||||||
|
_MapMinLatitude = 33.542815;
|
||||||
|
|
||||||
|
_MapMaxLongitude = 63.169746;
|
||||||
|
_MapMinLongitude = 62.938820;
|
||||||
|
|
||||||
|
_LongitudeDifference = _MapMaxLongitude - _MapMinLongitude;
|
||||||
|
_LatitudeDifference = _MapMaxLatitude - _MapMinLatitude;
|
||||||
|
|
||||||
|
_RealLongitude = (_playerLongitude / _playerMaxLongitude) * _LongitudeDifference + _MapMinLongitude;
|
||||||
|
_RealLatitude = (_playerLatitude / _playerMaxLatitude) * _LatitudeDifference + _MapMinLatitude;
|
||||||
|
|
||||||
|
[_RealLongitude, _RealLatitude, _playerPosition select 2]
|
||||||
Reference in New Issue
Block a user