This script is roleplay focused: it gives your players’ vehicles a value and adds degradation, which makes it important to buy new vehicles or keep used ones maintained.
How to start a car
- Press G to turn the key and put the vehicle in ignition state.
- Hold G to start the engine.
The key can be changed in cl_config.lua.
RP possibilities
- New vehicles matter more because their engine starts fast.
- Used vehicles lose value, even when modded, because of a slower engine start or engine damage based on mileage and missing maintenance.
- Mechanics can maintain used vehicles to keep engine start time and engine damage low.
- Vehicles that are not repaired take much longer to start, which gives cops a better chance of catching robbers.
Features
- Start time grows with the mileage since the last start fix, in steps you define in
cl_config.lua - Maximum engine health drops with the mileage since the last engine fix, also configurable
- Mechanic commands
/fixengineand/fixstart, protected by ace permissions - Optional owner-only ignition and engine start: call
TriggerEvent('vehicle_system:setOwner', source, plate)from your vehicle shop after a purchase - Owner identifier type selectable in
sv_config.lua(steam, license or fivem) - Vehicle data (mileage, checks, owner) is stored in the
carsystemtable and saved automatically at a set interval
Preview
- Car ignition and start/lights showcase: start_trailer_high_end_car
- Engine damage and start fix: fix_engine_and_start
Requirements
- MySQL Async Library
- No framework calls are used in the package; ownership works through player identifiers.
- Note: according to the included readme, the script asks for a license key in
sv_config.luaand verifies the server IP on first start.
Installation
- Import
db.sqlinto your database (usedb-update.sqlinstead when updating from an older version). - Copy the
codev_vehsystemfolder into your resources directory. Do not rename it. - Add
ensure codev_vehsystemto your server.cfg after mysql-async. - Give mechanics or admins the ace permissions, for example
add_ace group.admin codev_vehsystem allow.