Skip to content

A character selection plugin for altv-crc

Notifications You must be signed in to change notification settings

altv-crc/crc-select-character

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[CRC][TS] Select Character

Supported by CRC

A simple character selection menu. Create any number of characters.

  • Select a Character
  • Delete a Character
  • Create a Character

Requires

Highly recommended to get the extension, for better event handling.

Installation

  1. Create a folder in your src folder called crc-select-character.

  2. Add the TypeScript files from this resource, to that folder.

  3. Modify server.toml and ensure it loads whatever you named the folder.

In the case of the example above it should be crc-select-character.

resources = [ 
    'crc-db',
    'crc-native-menu',
    'crc-instructional-buttons',
    'crc-discord-login',
    'crc-select-character'
    'watch-resources'
]

Your resource structure may vary

Developers

  • Selection will immediately follow the login plugins.
  • A selection event or creation event will be pushed after selection.

Server Events

crc-select-character-finish

This is called when a player has selected an existing character with the appearance property applied to the document.

alt.on('crc-select-character-finish', (player: alt.Player, _id: string) => {
    //
})

crc-select-character-finish-create

This is called when a player has created a character but does not have any appearance information.

alt.on('crc-select-character-finish-create', (player: alt.Player, _id: string) => {
    //
})

onServer Events

crc-select-character-start

This is called when the character selection is opened, and shows a list of all characters.

alt.onServer('crc-select-character-start', (characters: Character[]) => {
    //
})

crc-select-character-finish

This is called when the character selection is completed. All events are unloaded.

alt.onServer('crc-select-character-finish', () => {
    //
})

Client Events

crc-select-character-pick

This is called when a player has picked the character in the menu.

This does not mean they are choosen to spawn. This is when they're given more options like select, delete, etc.

alt.on('crc-select-character-pick', (characters: Character[]) => {
    //
})

crc-select-character-back-to-characters

This is called whenever a player re-renders the menu.

  • Occurs when going back a menu or two
alt.on('crc-select-character-back-to-characters', (characters: Character[]) => {
    //
})

About

A character selection plugin for altv-crc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published