🚘GARAGES

  1. Creating new Garage (Example)

Config.Garage.Zones = {
    ['Mission_Row'] = {
        zoneType = 'box', -- box / poly (if poly you need to create points, https://overextended.dev/ox_lib/Modules/Zones/Shared)
        garageType = 'cars', -- cars / planes / boats
        coords = vector3(437.02, -1022.42, 28.66), -- coords of box
        size = vector3(15.2, 25, 10), -- size of box
        rotation = 7.0, -- rotation
        jobs = {['police'] = 0}, -- which job and from which grade
        canInteract = function() -- you can add this if you want to check anything other than job
           if ESX.PlayerData.org == 'org1' then
              return true
           end
           return false
        end,
        spawns = {
            vector4(445.9929, -1026.2607, 28.6509, 189.3484), -- spawn point vec4
        },
        blip = {sprite = 473, display = 2, color = 38, scale = 0.75, name = 'Garage'}
    },
}
```
  1. Generate VIN

If you dont have VIN on your server, there is export to generate it. Use this in your vehicle shop.

exports['piotreq_phone']:GenerateVIN()

-- USAGE EXAMPLE
MySQL.Async.execute('INSERT INTO owned_vehicles (owner, plate, vehicle, stored, vin) VALUES (@owner, @plate, @vehicle, @stored, @vin)',
  {
      ['@owner'] = xPlayer.identifier,
      ['@plate'] = props.plate,
      ['@vehicle'] = json.encode(props),
      ['@stored'] = 0,
      ['@vin'] = exports['piotreq_phone']:GenerateVIN(),
  }, function(rowsChanged)
    cb('ok')
end)
  1. You can check if vehicle with vin already exist

  • vin string

exports['piotreq_phone']:VinExist(vin) -- return true | false
  1. (NEW) You can set second owner of vehicle

  • plate string

  • identifier string

exports['piotreq_phone']:SetSecondOwner(plate, identifier) -- true | false
  1. (NEW) You can check if vehicle has second owner

  • plate string

exports['piotreq_phone']:hasSecondOwner(plate) -- identifier | false

Last updated