📃
Docs
  • 👋Welcome
  • 🌉Bridge
    • 💾Installation
    • 🌐Compatibility
    • 👨Client exports
      • ⏩Framework
        • getName
        • getJob
        • TriggerServerCallback
        • getSex
      • 🎒Inventory
        • getItemCount
      • 👁️Target
    • 🖥️Server exports
      • 🗃️Database
        • getUserData
        • getVehicleData
      • 🎒Inventory
        • openInventory
        • addItem
        • removeItem
        • canCarryItem
        • getItemCount
        • registerStash
        • setDurability
      • ⏩Framework
        • getPlayerFromId
        • getPlayerFromIdentifier
        • getIdentifier
        • RegisterServerCallback
        • getSource
        • getName
        • getJob
        • getAllPlayers
        • setJob
        • doesJobExist
        • getCoords
        • getJobs
  • 🔫Organization Panel
    • 📝Configuration
    • 💾Installation
    • 🗃️Framework integration
      • 💼ESX
        • 🚪ox_doorlock usage
      • 💼QBCore
        • 🚪ox_doorlock usage
      • 💼Other framework
    • 💻Server
      • Server exports
      • Server events
    • 👨Client
      • Client exports
  • ♣️Bossmenu
    • 📝Configuration
    • 💾Installation
    • 📖Framework integration
      • 🖼️ESX
      • 🖼️QBCore & QBOX
      • 🖼️Other Framework
    • 🖥️Server
      • 🔁Events
      • 🔃Exports
    • 👨Client
      • 🔁Events
      • 🔃Exports
  • 🕺Adjust Animation
    • 🗒️Configuration
    • 💾Installation
    • 📚Other scripts integration
      • 💃scully_emotemenu
      • 💃rpemotes
      • 💃other
  • 👮Police MDT
    • 🚀Install & Setup Guide
    • 📝Configuration
    • 📖Framework integration
      • 🖼️ESX
      • 🖼️QBOX/QB-Core
      • 🖼️Other Framework
    • 🚨wk_wars_2x Integration
    • 📚Exports
      • 🔃Server
      • 👨Client
  • 👨‍💼DOJ MDT
    • 🚀Install & Setup Guide
    • 📝Configuration
    • 📚Exports
      • 👨Client
  • 🩺EMS MDT
    • 🚀Install & Setup Guide
    • 📝Configuration
    • 📚Exports
      • 🔃Server
      • 👨Client
Powered by GitBook
On this page

Was this helpful?

  1. Bridge
  2. Server exports
  3. Database

getVehicleData

Bridge.getVehicleData(args, additionalColumns, callback)

Arguments

  • args (table): Conditions for searching the vehicle. The key "owner" corresponds to "citizenid".

  • additionalColumns (table, optional): Additional columns to return. Can include aliases in the format "column as alias".

  • callback (function): Callback function that will receive the vehicle data.

Returns

  • vehicles (table): An array containing vehicle data, including owner (owner's data), plate, hash, stored, and other columns if specified.

Example Usage

Bridge.getVehicleData({ owner = "citizenid123" }, { 'color', 'insurance as ins' }, function(vehicles)
    for _, vehicle in ipairs(vehicles) do
        print("Vehicle Plate: " .. vehicle.plate)
        print("Vehicle Owner: " .. vehicle.owner.name)
        print("Vehicle Color: " .. vehicle.color)
        print("Vehicle Insurance: " .. vehicle.ins)
    end
end)

Return Structure

If vehicles are found:

{
    {
        owner = {
            identifier = "citizenid123",
            name = "John Doe",
            dob = "1990-01-01",
            sex = "male"
        },
        plate = "ABC123",
        hash = "hash123",
        stored = true,
        color = "red",
        ins = "insurance data"
    }
}

If vehicles are not found:

{}
PreviousgetUserDataNextInventory

Last updated 11 months ago

Was this helpful?

🌉
🖥️
🗃️