Ocean Solutions
Scripts

Garage

This page provides all integration and configuration details for developers using the locked ocean_garage resource. Since the script is locked, only the configuration structure, exports, and integration usage are documented.


Dependencies

  • oxmysql
  • ocean-core
  • ox_lib (locale system used)

Ensure these resources start before ocean_garage:

ensure ox_lib
ensure oxmysql
ensure ocean-core
ensure ocean_garage

Configuration

The main configuration is located in:

config.lua

General Settings

Config.impoundPrice

Defines the price a player must pay to retrieve an impounded vehicle.

Config.impoundPrice = 500
SettingTypeDescription
impoundPricenumberCost to retrieve an impounded vehicle

Blip Configuration

Blips are predefined and reused across garages.

Car Blip

local carBlip = {
    text = "Garage | Auto",
    id = 524,
    color = 0,
    scale = 0.5,
}

Boat Blip

local boatBlip = {
    text = "Garage | Boten",
    id = 755,
    color = 0,
    scale = 0.7,
}

Aircraft Blip

local airportBlip = {
    text = "Garage | Vliegtuig",
    id = 307,
    color = 0,
    scale = 0.7,
}

Blip Fields

FieldTypeDescription
textstringBlip display name
idnumberBlip sprite ID
colornumberBlip color
scalenumberBlip size

Garage Types

The system supports three vehicle garage types:

  • Car garages
  • Boat garages
  • Aircraft garages

Each garage follows the same structure.


Car Garages

Defined in:

Config.carGarages = {}

Example:

{
    name = "Haven",
    type = "car",
 
    spawnMarker = vector3(201.5898, -3067.1487, 5.7756),
    storeMarker = vector3(204.6271, -3076.2620, 5.7743),
 
    blip = carBlip,
 
    spawnPoints = {
        vector4(204.6271, -3076.2620, 5.7743, 85.7869),
    }
}

Fields

FieldTypeDescription
namestringGarage name
typestringVehicle type
spawnMarkervector3Location to take vehicles out
storeMarkervector3Location to store vehicles
bliptable / nilMap blip configuration
spawnPointstableVehicle spawn positions

Boat Garages

Defined in:

Config.boatGarages = {}

Example structure:

{
    name = "Haven",
    type = "boat",
 
    spawnMarker = vector3(-721.29, -1324.53, 1.59),
    storeMarker = vector3(-711.89, -1338.33, 0.58),
 
    blip = boatBlip,
 
    spawnPoints = {
        vector4(-711.89, -1338.33, 0.58, 227.77),
    }
}

Structure is identical to car garages.


Aircraft Garages

Defined in:

Config.airplaneGarages = {}

Example:

{
    name = "Grapeseed Airport",
    type = "airplane",
 
    spawnMarker = vector3(2124.98, 4790.64, 41.11),
    storeMarker = vector3(2118.49, 4801.51, 41.18),
 
    blip = airportBlip,
 
    spawnPoints = {
        vector4(2118.49, 4801.51, 41.18, 112.60),
    }
}

Same structure as other garage types.


Spawn Points

Spawn points determine where vehicles appear when retrieved.

Format:

vector4(x, y, z, heading)
ValueDescription
XPosition X
YPosition Y
ZPosition Z
HeadingVehicle rotation

Multiple spawnpoints can be added:

spawnPoints = {
    vector4(1.0, 1.0, 1.0, 90.0),
    vector4(2.0, 2.0, 2.0, 180.0)
}

The script will automatically use available spots.


Adding a New Garage

Example to add within config.lua:

{
    name = "Custom Garage",
 
    type = "car",
 
    spawnMarker = vector3(0.0,0.0,0.0),
    storeMarker = vector3(5.0,5.0,5.0),
 
    blip = carBlip,
 
    spawnPoints = {
        vector4(10.0,10.0,10.0,90.0)
    }
}

Integration Notes

  • Vehicles automatically save state when stored
  • Garage availability is controlled by config
  • Blips are optional (set to nil to hide)
  • Multiple spawnpoints prevent vehicle collisions
  • Supports any framework compatible with Ocean Core

Best Practices

  • Always add at least 2 spawnpoints for busy garages
  • Avoid overlapping spawnpoints
  • Use blips only for public garages
  • Keep private garages without blips
  • Use correct vehicle type (car / boat / airplane)

Summary

Ocean Garage provides:

  • Multi-type vehicle storage
  • Config-based garage system
  • Unlimited garage locations
  • Automatic vehicle spawning
  • Impound system support
  • Framework independence

Developer Notes

This resource is configuration driven. All garage logic is handled internally.

You only need to:

  • Add garages
  • Configure spawnpoints
  • Adjust impound price

No internal modification is required.

On this page