Code Monkey home page Code Monkey logo

fivem-appearance's Introduction

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.

config.cfg example:

setr fivem-appearance:locale "en"
ensure fivem-appearance

Client Exports

Appearance

Export Parameters Return
getPedModel ped: number string
getPedComponents ped: number PedComponent[]
getPedProps ped: number PedProp[]
getPedHeadBlend ped: number PedHeadBlend
getPedFaceFeatures ped: number PedFaceFeatures
getPedHeadOverlays ped: number PedHeadOverlays
getPedHair ped: number PedHair
getPedAppearance ped: number PedAppearance
setPlayerModel model: string Promise<void>
setPedComponent ped: number, component: PedComponent void
setPedComponents ped: number, components: PedComponent[] void
setPedProp ped: number, prop: PedProp void
setPedProps ped: number, props: PedProp[] void
setPedFaceFeatures ped: number, faceFeatures: PedFaceFeatures void
setPedHeadOverlays ped: number, headOverlays: PedHeadOverlays void
setPedHair ped: number, hair: PedHair void
setPedEyeColor ped: number, eyeColor: number void
setPlayerAppearance appearance: PedAppearance void
setPedAppearance ped: number, appearance: PedAppearance void

Customization

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

Export Parameters Return
startPlayerCustomization callback: ((appearance: PedAppearance | undefined) => void), config? CustomizationConfig void

Examples

Customization command (Lua)

RegisterCommand('customization', function()
  local config = {
    ped = true,
    headBlend = true,
    faceFeatures = true,
    headOverlays = true,
    components = true,
    props = 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

fivem-appearance's People

Contributors

cyntaax avatar joeriaben avatar liamdormon avatar morpheause avatar pedr0fontoura avatar snakewiz avatar

Stargazers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.