Skip to main content

Examples

Example uses of exports for fivem-appearance.


Customization command (Lua)

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

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

Player Customization (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 Appearance

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