Vehicle Data Structure
Vehicles stored in the database have the following structure:Type Constants
Owner Types
Owner type determines who owns the vehicle.| Value | Type | Description |
|---|---|---|
| 0 | Character | Owned by a player character |
| 1 | Fleet | Owned by a job/faction |
Storage Types
Storage type determines where the vehicle is stored.| Value | Type | Description |
|---|---|---|
| 0 | Impound | Vehicle impounded with fine |
| 1 | Garage | Public/job garage |
| 2 | Property | Private property garage |
Vehicle Types
Vehicle type determines handling and storage locations.| Value | Type | Description |
|---|---|---|
| 0 | Car/Truck | Standard ground vehicles |
| 1 | Boat | Watercraft |
| 2 | Aircraft | Planes and helicopters |
Vehicle Properties
Vehicle customization properties follow the standard FiveM format:Vehicle Entity State
Spawned vehicles have state stored inEntity(vehicle).state:
Core State Fields
Accessing Vehicle State
Server Side:Garage Configuration
Garages are defined inshared/vehicleStorage.lua:
Garage Example (Public)
Garage Example (Job Fleet)
Garage Example (Boat Dock)
Garage Example (Helipad)
Impound Configuration
Impound system configuration inshared/vehicleImpound.lua:
Impound Levels
Police can impound vehicles at different severity levels: Level 1: Minor Violation- Fine: $2,000
- Holding: 0 hours (immediate retrieval)
- Fine: $3,500
- Holding: 6 hours
- Fine: $5,000
- Holding: 12 hours
- Fine: $8,500
- Holding: 24 hours
- Fine: $750
- Holding: 0 hours
Vehicle Identification
VIN Generation
VINs are auto-generated for owned vehicles:Plate Generation
License plates are auto-generated:Best Practices
Always Check VIN Exists
Always Check VIN Exists
Before performing vehicle operations:
Verify Ownership Before Actions
Verify Ownership Before Actions
Check ownership before allowing actions:
Use Entity State for Real-Time Data
Use Entity State for Real-Time Data
Entity state is synced automatically:
Save Before Deletion
Save Before Deletion
Always save vehicle before deleting:
Handle Fleet Access Properly
Handle Fleet Access Properly
Check grade level and workplace: