UZ Scripts
uz_AutoShot

Exports & Events

Lua client exports and server-side events for integrating uz_AutoShot with 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 full HTTP URL for a specific clothing photo.

exports['uz_AutoShot']:getPhotoURL(gender, itemType, id, drawable, texture)
ParameterTypeDescription
genderstring'male' or 'female'
itemTypestring'component' or 'prop'
idnumberComponent/prop index (e.g. 11 for Tops)
drawablenumberDrawable variation index
texturenumberTexture variation index

Example:

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

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

getManifestURL

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

exports['uz_AutoShot']:getManifestURL(gender?, itemType?, id?)
ParameterTypeDescription
genderstring?'male' or 'female' (optional)
itemTypestring?'component' or 'prop' (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'

getShotsBaseURL

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

local base = exports['uz_AutoShot']:getShotsBaseURL()
-- → 'http://127.0.0.1:3959/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 = 1240,
    items = {
        { url = "...", file = "...", gender = "male", type = "component", id = 11, drawable = 5, texture = 0 },
        ...
    }
}

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

On this page