UZ Scripts
uz_AutoShot

Exports & Events

Lua client exports and server-side events for integrating uz_AutoShot photos into other FiveM scripts.

Lua Exports

All exports are client-side and return values synchronously.

Add uz_AutoShot to your script's dependencies in fxmanifest.lua to guarantee it starts first:

dependencies { 'uz_AutoShot' }

getPhotoURL

Returns the cfx-nui URL for a specific clothing, prop, or overlay photo.

exports['uz_AutoShot']:getPhotoURL(gender, itemType, id, drawable, texture)
ParameterTypeDescription
genderstring'male' or 'female'
itemTypestring'component', 'prop', or 'overlay'
idnumberComponent, prop, or overlay index
drawablenumberDrawable variation index
texturenumberTexture variation index (ignored for overlays)

Examples:

local url = exports['uz_AutoShot']:getPhotoURL('male', 'component', 11, 5, 0)
-- → 'https://cfx-nui-uz_AutoShot/shots/male/11/5_0.png'

local propUrl = exports['uz_AutoShot']:getPhotoURL('female', 'prop', 0, 3, 0)
-- → 'https://cfx-nui-uz_AutoShot/shots/female/prop_0/3_0.png'

local overlayUrl = exports['uz_AutoShot']:getPhotoURL('male', 'overlay', 1, 3, 0)
-- → 'https://cfx-nui-uz_AutoShot/shots/male/overlay_1/3.png'

getVehiclePhotoURL

Returns the cfx-nui URL for a vehicle photo.

exports['uz_AutoShot']:getVehiclePhotoURL(modelName)
ParameterTypeDescription
modelNamestringVehicle model name (e.g. 'adder')

Example:

local url = exports['uz_AutoShot']:getVehiclePhotoURL('adder')
-- → 'https://cfx-nui-uz_AutoShot/shots/vehicles/adder.png'

getObjectPhotoURL

Returns the cfx-nui URL for an object/prop photo.

exports['uz_AutoShot']:getObjectPhotoURL(modelName)
ParameterTypeDescription
modelNamestringObject model name (e.g. 'prop_bench_01a')

Example:

local url = exports['uz_AutoShot']:getObjectPhotoURL('prop_bench_01a')
-- → 'https://cfx-nui-uz_AutoShot/shots/objects/prop_bench_01a.png'

getManifestURL

Returns the HTTP API URL for a category's manifest. Parameters are optional for broader results.

exports['uz_AutoShot']:getManifestURL(gender?, itemType?, id?)
ParameterTypeDescription
genderstring?'male' or 'female' (optional)
itemTypestring?'component', 'prop', or 'overlay' (optional)
idnumber?Category id (optional)

Examples:

-- Full manifest (all photos)
local all = exports['uz_AutoShot']:getManifestURL()
-- → 'http://127.0.0.1:3959/api/manifest'

-- All male photos
local male = exports['uz_AutoShot']:getManifestURL('male')
-- → 'http://127.0.0.1:3959/api/manifest/male'

-- Male tops only
local tops = exports['uz_AutoShot']:getManifestURL('male', 'component', 11)
-- → 'http://127.0.0.1:3959/api/manifest/male/component/11'

-- Male facial hair overlays
local beard = exports['uz_AutoShot']:getManifestURL('male', 'overlay', 1)
-- → 'http://127.0.0.1:3959/api/manifest/male/overlay/1'

getShotsBaseURL

Returns the base cfx-nui URL for the shots directory (without trailing slash).

local base = exports['uz_AutoShot']:getShotsBaseURL()
-- → 'https://cfx-nui-uz_AutoShot/shots'

Useful for building custom URLs:

local base = exports['uz_AutoShot']:getShotsBaseURL()
local fmt  = exports['uz_AutoShot']:getPhotoFormat()
local url  = base .. '/male/11/5_0.' .. fmt

getPhotoFormat

Returns the configured screenshot format.

local fmt = exports['uz_AutoShot']:getPhotoFormat()
-- → 'png' | 'webp' | 'jpg'

getServerPort

Returns the HTTP server port number.

local port = exports['uz_AutoShot']:getServerPort()
-- → 3959

Server-Side Events

For other server scripts that need manifest data without going through HTTP.

Request Manifest

-- Request all photos
TriggerEvent('uz_autoshot:getManifest')

-- Request filtered by gender
TriggerEvent('uz_autoshot:getManifest', 'male')

Receive Result

AddEventHandler('uz_autoshot:manifestResult', function(manifest)
    print('Total photos:', manifest.total)
    for _, item in ipairs(manifest.items) do
        print(item.url, item.gender, item.type, item.id, item.drawable)
    end
end)

Manifest structure:

{
    total = 2480,
    items = {
        { url = "...", file = "...", gender = "male", type = "component", id = 11, drawable = 5, texture = 0 },
        { url = "...", file = "...", gender = "unisex", type = "vehicle", id = 0, drawable = 0, texture = 0, model = "adder" },
        ...
    }
}

Server-side events are for server scripts only. For client-side access, use the Lua exports or HTTP API.

On this page