Examples

Example uses of exports

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)

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

Last updated