GCMod

Exports and Statebags

Public API contracts (exports/statebags) for gcm_tattoos.


Exports

loadTattoos(fetch?, ped?) (client export)
  • Context: client
  • Signature:
lua
exports['gcm_tattoos']:loadTattoos(true, cache.ped)
  • Behavior:

    • Optionally refreshes tattoo data from server if fetch = true.
    • Applies all owned tattoos to the selected ped (or current player ped).
  • Failure cases:

    • No tattoos in DB/cache: nothing is applied.
    • Sync toggled off through toggleTattoos(false): apply is skipped.

Usage example

lua
CreateThread(function()
    Wait(2000)
    exports['gcm_tattoos']:loadTattoos(true, cache.ped)
end)
applyPedTattoos(ped, tattoos) (client export)
  • Context: client
  • Signature:
lua
exports['gcm_tattoos']:applyPedTattoos(ped, tattoosTable)
  • Parameters:

    • ped (number): target ped entity id.
    • tattoos (table): map of tattoo hash to tattoo data (collection, opacity, etc.).
  • Behavior:

    • Applies a provided tattoo set to the target ped.
  • Failure cases:

    • Invalid ped or malformed tattoos table leads to no visible effect.

Usage example

lua
local preview = {
    [GetHashKey('MP_Buis_M_Neck_000')] = {
        collection = GetHashKey('mpbusiness_overlays'),
        opacity = 1
    }
}
exports['gcm_tattoos']:applyPedTattoos(cache.ped, preview)
toggleTattoos(toggle) (client export)
  • Context: client
  • Signature:
lua
exports['gcm_tattoos']:toggleTattoos(false)
  • Parameters:

    • toggle (boolean): enable/disable tattoo synchronization and rendering.
  • Behavior:

    • true: re-enables tattoo rendering and reapplies current tattoos.
    • false: clears current ped decorations and pauses tattoo sync.
  • Failure cases:

    • Non-boolean values can produce undefined behavior.

Usage example

lua
-- Disable tattoos during a custom cutscene
exports['gcm_tattoos']:toggleTattoos(false)
Wait(10000)
exports['gcm_tattoos']:toggleTattoos(true)
isNearbyShop() (client export)
  • Context: client
  • Signature:
lua
local nearShop = exports['gcm_tattoos']:isNearbyShop()
  • Returns:

    • true when player is in an active tattoo shop interaction zone.
    • false otherwise.
  • Failure cases:

    • Returns false when no shop points are active yet.

Usage example

lua
if exports['gcm_tattoos']:isNearbyShop() then
    print('Player can open tattoo UI here')
end
getTattoos(identifier) (server export)
  • Context: server
  • Signature:
lua
local tattoos = exports['gcm_tattoos']:getTattoos(source)
  • Parameters:

    • identifier (string | number): player identifier or player source.
  • Returns:

    • Tattoo table keyed by hash, or empty table if no tattoos.
  • Failure cases:

    • Unknown identifier/source returns {}.
    • Current implementation has a type-check bug risk (documented in troubleshooting).

Usage example

lua
local list = exports['gcm_tattoos']:getTattoos(source)
if next(list) then
    print(('Loaded %s tattoos'):format(#list))
end

Statebags

Statebag keys

No explicit Player(...).state, LocalPlayer.state, Entity(...).state, or GlobalState keys are written by gcm_tattoos in the inspected codebase.