Skip to content

Commit

Permalink
chore: add README and LICENSE
Browse files Browse the repository at this point in the history
  • Loading branch information
snakewiz committed Feb 11, 2021
1 parent 7cd6eae commit baf71cd
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 snakewiz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# cfx-appearance

A flexible player customization script for FiveM.

**Features**

- Freemode ped full customization (head blend, face features, head overlays, components, props)
- Default data structure for player / ped appearance
- Camera control

## Usage

1. Clone the repository into your `resources/[local]` folder.
2. Install both client and interface dependencies, `cd typescript` / `cd ui`, `yarn` to install, then `yarn build`.
3. Start development.

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

**Client Exports**

| Export | Parameters |
| ------------------------ | ------------------------------------------------------- |
| startPlayerCustomization | currentAppearance? (PedAppearance), callback (function) |
| setPlayerAppearance | appearance (PedAppearance) |
| setPedAppearance | appearance (PedAppearance) |

**Examples**

Start player customization with callback (TypeScript)

```typescript
const exp = (global as any).exports;

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

Set player appearance (TypeScript)

```typescript
const exp = (global as any).exports;

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

## Credits

- root-cause for providing some of the customization data
- xIAlexanderIx for the code style inspiration

0 comments on commit baf71cd

Please sign in to comment.