Pular para o conteúdo principal

fivem-appearance

A flexible player customization script for FiveM.

This resource was designed to manage all GTA V player/ped customization in only one place, with an opinionated way to handle the data.

Features

  • Freemode ped full customization (Head blend, Face features, Head overlays, Components, Props).
  • Exports API to get and set every part of player/ped appearance.
  • Built-in customization feature.

Preview

Customization Preview Customization Preview Customization Preview

Installation

Download

Go to releases and get the latest version.

Build yourself

  1. Clone the repository into your resources/[local] folder.

  2. Execute the build script.

    yarn build
  3. Start development.

Disclaimer

This is a development resource, if you don't use the exports the resource itself will do nothing.

ConVars

Since this is a client script, you will need to use setr to set these convars.

  • fivem-appearance:locale: the name of one file inside locales/, default en, choose the locale file for the customization interface.
  • fivem-appearance:automaticFade: If set to 0, hair fade could be selected by the player, otherwise it will be automatic. default 1. config.cfg example:
setr fivem-appearance:locale "en"
setr fivem-appearance:automaticFade 1
ensure fivem-appearance

Client Exports

Appearance

ExportParametersReturn
getPedModelped: numberstring
getPedComponentsped: numberPedComponent[]
getPedPropsped: numberPedProp[]
getPedHeadBlendped: numberPedHeadBlend
getPedFaceFeaturesped: numberPedFaceFeatures
getPedHeadOverlaysped: numberPedHeadOverlays
getPedHairped: numberPedHair
getPedTattoosTattooList
getPedAppearanceped: numberPedAppearance
setPlayerModelmodel: stringPromise\<void>
setPedComponentped: number, component: PedComponentvoid
setPedComponentsped: number, components: PedComponent[]void
setPedPropped: number, prop: PedPropvoid
setPedPropsped: number, props: PedProp[]void
setPedFaceFeaturesped: number, faceFeatures: PedFaceFeaturesvoid
setPedHeadOverlaysped: number, headOverlays: PedHeadOverlaysvoid
setPedHairped: number, hair: PedHairvoid
setPedEyeColorped: number, eyeColor: numbervoid
setPedTattoosped: number, tattoos: TattooListvoid
setPlayerAppearanceappearance: PedAppearancevoid
setPedAppearanceped: number, appearance: PedAppearancevoid

Customization

This export is only available if fivem-appearance:customization is set to 1.

ExportParametersReturn
startPlayerCustomizationcallback: ((appearance: PedAppearance | undefined) => void), config? CustomizationConfigvoid

Examples

Customization command (Lua)

RegisterCommand('customization', function()
local config = {
ped = true,
headBlend = true,
faceFeatures = true,
headOverlays = true,
components = true,
props = true,
allowExit = true,
tattoos = true
}

exports['fivem-appearance']:startPlayerCustomization(function (appearance)
if (appearance) then
print('Saved')
else
print('Canceled')
end
end, config)
end, false)

Start player customization with callback (TypeScript)

const exp = (global as any).exports;

exp["fivem-appearance"].startPlayerCustomization((appearance) => {
if (appearance) {
console.log("Customization saved");
emitNet("genericSaveAppearanceDataServerEvent", JSON.stringify(appearance));
} else {
console.log("Customization canceled");
}
});

Set player appearance (TypeScript)

const exp = (global as any).exports;

onNet("genericPlayerAppearanceLoadedServerEvent", (appearance) => {
exp["fivem-appearance"].setPlayerAppearance(appearance);
});

Data

Scripts used to generate some of the resource's data.

Peds

Credits