1.2.0
to update from previous versions to version 1.2.0, do these steps!
Information:
Vehicle Mileage Database UI
Interactive vehicle mileage database panel accessible in-game
Displays a list of vehicles with plate numbers and current mileage
Allows editing of vehicle data including:
Mileage
Last oil change
Last oil filter change
Last air filter change
Last tire change
Last brakes change and brake wear
Last clutch change and clutch wear
Last suspension change
Last spark plug change
Validation to ensure data consistency (e.g., last change values not exceeding mileage)
Supports deleting vehicles with user confirmation
Real-time updates and notifications for successful or failed operations
Custom confirmation modal for user actions


Mileage UI Customizer
Allows players to toggle visibility of mileage and wear displays
Provides sliders to adjust size of mileage meter and wear bars
Allows precise positioning of UI elements via X and Y coordinates inputs
Supports dragging UI elements to reposition them interactively
Saves player customization settings persistently
Enhances user experience with customizable and flexible UI layout

Added an oil can icon behind the mileage text in the UI
The icon is gray by default.
Turns yellow when any wear percentage is 50% or lower.
Turns red when any wear percentage is 10% or lower.
Flashes red when any wear percentage is 5% or lower.

Mileage meter display:
When mileage reaches 999.99 and above, the display switches to integer only (e.g., 1000, 1001, etc.)
Shows with two decimals when below 1000.
Shows integer with thousand separators (commas) when 1000 or above.
Added script exports
Added support for Quasar
and CodeM
inventory scripts
Quasar
and CodeM
inventory scriptsAdded support for QB Menu
and QBX Menu
QB Menu
and QBX Menu
Added option to fully disable each part's wear and affects
Added spark plugs and suspension system
Added update checker system
Added script files checker system
Performance improvements and bug fixes!
SQL updates
import the following code to your DataBase
ALTER TABLE `vehicle_mileage` ADD COLUMN `last_suspension_change` DOUBLE NOT NULL DEFAULT 0
ALTER TABLE `vehicle_mileage` ADD COLUMN `suspension_wear` DOUBLE NOT NULL DEFAULT 0
ALTER TABLE `vehicle_mileage` ADD COLUMN `original_suspension_force` FLOAT DEFAULT NULL
ALTER TABLE `vehicle_mileage` ADD COLUMN `original_suspension_raise` FLOAT DEFAULT NULL
ALTER TABLE `vehicle_mileage` ADD COLUMN `last_spark_plug_change` DOUBLE NOT NULL DEFAULT 0
ALTER TABLE `vehicle_mileage` ADD COLUMN `spark_plug_wear` DOUBLE NOT NULL DEFAULT 0
CREATE TABLE IF NOT EXISTS mileage_settings (
player_id VARCHAR(50) PRIMARY KEY,
mileage_visible BOOLEAN NOT NULL DEFAULT 1,
mileage_size FLOAT NOT NULL DEFAULT 1.0,
checkwear_size FLOAT NOT NULL DEFAULT 1.0,
mileage_pos_x FLOAT NOT NULL DEFAULT 0.0,
mileage_pos_y FLOAT NOT NULL DEFAULT 0.0,
checkwear_pos_x FLOAT NOT NULL DEFAULT 0.0,
checkwear_pos_y FLOAT NOT NULL DEFAULT 0.0
);
Config.lua update
Replace the
Config.ToggleCommand = 'togglemileage'-- Command to toggle mileage status
with
Config.CustomizeCommand = 'mileageui' -- Command to open UI customizer
Config.DatabaseCommand = 'mileagedb' -- Command to open saved vehicled list with data
Config.AdminRank = 'admin'
Replace the
Config.M_Location = 'bottom-right' -- Position of mileage display on screen: "top-left", "top-right", "bottom-left", "bottom-right"
with
Config.DefaultUI = { -- Default UI Settings for players
mileage_visible = 1, -- Mileage UI visibility, 1 = visible, 0 = hidden
mileage_size = 1, -- Scale of Mileage UI, 1 = default scale
checkwear_size = 1, -- Scale of CheckWear UI, 1 = default scale
mileage_pos_x = 1660, -- X position of Mileage UI
mileage_pos_y = 1012, -- Y position of Mileage UI
checkwear_pos_x = 1495.75, -- X position of CheckWear UI
checkwear_pos_y = 72.75 -- Y position of CheckWear UI
}
Add the following codes
Config.Menu = 'ox' -- Choose your menu: "ox" for ox_lib, "qb" for QBCore/QBox
Config.WearTracking = {
SparkPlugs = true, -- Track spark plug wear and update Database
Oil = true, -- Track oil/oilfilter wear and update Database
AirFilter = true, -- Track air filter wear and update Database
Tires = true, -- Track tire wear and update Database
Brakes = true, -- Track brake wear and update Database
Suspension = true, -- Track suspension wear and update Database
Clutch = true, -- Track clutch wear and update Database
}
Config.SparkPlugChangeDistance = 50 -- Distance in km/miles before spark plug change is needed
Config.MaxSparkPlugWear = 0.02 -- Maximum spark plug wear value
Config.ClutchWearRate = 0.1 -- How quickly clutch wears out during gear shifts
Config.MaxClutchWear = 100.0 -- Maximum clutch wear value
Config.ClutchEfficiencyLoss = 0.8 -- How much power is lost when clutch is worn (80%)
Config.BaseClutchForce = 1.0 -- Base clutch force multiplier
Config.StallChance = 0.4 -- Chance of engine stalling when clutch is worn (40%)
Config.Items = {
SparkPlug = "spark_plugs", -- Item name for spark plugs
EngineOil = "engine_oil", -- Item name for engine oil
OilFilter = "oil_filter", -- Item name for oil filter
AirFilter = "air_filter", -- Item name for air filter
Tires = "tires", -- Item name for tires
BrakeParts = "brake_parts", -- Item name for brake parts
SusParts = "suspension_parts", -- Item name for suspension parts
Clutch = "clutch", -- Item name for clutch
}
-- Configuration table for spark plug replacement interaction
Config.ChangeSparkPlug = {
Animation = "fixing_a_ped",
AnimationDict = "mini@repair",
Duration = 5000,
FreezeCar = true,
FreezePlayer = true,
Cancelable = true,
}
-- Configuration table for suspension service interaction
Config.ChangeSuspension = {
Animation = "car_bomb_mechanic",
AnimationDict = "mp_car_bomb",
Duration = 7000,
FreezeCar = true,
FreezePlayer = true,
Cancelable = true,
}
Inventory items
spark_plugs = { name = 'spark_plugs', label = 'Spark Plugs', weight = 500, type = 'item', image = 'spark_plugs.png', unique = false, useable = true, shouldClose = true, description = 'Vehicle spark plugs' },
suspension_parts = { name = 'suspension_parts', label = 'Suspension Parts', weight = 1500, type = 'item', image = 'suspension_parts.png', unique = false, useable = true, shouldClose = true, description = 'Vehicle suspension parts' },
Last updated