Added Clafghan Map Support

This commit is contained in:
Valmo Trindade
2026-01-02 03:28:10 -03:00
parent 1bec26df8a
commit 8fe14dc18d
3 changed files with 45 additions and 16 deletions

View File

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

View File

@@ -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";
};
}; };
}; };
}; };

View 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]