AV Scripts
StoreDiscord
  • Documentation
  • Guides
    • Dealerships
      • Installation
      • Admin Panel
        • All Vehicles
        • Dealerships
        • Auctions
      • Dealership Panel
        • Overview
        • Auctions
        • Employees
        • Orders
        • Payments
        • Showroom
        • Warehouse
        • Pre Owned
        • Settings
      • Buy/Sell Vehicles
      • Catalogue
      • Exports
      • FAQ
    • House Robbery
      • Installation
      • Add Shells
      • Dispatch
      • Exports
      • Weather
      • Minigames
      • Notifications
      • New Houses
      • Object Types
      • Sell Items
    • Illegal Runs
      • Installation
      • Customization
      • Ox Inventory
      • QB Inventory
    • Multicharacter
      • Installation
      • Character Slots
      • Clothes
      • Scenes
        • Previews
      • Exports
      • Weather
    • Paleto Heist
      • Buy here
    • Refund System
      • Installation
        • Inventories
    • Tuning Script
      • Installation
      • Events and Controls
      • Exports
      • Price Multiplier
    • Vehicleshop
      • Installation
      • Admin Panel
      • Addon Vehicles
      • Functions
        • Fuel
        • Keys
        • VIP
        • Weather
      • Garages
      • HUD
      • Society
    • Weather Script
      • Installation
      • Breath Condensation
      • Fog
      • Real Time Sync
      • Exports
    • VIP Script
      • Installation
      • Exports
      • Categories
      • Admin
      • Tebex
      • Free Tokens
  • LAPTOP PACK V3
    • Laptop v3
      • Installation
        • Inventory
        • Cosmo
        • Permissions
        • QBCore
        • Custom Framework/Inventory
        • Phone
        • Translate
      • Browser
      • Terminal
      • Documents
      • APPs Config
      • Exports
    • Boosting
      • Create Profile
      • APP
      • Contracts
      • Dispatch
      • Lockpick Export
      • VIN Export
    • Business
      • Installation
        • Inventories
          • Origen Inventory
            • ESX
            • QBCore
          • OX Inventory
          • QB/PS/LJ Inventory
          • Quasar Inventory
            • ESX
            • QBCore
          • Codem Inventory
          • Tgiann Inventory
        • ESX
      • Admin Panel
        • Create Zones
        • Edit Zones
      • Config
        • Animations
        • Blips
        • Buttons
        • Crafting
        • Effects
        • Events
          • Items
          • Zones
        • Logs
          • Custom Logs
        • Permissions
      • Exports
      • Banking Scripts
      • Multijobs
    • Cameras
      • Installation
        • Vehicle Cameras
      • Place Camera
      • Job Cameras
    • Drugs
      • Installation
      • Admin Panel
      • APP
      • Tables
      • Labs
        • PC
        • Raids
      • Alert Cops
      • Shells
      • Exports
    • Gangs
      • Installation
      • Admin Panel
        • Gangs
        • Whitelist
      • Properties
      • Register Gang
      • APP
        • Members
        • Settings
        • Missions
        • Blackmarket
        • Properties
      • Graffitis
      • Missions
      • Gang NPC
      • Shells
      • Exports
      • Labs
    • Groups
      • Events
      • Exports
    • Music
      • Installation
      • Music Labels
      • APP
        • Search Music
        • Playlists
        • Headphones
      • CDs
    • Racing
      • Installation
        • Permissions
        • Discord Logs
        • Addon Vehicles
      • Admin Panel
      • Categories
      • Events
      • Exports
      • Personal Settings
      • The Underground
    • Custom APPs
    • Discord Support
Powered by GitBook
On this page
  1. Guides
  2. Vehicleshop

Garages

Last updated 5 months ago

My script don't rely on any garage script, it saves the vehicles directly into your Database using the default ESX and QB/Qbox columns.

I can't make my script "compatible" with all the Garages because there's more than 50 (no cap, I just search it on ).

So this is just a little "guide" to help you make the script "compatible" with your Garage script, of course all column names will vary from script to script.

If you have 0 clue on how database works please hire an experienced dev, use Fiverr or any other site where u can hire ppl.. I won't give you any support because this errors are not from my script.

Read Me

  • First thing you need to do, BUY A VEHICLE in your test server and verify your server console, if you don't have ANY error and you can save and retrieve your vehicle from your garage then you are OK, you don't need to do anything else.

  • If you server console looks something like this:

  • Let's read what the error is telling us:

Error: av_vehicleshop was unable to execute a query
Query: INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate, garage, state) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
-- A LOT OF INFO THAT WE DON'T CARE ABOUT ----
Unknown column 'garage' in 'field list'
  • The script tried to save the vehicle into your player_vehicles table (or owned_vehicles if using ESX) BUT the column garage does not exist in your table... oh wait, why!? Ah yes, because I'm using a different Garage script that altered my table and created/modified the default fields, let's fix it!

  • Go to your Database > player_vehicles (or owned_vehicles if using ESX), check your columns names:

  • The error was about an unknown column named 'garage'.... oh wait! there's no garage column BUT we have a column named parking that my Garage script uses to store the garage name where the vehicle is stored.

  • What should we do now? We need to change the query in av_vehicleshop/server/editable/buy.lua

  • Here you will find 2 queries, one for QB and one for ESX, modify the one that belongs to the Framework you are using, for this example I'm using QBCore so I will modify line 10 (for ESX is line 22):

  • Once we have identified what query we need to modify and what's the column giving us the "error" we need to replace it.

-- We modify the old query:
MySQL.insert('INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate, garage, state) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', {

-- Replacing the garage field with parking:
MySQL.insert('INSERT INTO player_vehicles (license, citizenid, vehicle, hash, mods, plate, parking, state) VALUES (?, ?, ?, ?, ?, ?, ?, ?)', {
  • Save the changes, restart av_vehicleshop and buy the vehicle again...

  • Did u got another column error? Let's repeat the steps we made for garage/parking but with this new column giving the error.

My script only register the vehicle into Database using the default Framework table structure, whatever happens after you spawn a vehicle from the garage it doesn't have anything to do with my script and is on you to solve it.

Fivem releases
This is just an EXAMPLE
I'm using heidi sql, your DB might look different if using phpmysql, etc