Skip to content

Releases: uz-scripts/uz_MugShot

Release list

v1.0.1

Choose a tag to compare

@k-faruk k-faruk released this 25 Oct 08:26

Changed

  • exports['MugShotBase64']:GetMugShotBase64 now falls back to GTA's hi-res headshot (128×128) for NPCs and players without a photo yet. 1.0.0 used RegisterPedheadshot, the same native as the original MugShotBase64, which turns out to be only 64×64. Fallback photos now match the 128×128 default size of stored photos.

Docs

  • 1.0.0 said GTA's headshot is 128×128. Measured in game, RegisterPedheadshot returns 64×64. The README now shows real captures of all three headshot natives next to uz_MugShot.

Upgrading

Replace the uz_MugShot folder, keep your config.lua and shots/. No other changes.

Docs: docs.uz-scripts.com/docs/free/uz-mugshot · Discord: discord.uz-scripts.com

v1.0.0

Choose a tag to compare

@k-faruk k-faruk released this 25 Oct 07:12

First public release. uz_MugShot takes a 512×512 transparent mugshot of every character the moment their look changes, and serves it to any script with one export. It replaces GTA's 128px headshot and works as a drop-in for MugShotBase64.

Highlights

  • Hands-free capture. The client fingerprints everything the camera sees (face, hair, makeup, upper body, hats, glasses) and compares it with the stored photo. A change made in any clothing, barber or skin script is captured as its menu closes, without adding code to that script. Pants and shoe changes are ignored.
  • Never in the way. Captures wait until no menu, script camera, fade, pause menu, cutscene or loading screen owns the screen. The player sees a curtain for about a second.
  • Studio quality. A clone of the ped is photographed in a chroma studio with fixed framing and lighting. The background is keyed on the server with soft edges and cleaned outlines.
  • Weather and time stay put. Renewed-Weathersync, qb-weathersync and qbx_weathersync are paused during the shot, and the clock and weather are restored afterwards.
  • Stored per character. Photos live in shots/<citizenid>/, no database needed. An in-memory cache, latent events and per-player rate limits keep it cheap.
  • Qbox, QBCore and ESX, auto-detected, including frameworks that start after uz_MugShot.
  • Update notice. The server console tells you when a newer release is out on GitHub.

Exports

  • GetPhotoDataURI(id) on server and client, with a citizenid, server ID or ped
  • GetPhotoByCitizenId(citizenid) on the client, for character selectors
  • CaptureAndReturn(id) for a fresh photo on ID card items
  • HasPhoto(id), ForceRecapture(id) and the /remugshot [id] admin command
  • TriggerInitialCapture(source), an optional spawn hook
  • uz_mugshot:captured server event to refresh open UIs when a photo changes

Coming from MugShotBase64

Remove MugShotBase64 and start uz_MugShot in its place. The manifest provides MugShotBase64, so every exports['MugShotBase64']:GetMugShotBase64(...) call keeps working:

  • Players get their stored photo scaled to Config.Compat.size, 128×128 by default. That keeps the string around 20 KB for scripts that save it in item metadata.
  • NPCs and players without a photo yet get GTA's native headshot, as before. The export never returns nil.

Install

  1. Download uz_MugShot.zip below and put the uz_MugShot folder in your resources. The folder name must stay exactly uz_MugShot.
  2. Add it to server.cfg after your framework:
    ensure screenshot-basic
    ensure yarn
    ensure uz_MugShot
    
    add_ace group.admin command.remugshot allow
    
  3. Start the server. Each character is photographed on their next login or appearance change.

Requires screenshot-basic, yarn and one of qbx_core, qb-core or es_extended.

Upgrading from an older build? Old shots/{cid}_mugshot.png files move into the new folder the first time they are read. The fingerprint now covers more of the face, so every character is recaptured once.

Docs: docs.uz-scripts.com/docs/free/uz-mugshot · Discord: discord.uz-scripts.com