mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
fix that in UGV dont work speedLimiter
This commit is contained in:
parent
52a6eddb44
commit
5f2840bf39
@ -6,6 +6,14 @@ if (!hasInterface) exitWith {};
|
|||||||
// Add keybinds
|
// Add keybinds
|
||||||
["ACE3 Vehicles", QGVAR(speedLimiter), localize LSTRING(SpeedLimiter),
|
["ACE3 Vehicles", QGVAR(speedLimiter), localize LSTRING(SpeedLimiter),
|
||||||
{
|
{
|
||||||
|
private _connectedUAV = getConnectedUAV ACE_player;
|
||||||
|
private _uavControll = UAVControl _connectedUAV;
|
||||||
|
if ((_uavControll select 1) == "DRIVER") then {
|
||||||
|
if !(_connectedUAV isKindOf "UGV_01_base_F") exitWith {false};
|
||||||
|
GVAR(isUAV) = true;
|
||||||
|
[_uavControll select 0, _connectedUAV] call FUNC(speedLimiter);
|
||||||
|
true
|
||||||
|
} else {
|
||||||
// Conditions: canInteract
|
// Conditions: canInteract
|
||||||
if !([ACE_player, objNull, ["isnotinside"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
if !([ACE_player, objNull, ["isnotinside"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||||
// Conditions: specific
|
// Conditions: specific
|
||||||
@ -13,9 +21,12 @@ if (!hasInterface) exitWith {};
|
|||||||
{vehicle ACE_player isKindOf 'Car' ||
|
{vehicle ACE_player isKindOf 'Car' ||
|
||||||
{vehicle ACE_player isKindOf 'Tank'}}) exitWith {false};
|
{vehicle ACE_player isKindOf 'Tank'}}) exitWith {false};
|
||||||
|
|
||||||
|
GVAR(isUAV) = false;
|
||||||
// Statement
|
// Statement
|
||||||
[ACE_player, vehicle ACE_player] call FUNC(speedLimiter);
|
[ACE_player, vehicle ACE_player] call FUNC(speedLimiter);
|
||||||
true
|
true
|
||||||
|
};
|
||||||
|
|
||||||
},
|
},
|
||||||
{false},
|
{false},
|
||||||
[211, [false, false, false]], false] call cba_fnc_addKeybind; //DELETE Key
|
[211, [false, false, false]], false] call CBA_fnc_addKeybind; //DELETE Key
|
||||||
|
@ -36,8 +36,18 @@ _maxSpeed = speed _vehicle max 10;
|
|||||||
params ["_args", "_idPFH"];
|
params ["_args", "_idPFH"];
|
||||||
_args params ["_driver", "_vehicle", "_maxSpeed"];
|
_args params ["_driver", "_vehicle", "_maxSpeed"];
|
||||||
|
|
||||||
if (!GVAR(isSpeedLimiter) || {_driver != driver _vehicle}) exitWith {
|
if (GVAR(isUAV)) then {
|
||||||
|
private _uavControll = UAVControl _vehicle;
|
||||||
|
if ((_uavControll select 0) != _driver) then {
|
||||||
GVAR(isSpeedLimiter) = false;
|
GVAR(isSpeedLimiter) = false;
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
if (_driver != driver _vehicle) then {
|
||||||
|
GVAR(isSpeedLimiter) = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!GVAR(isSpeedLimiter)) exitWith {
|
||||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user