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:

{}

Last updated