mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 15:23:28 +00:00
added altis game location to real location support
This commit is contained in:
12
addons/main/functions/map/fn_convert_location.sqf
Normal file
12
addons/main/functions/map/fn_convert_location.sqf
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
params["_unit"];
|
||||||
|
|
||||||
|
_location = null;
|
||||||
|
|
||||||
|
switch (worldName) do {
|
||||||
|
case "Altis": {
|
||||||
|
_location = [_unit] call armatak_fnc_convert_to_altis;
|
||||||
|
};
|
||||||
|
default { };
|
||||||
|
};
|
||||||
|
|
||||||
|
_location
|
||||||
24
addons/main/functions/map/fn_convert_to_altis.sqf
Normal file
24
addons/main/functions/map/fn_convert_to_altis.sqf
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
params["_unit"];
|
||||||
|
|
||||||
|
_playerPosition = getPos _unit;
|
||||||
|
|
||||||
|
_playerLatitude = _playerPosition select 0;
|
||||||
|
_playerLongitude = _playerPosition select 1;
|
||||||
|
|
||||||
|
_playerMaxLongitude = 30720;
|
||||||
|
_playerMaxLatitude = 30720;
|
||||||
|
|
||||||
|
_MapMaxLatitude = 25.481608;
|
||||||
|
_MapMinLatitude = 25.011719;
|
||||||
|
|
||||||
|
_MapMaxLongitude = 40.095572;
|
||||||
|
_MapMinLongitude = 39.717094;
|
||||||
|
|
||||||
|
_LongitudeDifference = _MapMaxLongitude - _MapMinLongitude;
|
||||||
|
_LatitudeDifference = _MapMaxLatitude - _MapMinLatitude;
|
||||||
|
|
||||||
|
|
||||||
|
_RealLongitude = ( _playerLongitude / _playerMaxLongitude ) * _LongitudeDifference + _MapMinLongitude;
|
||||||
|
_RealLatitude = ( _playerLatitude / _playerMaxLatitude ) * _LatitudeDifference + _MapMinLatitude;
|
||||||
|
|
||||||
|
[_RealLongitude,_RealLatitude]
|
||||||
Reference in New Issue
Block a user