Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Mar 24, 2023. It is now read-only.

alt:V Open Source Character Editor / Synchronization

License

NotificationsYou must be signed in to change notification settings

Stuyk/altv-os-character-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Source - Character Editor - alt:V

❤️ Become a Sponsor of my Open Source Work

⌨️ Learn how to script for alt:V

⭐ This repository if you found it useful!


Description

This script allows a player to be sent to a character editor screen. Where they may customize their facial appearances.

Includes presets, makeup, hairstyles, face customization for all features, and overlays.

Also includes the ability to export character code and import it.

Note: This is not a clothing editor.

Installing Dependencies / Installation

I cannot stress this enough. Ensure you have NodeJS 13+ or you will have problems.

  • NodeJS 13+
  • An Existing or New Gamemode
  • General Scripting Knowledge

After simply add the name of this resource to yourserver.cfg resource section.

altv-os-character-editor

Then simply clone this repository into your main server resources folder.

cd resourcesgit clone https://github.com/Stuyk/altv-os-character-editor

Ensure yourpackage.json includes this property:

"type":"module"

Usage

Generally speaking what you want to do with this resource is up to you.However, there's a few rules and endpoints you need to use to sync players.

New Character Steps

  1. Show the editor to the player.
  2. Player finishes.
  3. Store the data sent up to server.
  4. Resynchronize the player's face from the server usingcharacter:Sync
  5. Done.

Existing Character Steps

  1. Pull Data from Database Somewhere
  2. Send throughcharacter:Sync
  3. Done.

Synchronization of Player Data

When a player creates their character you will get data similar to this:

{sex:1,faceFather:44,faceMother:38,skinFather:16,skinMother:23,faceMix:0.5,skinMix:0.1,    ...}

What you want to do with this data is store it somewhere.When they rejoin your server you need to take this data and feed it through an alt event.

constsomeData={sex:1,faceFather:44,faceMother:38,skinFather:16,skinMother:23,faceMix:0.5,skinMix:0.1,    ...}alt.emit('character:Sync',player,someData);

Toggle Character Editor

The character editor will take whatever location that the player is in currently and use it for their customization pivot point.

All you need to do is call an event with the character's old data if present.

alt.emit('character:Edit',player);// ORalt.emit('character:Edit',player,some_Data_Goes_Here);

Completion of Character Editing

After completing their edit the data will be sent up to the server.

Use the data to resync the player.

Store the data or do whatever you want with it.

alt.on('character:Done',(player,data)=>{alt.emit('character:Sync',player,data);player.pos=player.pos;// This is used to prevent interior bugs. May require a small delay.console.log(data);});

[8]ページ先頭

©2009-2025 Movatter.jp