UZ Scripts
uz_AutoShot

Exports

Lua client exports that return uz_AutoShot photo URLs for use in other FiveM scripts.

Lua Exports

All exports are client-side and return strings synchronously. The URLs use FiveM's cfx-nui protocol, so any resource's NUI can render them directly with <img src="...">. No HTTP request, no base64, no port forwarding.

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

dependencies { 'uz_AutoShot' }

The exports only build URLs, they do not check that the file exists. Show a placeholder when the image fails to load (see Missing Photos).


getPhotoURL

Returns the URL of a 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 id (1-11), prop id (0, 1, 2, 6, 7), or overlay index (0-11)
drawablenumberDrawable index
texturenumberTexture index. Ignored for overlays

Texture 0 (or nil) maps to <drawable>.<ext>, anything above to <drawable>_<texture>.<ext>, the same names as the files on disk. Textures above 0 only exist if you captured with Customize.CaptureAllTextures = true.

Examples:

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

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

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

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

getTattooURL

Returns the URL of a tattoo photo. Added in 2.3.0.

exports['uz_AutoShot']:getTattooURL(gender, collection, overlay)
ParameterTypeDescription
genderstring'male' or 'female'
collectionstringTattoo collection, as in the tattoo list (e.g. 'mpbeach_overlays')
overlaystringOverlay name for that gender, as in the tattoo list (hashMale / hashFemale)

Pass the names exactly as they appear in the list. Tattoo files are stored lowercased, so the URL works on Windows and Linux hosts.

Example:

local url = exports['uz_AutoShot']:getTattooURL('male', 'mpbeach_overlays', 'MP_Bea_M_Back_000')
-- → 'https://cfx-nui-uz_AutoShot/shots/male/tattoos/mpbeach_overlays/mp_bea_m_back_000.png'

getVehiclePhotoURL

Returns the URL of 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 URL of a world object 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'

getShotsBaseURL

Returns the base URL of the shots directory, without a trailing slash.

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

Use it with getPhotoFormat to build URLs in your own NUI, for example when a UI renders hundreds of thumbnails and you do not want one export call per item:

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

getPhotoFormat

Returns the file extension of the saved photos.

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

This is always 'png' while Customize.TransparentBg is on, otherwise Customize.ScreenshotFormat.


Removed in 2.1.0

Version 2.1.0 replaced the bundled HTTP server with latent events. These no longer exist:

RemovedUse instead
HTTP API on port 3959 (/api/manifest, /api/exists, /api/stats)Build URLs with the exports above; handle missing files with an onError fallback
getManifestURLgetShotsBaseURL + getPhotoFormat
getServerPortNot needed, photos are served over cfx-nui
uz_autoshot:getManifest / uz_autoshot:manifestResult server eventsNot needed, photo paths follow a fixed naming scheme
Customize.BackendURLNot needed

Scripts written against the old HTTP API need to switch to the exports. Photos are still served from https://cfx-nui-uz_AutoShot/shots/.... Texture 0 files are named <drawable>.<ext>: getPhotoURL before 2.2.0 (and older versions of these docs) added a _0 suffix that never matched a file.

On this page