mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-16 21:46:03 +01:00
refactor(client/vehicle): move variables to top
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user