Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (! isDedicated) then {
- if (isnil "glt_gpsDispLevel") then {glt_gpsDispLevel = 150};
- if (isnil "GLT_GPSMARKERTYPE") then {GLT_GPSMARKERTYPE = "GLT_GPSINSmarker"};
- if (isnil "glt_hideGPSobject") then {
- glt_hideGPSobject = {
- private ["_plane"];
- _plane = _this select 0;
- while {(alive _plane) and ((player == (driver _plane)) or (player == (gunner _plane)))} do {
- private ["_hide"];
- if (getNumber (configFile >> "cfgWeapons" >> currentweapon _plane >> "GLT_isGPSguided") == 1) then {_hide = false} else {_hide = true};
- GLT_GPSINStarget hideObject _hide;
- sleep 0.333;
- };
- };
- };
- if (isnil "glt_initDialog") then {
- glt_initDialog = {
- if (local player) then {
- private ["_pos", "_display", "_mycontrol"];
- onMapSingleClick "[_pos] call glt_gpsSetMarker";
- disableSerialization;
- _display = findDisplay 3330;
- _mycontrol = _display displayCtrl 3358;
- _mycontrol ctrlsettext (str glt_gpsDispLevel);
- _mycontrol ctrlcommit 0;
- if (GLT_GPSMARKERTYPE == "GLT_GPSINSmarker") then {call glt_gpsDisplaySetDirMode} else {call glt_gpsDisplaySetDispMode};
- };
- };
- };
- if (isnil "glt_gpsDisplaySetDispMode") then {
- glt_gpsDisplaySetDispMode = {
- if (local player) then {
- private ["_display", "_mycontrol"];
- _display = findDisplay 3330;
- _mycontrol1 = _display displayCtrl 3355;
- _mycontrol2 = _display displayCtrl 3356;
- _mycontrol2 ctrlsettextcolor [0.1,1,0.1,0.8];
- _mycontrol1 ctrlsettextcolor [0.4,0.4,0.4,0.5];
- _mycontrol1 ctrlcommit 0;
- _mycontrol2 ctrlcommit 0;
- GLT_GPSMARKERTYPE = "GLT_GPSINSmarkerHigh";
- if (!isnil "GLT_GPSINSmarker") then {GLT_GPSINSmarker setMarkerTypeLocal "GLT_GPSINSmarkerHigh"};
- if (!isnil "GLT_GPSINStarget") then {GLT_GPSINStarget setPosATL [getPosATL GLT_GPSINStarget select 0, getPosATL GLT_GPSINStarget select 1, glt_gpsDispLevel]};
- };
- };
- };
- if (isnil "glt_gpsDisplaySetDirMode") then {
- glt_gpsDisplaySetDirMode = {
- if (local player) then {
- private ["_display", "_mycontrol"];
- _display = findDisplay 3330;
- _mycontrol1 = _display displayCtrl 3355;
- _mycontrol2 = _display displayCtrl 3356;
- _mycontrol1 ctrlsettextcolor [0.1,1,0.1,0.8];
- _mycontrol2 ctrlsettextcolor [0.4,0.4,0.4,0.5];
- _mycontrol1 ctrlcommit 0;
- _mycontrol2 ctrlcommit 0;
- GLT_GPSMARKERTYPE = "GLT_GPSINSmarker";
- if (!isnil "GLT_GPSINSmarker") then {GLT_GPSINSmarker setMarkerTypeLocal "GLT_GPSINSmarker"};
- if (!isnil "GLT_GPSINStarget") then {GLT_GPSINStarget setPosATL [getPosATL GLT_GPSINStarget select 0, getPosATL GLT_GPSINStarget select 1, (random 3)]};
- };
- };
- };
- if (isnil "glt_gpsSetMarker") then {
- glt_gpsSetMarker = {
- private ["_pos"];
- if (local player) then {
- _pos = _this select 0;
- if (count _this == 0) exitWith {};
- deleteMarkerLocal "glt_airgpsmarker";
- GLT_MapClickMarker = createMarkerLocal ["glt_airgpsmarker",_pos];
- "glt_airgpsmarker" setMarkerPosLocal _pos;
- "glt_airgpsmarker" setMarkerColorLocal "ColorBlack";
- "glt_airgpsmarker" setMarkerTypeLocal "waypoint";
- "glt_airgpsmarker" setMarkerTextLocal format [" %1",(mapGridPosition _pos)];
- };
- };
- };
- if (isnil "glt_gpsMarkPos") then {
- glt_gpsMarkPos = {
- if (local player) then {
- if !(isnil "GLT_MapClickMarker") then {
- private ["_pos", "_markertype", "_zz"];
- if (!isnil "GLT_GPSINSmarker") then {deleteMarkerLocal GLT_GPSINSmarker};
- if (!isnil "GLT_GPSINStarget") then {deleteVehicle GLT_GPSINStarget};
- _pos = getMarkerPos "glt_airgpsmarker";
- deleteMarkerLocal "glt_airgpsmarker";
- GLT_GPSINSmarker = createMarkerLocal ["GLT_GPSINSmarker", _pos];
- "GLT_GPSINSmarker" setMarkerShapeLocal "ICON";
- "GLT_GPSINSmarker" setMarkerTypeLocal GLT_GPSMARKERTYPE;
- "GLT_GPSINSmarker" setMarkerColorLocal "ColorYellow";
- "GLT_GPSINSmarker" setMarkerTextLocal format [" %1", (mapGridPosition _pos)];
- if (GLT_GPSMARKERTYPE == "GLT_GPSINSmarkerHigh") then {_zz = glt_gpsDispLevel} else {_zz = random 3};
- GLT_GPSINStarget = "GLT_GPStarget" createVehicleLocal [_pos select 0, _pos select 1, _zz];
- GLT_GPSINStarget setPosATL [_pos select 0, _pos select 1, _zz];
- //player dotarget GLT_GPSINStarget;
- GLT_GPSINStarget enableSimulation false;
- };
- };
- };
- };
- if (isnil "glt_gpsCenterOnPlayer") then {
- glt_gpsCenterOnPlayer = {
- if (local player) then {
- disableSerialization;
- private ["_pos","_map","_zoom"];
- _pos = [];
- _pos = position player;
- _pos resize 2;
- _map = (findDisplay 3330) displayCtrl 3330;
- _zoom = ctrlMapScale _map;
- ctrlMapAnimClear _map;
- _map ctrlMapAnimAdd [0.1,_zoom,_pos];
- ctrlMapAnimCommit _map;
- waitUntil {ctrlMapAnimDone _map};
- ctrlMapAnimClear _map;
- };
- };
- };
- if (isnil "glt_gpsClear") then {
- glt_gpsClear = {
- if (local player) then {
- deleteMarkerLocal "glt_airgpsmarker";
- if (!isnil "GLT_GPSINSmarker") then {deleteMarkerLocal GLT_GPSINSmarker};
- if (!isnil "GLT_GPSINStarget") then {deleteVehicle GLT_GPSINStarget};
- player dowatch objNull;
- };
- };
- };
- if (isnil "glt_gpsCenterOnMarker") then {
- glt_gpsCenterOnMarker = {
- if (local player) then {
- disableSerialization;
- private ["_pos","_map","_zoom"];
- _pos = [];
- _pos = getMarkerPos "GLT_GPSINSmarker";
- _pos resize 2;
- _map = (findDisplay 3330) displayCtrl 3330;
- _zoom = ctrlMapScale _map;
- ctrlMapAnimClear _map;
- _map ctrlMapAnimAdd [0.1,_zoom,_pos];
- ctrlMapAnimCommit _map;
- waitUntil {ctrlMapAnimDone _map};
- ctrlMapAnimClear _map;
- };
- };
- };
- if (isnil "glt_gpsExit") then {
- glt_gpsExit = {
- if (local player) then {
- onMapSingleClick "";
- deleteMarkerLocal GLT_MapClickMarker;
- };
- };
- };
- if (isnil "glt_gpsSetHeight") then {
- glt_gpsSetHeight = {
- _toAdd = _this select 0;
- _limitLow = _this select 1;
- _limitHi = _this select 2;
- glt_gpsDispLevel = ((glt_gpsDispLevel + _toAdd) max _limitLow) min _limitHi;
- if ((!isnil "GLT_GPSINStarget") and ((getposATL GLT_GPSINStarget select 2) > 10)) then {
- GLT_GPSINStarget setPosATL [getPosATL GLT_GPSINStarget select 0, getPosATL GLT_GPSINStarget select 1, glt_gpsDispLevel];
- };
- _display = findDisplay 3330;
- _mycontrol = _display displayCtrl 3358;
- _mycontrol ctrlsettext (str glt_gpsDispLevel);
- _mycontrol ctrlcommit 0;
- };
- };
- if (isnil "GLT_createBomblets") then {
- GLT_createBomblets = {
- if ((getNumber (configFile >> "cfgWeapons" >> (_this select 1) >> "GLT_bomblets")) > 0) then {
- _this spawn {
- private ["_bomb", "_pos", "_vel", "_i", "_h", "_velrand", "_type", "_numb"];
- _bomb = _this select 5;
- //_bomb = nearestObject [position (_this select 0),(_this select 4)];
- _type = getText (configFile >> "cfgWeapons" >> (_this select 1) >> "GLT_bombletType");
- _numb = getNumber (configFile >> "cfgWeapons" >> (_this select 1) >> "GLT_bomblets");
- while {alive _bomb} do {
- _pos = getPosATL _bomb;
- _vel = velocity _bomb;
- sleep 0.01;
- };
- if ((_pos select 2) > 40) then {
- for [{_i=0},{_i<_numb},{_i=_i+1}] do {
- _h = createvehicle [_type,_pos,[],2,"CAN_COLLIDE"];
- _velrand = ((_vel select 0) + (_vel select 1))/5;
- _h setvelocity [(_vel select 0)+(random _velrand) -(random _velrand),(_vel select 1)+(random _velrand) -(random _velrand),(_vel select 2)+random 5.0-random 5.0];
- sleep (0.05 + (random 0.05));
- };
- };
- };
- };
- };
- };
- if (isnil "GLT_GPSAutoPilot") then {
- GLT_GPSAutoPilot = {
- if ((player != vehicle player) && (player == driver (vehicle player))) then {
- private ["_plane", "_vecDir", "_vecUp"];
- _plane = vehicle player;
- _vecUp = vectorUp _plane;
- GLT_AutoPilot = true;
- while {GLT_AutoPilot} do {
- if (((inputAction "heliForward") + (inputAction "heliBack") + (inputAction "heliCyclicLeft") + (inputAction "heliCyclicRight")) > 0.01) exitwith {GLT_AutoPilot = false};
- if ((_vecUp select 0) < -0.0021) then {_vecUp set [0, (_vecUp select 0) + ((abs (ln ((_vecUp select 0)+ 1)))/50)]};
- if ((_vecUp select 0) > 0.0021) then {_vecUp set [0, (_vecUp select 0) - ((abs (ln ((_vecUp select 0)+ 1)))/50)]};
- if ((_vecUp select 1) < -0.0021) then {_vecUp set [1, (_vecUp select 1) + ((abs (ln ((_vecUp select 1)+ 1)))/50)]};
- if ((_vecUp select 1) > 0.0021) then {_vecUp set [1, (_vecUp select 1) - ((abs (ln ((_vecUp select 1)+ 1)))/50)]};
- _plane setVectorUp _vecUp;
- sleep 0.025;
- };
- };
- };
- };
- waitUntil {!isNull player};
- if (((vehicle player) iskindof "Air") and ((player == (driver (vehicle player))) or (player == (gunner (vehicle player))))) then {
- _nul = [(vehicle player)] spawn glt_hideGPSobject;
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement