mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
refactor(client/vehicle): move variables to top
This commit is contained in:
@@ -185,6 +185,22 @@ local vehicleClassNames = {
|
|||||||
[22] = "Open wheel"
|
[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 = {
|
local vehicleClassNotDisableAirControl = {
|
||||||
[8] = true, --motorcycle
|
[8] = true, --motorcycle
|
||||||
[13] = true, --bicycles
|
[13] = true, --bicycles
|
||||||
@@ -348,17 +364,6 @@ lib.callback.register("ND_Vehicles:getVehicleModelMakeLabel", function(model)
|
|||||||
return ("%s %s"):format(make, name)
|
return ("%s %s"):format(make, name)
|
||||||
end)
|
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 function hasVehicleKeys(veh)
|
||||||
local state = Entity(veh).state
|
local state = Entity(veh).state
|
||||||
if Config.ox_inventory and Config.useInventoryForKeys then
|
if Config.ox_inventory and Config.useInventoryForKeys then
|
||||||
@@ -632,10 +637,6 @@ exports("keyControl", function(action, slot)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local cruiseSpeedSet = 0
|
|
||||||
local cruiseSpeedVehicle = 0
|
|
||||||
local cruiseControlEnabled = false
|
|
||||||
|
|
||||||
local function cruiseControl()
|
local function cruiseControl()
|
||||||
cruiseSpeedVehicle = GetEntitySpeed(playerVehicle) * 2.236936
|
cruiseSpeedVehicle = GetEntitySpeed(playerVehicle) * 2.236936
|
||||||
if not playerVehicle then
|
if not playerVehicle then
|
||||||
|
|||||||
Reference in New Issue
Block a user