Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update client.lua #97

Merged
merged 5 commits into from
May 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions qbx_cruise/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,15 @@ local function TriggerCruiseControl()
end
end

RegisterCommand('togglecruise', function()
local vehicleClass = GetVehicleClass(cache.vehicle)

if cache.seat == -1 then
if vehicleClasses[vehicleClass] then
TriggerCruiseControl()
else
exports.qbx_core:Notify(locale('error.cruise_control_unavailable'), 'error')
local keybindCruiseControl = lib.addKeybind({name = 'toggle_cruise_control', description = 'Activer/Désactiver le régulateur de vitesse', defaultKey = 'Y',
Mesrine67 marked this conversation as resolved.
Show resolved Hide resolved
onPressed = function(self)
local vehicleClass = GetVehicleClass(cache.vehicle)
if cache.seat == -1 then
Mesrine67 marked this conversation as resolved.
Show resolved Hide resolved
if vehicleClasses[vehicleClass] then
TriggerCruiseControl()
else
exports.qbx_core:Notify(locale('error.cruise_control_unavailable'), 'error')
end
end
end
end, false)

RegisterKeyMapping('togglecruise', 'Toggle Cruise Control', 'keyboard', 'y')
})
Loading