autodoc_g_client_functions
JO Functions > jo.pedTexture.apply()
A function to apply texture on a specific ped <br>
JO Functions > jo.pedTexture.apply() > Syntax
jo.pedTexture.apply(ped, layerName, _data)
JO Functions > jo.pedTexture.apply() > Parameters
ped : integer
The entity ID
layerName : string
The layername of the texture
_data : table
The data of the texture
_data.id: integer - The ID of the texture <br> OR
_data.albedo: string - The albedo of the texture
_data.sheetGrid: integer - The sheet grid of the texture <br> default: 0 <BadgeOptional />
_data.opacity: number - The opacity of the texture <br> default: 1.0 <BadgeOptional />
_data.blendType: integer - The blend type of the texture <br> default: 1 <BadgeOptional />
_data.palette: string|integer - The palette of the colors <br> default: "metaped_tint_makeup" <BadgeOptional />
_data.tint0: string|integer - The first color <BadgeOptional />
_data.tint1: string|integer - The second color <BadgeOptional />
_data.tint2: string|integer - The third color <BadgeOptional />
JO Functions > jo.pedTexture.apply() > Example
local ped = PlayerPedId()
local layername = "eyeshadow"
local data = jo.pedTexture.variations.eyeshadow[3].value
data.palette = "metaped_tint_makeup"
data.tint0 = 5
data.tint1 = 10
data.tint2 = 40
jo.pedTexture.apply(ped, layername, data)
JO Functions > jo.pedTexture.getAll()
Return the list of layers in all categories <br>
JO Functions > jo.pedTexture.getAll() > Syntax
jo.pedTexture.getAll(ped)
JO Functions > jo.pedTexture.getAll() > Parameters
ped : integer
The entity ID
JO Functions > jo.pedTexture.getAll() > Return Value
Type : object
Return the list of layer apply on the ped
JO Functions > jo.pedTexture.getAll() > Example
local ped = PlayerPedId()
local textures = jo.pedTexture.getAll(ped)
log(textures)
-- Expected output: {heads = {eyeshdow = {...}, foundation = {...}}}
JO Functions > jo.pedTexture.getOverlayAssetFromId()
A function to get the hashname of a texture <br>
JO Functions > jo.pedTexture.getOverlayAssetFromId() > Syntax
jo.pedTexture.getOverlayAssetFromId(isMale, category, data)
JO Functions > jo.pedTexture.getOverlayAssetFromId() > Parameters
isMale : boolean
trueif the texture is for a male,falseotherwise
category : string
The layername of the texture
data : table|integer
The texture data <br> ⚠️ Can be either a
numberrepresenting the texture ID or atablewith detailed configuration
JO Functions > jo.pedTexture.getOverlayAssetFromId() > Return Value
Type : string
Return the hashname of the texture for this ID
JO Functions > jo.pedTexture.getOverlayAssetFromId() > Example
local isMale = true
local layername = "eyebrow"
local id = 5
local texture = jo.pedTexture.getOverlayAssetFromId(isMale, layername, id)
print(texture)
-- Expected output: mp_u_faov_eyebrow_005
JO Functions > jo.pedTexture.overwriteBodyPart()
A function to overwrite all the layers of a body part <br>
JO Functions > jo.pedTexture.overwriteBodyPart() > Syntax
jo.pedTexture.overwriteBodyPart(ped, category, overlays, forceRemove)
JO Functions > jo.pedTexture.overwriteBodyPart() > Parameters
ped : integer
The entity ID
category : string
The category of the texture
overlays : object
The list of layers
forceRemove : boolean <BadgeOptional />
Whether to force remove existing textures even if the category doesn't exist <br> default: false
JO Functions > jo.pedTexture.overwriteBodyPart() > Example
local ped = PlayerPedId()
local category = "heads"
local overlays = {
eyeshadow = { sheetGrid = 3, tint0 = 1, tint1 = 45, tint2 = 56 },
foundation = { id = 0, palette = "metaped_tint_makeup", tint0 = 78 }
}
jo.pedTexture.overwriteBodyPart(ped, category, overlays)
JO Functions > jo.pedTexture.refreshAll()
A function to refresh the ped texture <br>
JO Functions > jo.pedTexture.refreshAll() > Syntax
jo.pedTexture.refreshAll(ped)
JO Functions > jo.pedTexture.refreshAll() > Parameters
ped : integer
The entity ID
JO Functions > jo.pedTexture.refreshAll() > Example
local ped = PlayerPedId()
jo.pedTexture.refreshAll(ped)
JO Functions > jo.pedTexture.refreshNow()
A function to apply now the ped texture modification <br>
JO Functions > jo.pedTexture.refreshNow() > Syntax
jo.pedTexture.refreshNow(ped)
JO Functions > jo.pedTexture.refreshNow() > Example
local ped = PlayerPedId()
jo.pedTexture.refreshNow(ped)
JO Functions > jo.pedTexture.remove() > Syntax
jo.pedTexture.remove(ped, layerName)
JO Functions > jo.pedTexture.remove() > Parameters
ped : integer
The entity ID
layerName : string
The layer name of the texture
JO Functions > jo.pedTexture.remove() > Example
local ped = PlayerPedId()
local layername = "eyeshadow"
jo.pedTexture.remove(ped, layername)