Vehicle Ownership System
A vehicle ownership system lets players buy, store, and insure cars. The standard stack: esx_vehicleshop (dealership), esx_garage (vehicle storage), and esx_vehiclekey (key system). Players visit a dealership (NPC or UI-based), browse available vehicles with prices, purchase with bank money, and the vehicle spawns in the dealership parking lot. Configure vehicle prices: economy cars € 5,000-20,000, sports cars € 50,000-200,000, supercars € 500,000-2,000,000.
Garage and Vehicle Storage
Vehicles are stored in garages when not in use. Configure garage locations at: apartments, houses, police stations, mechanic shops, and public parking lots. When a player deposits a vehicle, it's stored in the database and despawned. When retrieved, it spawns at the nearest garage. Key settings: max vehicles per player (recommend 5-10), garage impound system (police can impound illegally parked vehicles), and vehicle condition/repair costs on retrieval.
Housing System Setup
esx_housing or QB-Housing provides property ownership. Houses include: apartment buildings (entry-level, € 20,000-50,000), suburban homes (mid-tier, € 100,000-300,000), luxury homes (high-tier, € 500,000-1,000,000), and mansions (endgame, € 2,000,000+). Each house has: interior (configured with IPL interiors or custom MLO interiors), vehicle garage (linked to garage system), storage (linked to inventory system), and wardrobe (character clothing storage). Players can set spawn location to their owned property.
Furniture Placement System
A furniture system lets players customize their home interiors. Install a furniture placement script (like Interact or FFE). Players enter decoration mode, browse furniture catalog by category (living room, bedroom, kitchen, outdoor), place items with rotation and positioning controls, and save the layout to database. Key config: max furniture per house (recommend 50-100), furniture prices (€ 50-5000 per item), and premium furniture locked behind donation/vip ranks. Furniture stores add visual customization goals.
Property Business Integration
Properties can generate income: rent out spare rooms/apartments to other players (landlord system), set up home-based businesses (restaurant from garage, gym from basement), or property flipping (buy low, renovate, sell high). This creates an organic real estate market. Install a realtor job with MLS-style listing system. Configure property taxes (1-3% of home value per pay period) as a money sink that scales with wealth.
Database and Performance
Vehicle and housing data is stored in MySQL. Each vehicle is a row in the owned_vehicles table (~1-2 KB per vehicle). Each house is a row in the owned_housing table with JSON furniture data (~5-50 KB per house). For 64 players with average ownership: expect ~30-50 MB of vehicle+house data. Optimize by: indexing the owner column, archiving vehicles unused for 30+ days, and limiting furniture per house. Run vacuum/optimize on the database monthly.
FAQ
Related Tutorials
From the Blog
Was this guide helpful?
Join our Discord for more guides and direct help from our engineering team.
