refactor(client/vehicle): move variables to top

This commit is contained in:
Andyyy7666
2023-08-30 22:17:00 +02:00
parent 8cc7be3e4b
commit c701622172

View File

@@ -185,6 +185,22 @@ local vehicleClassNames = {
[22] = "Open wheel"
}
local cruiseSpeedSet = 0
local cruiseSpeedVehicle = 0
local cruiseControlEnabled = false
local playerVehicle = cache.seat == -1 and cache.vehicle
local cloudTime = GetCloudTimeAsInt()
local vehicleLockCheckTime = {
lastCheck = cloudTime,
lastUse = cloudTime
}
local keyCheckTime = {
lastCheck = cloudTime,
hasKey = false
}
local vehicleClassNotDisableAirControl = {
[8] = true, --motorcycle
[13] = true, --bicycles
@@ -348,17 +364,6 @@ lib.callback.register("ND_Vehicles:getVehicleModelMakeLabel", function(model)
return ("%s %s"):format(make, name)
end)
local playerVehicle = cache.seat == -1 and cache.vehicle
local cloudTime = GetCloudTimeAsInt()
local vehicleLockCheckTime = {
lastCheck = cloudTime,
lastUse = cloudTime
}
local keyCheckTime = {
lastCheck = cloudTime,
hasKey = false
}
local function hasVehicleKeys(veh)
local state = Entity(veh).state
if Config.ox_inventory and Config.useInventoryForKeys then
@@ -632,10 +637,6 @@ exports("keyControl", function(action, slot)
end
end)
local cruiseSpeedSet = 0
local cruiseSpeedVehicle = 0
local cruiseControlEnabled = false
local function cruiseControl()
cruiseSpeedVehicle = GetEntitySpeed(playerVehicle) * 2.236936
if not playerVehicle then