OrigenNetwork
Docs

Exports · origen_garages

All exports are registered under the resource name origen_garages. Sections below split them by execution side.


Server-side exports

impoundVehicle(plate)boolean

Sets a vehicle's state to IMPOUNDED in the framework's vehicle table.

lua
exports['origen_garages']:impoundVehicle(plate)
ParameterTypeDescription
platestringVehicle license plate

Example:

lua
RegisterCommand('impound', function(source, args)
    local plate = args[1]
    if plate then
        exports['origen_garages']:impoundVehicle(plate)
    end
end, true)

Client-side exports

openExternalGarage(id, coords)

Opens the garage UI for a garage with the given ID at custom coordinates. If the player is currently in a vehicle, it stores that vehicle into the garage instead of opening the retrieval UI.

lua
exports['origen_garages']:openExternalGarage(id, coords)
ParameterTypeDescription
idnumberDatabase ID of the garage to open
coordsvector3 | nilWorld coordinates used as the external spawn point

Example — open a garage from an ox_target interaction:

lua
exports['ox_target']:addBoxZone({
    coords = vector3(100.0, 200.0, 30.0),
    size = vector3(1.5, 1.5, 2.0),
    options = {
        {
            label = 'Open Garage',
            onSelect = function()
                exports['origen_garages']:openExternalGarage(1, vector3(100.0, 200.0, 30.0))
            end,
        }
    }
})

impoundVehicle(plate)boolean

Client-side wrapper — fires a server callback (origen_garages:cb:impoundVehicle) and awaits the result.

lua
exports['origen_garages']:impoundVehicle(plate)
ParameterTypeDescription
platestringVehicle license plate

toggleFurnitureMenu(state)

Opens or closes the furniture placement menu inside a garage interior.

lua
exports['origen_garages']:toggleFurnitureMenu(state)
ParameterTypeDescription
stateboolean | niltrue = open, false / nil = close

startDragCam(entity, radiusOptions)

Starts the vehicle inspection camera on the given entity. The player can rotate the camera with the mouse, zoom with the scroll wheel and toggle doors with Space.

lua
exports['origen_garages']:startDragCam(entity, radiusOptions)
ParameterTypeDescription
entityintegerVehicle entity handle to inspect
radiusOptionstable | nilOptional camera settings (see below)

radiusOptions fields:

FieldDefaultDescription
initial5.0Initial camera radius in meters
min2.5Minimum zoom distance
max10.0Maximum zoom distance
scrollIncrements0.5Zoom step per scroll tick
firstPersonEnabledfalseAllow toggling first-person view with V

Example:

lua
exports['origen_garages']:startDragCam(vehicle, {
    initial             = 6.0,
    min                 = 4.5,
    max                 = 8.0,
    scrollIncrements    = 0.3,
    firstPersonEnabled  = true,
})

stopDragCam()

Stops the inspection camera, fades the screen, destroys the camera and the spawned vehicle entity, and returns focus to the NUI.

lua
exports['origen_garages']:stopDragCam()