local function TattooBlobToTable(blob)
local LockHash = string.unpack('<i4', blob, 1) & 0xFFFFFFFF -- uint (hash)
local Index = string.unpack('<i4', blob, 9) -- int
local Collection = string.unpack('<i4', blob, 17) & 0xFFFFFFFF -- uint (hash)
local Preset = string.unpack('<i4', blob, 25) & 0xFFFFFFFF -- uint (hash)
local Price = string.unpack('<i4', blob, 33) -- int
local eFacing = string.unpack('<i4', blob, 41) -- TattooZoneData
local UpdateGroup = string.unpack('<i4', blob, 49) -- uint (hash)
local TextLabel = string.unpack('z', blob, 57) -- uint
return {
LockHash = LockHash,
Index = Index,
Collection = Collection,
Preset = Preset,
Price = Price,
eFacing = eFacing,
UpdateGroup = UpdateGroup,
TextLabel = TextLabel
}
end
function GetTattooDlcItemDataTable(CharacterType, DecorationIndex)
local blob = string.rep('\0\0\0\0\0\0\0\0', 7+16)
if not Citizen.InvokeNative(0xFF56381874F82086, CharacterType, DecorationIndex, blob) then return nil end -- Data doesn't exist, return a nil
return TattooBlobToTable(blob) -- Return the data table
end
local numberOfTattoos = GetNumTattooShopDlcItems(3) -- get all tattoos for mpmale
for i = 0, numberOfTattoos - 1 do
local tattooData = GetTattooDlcItemDataTable(3, i)
-- Do stuff with your tattoo data
end