**FS-MultiCharacter System Features**
Elevate your FiveM server’s character selection experience with the FS-MultiCharacter system, a fully customizable, intuitive, and immersive solution designed to streamline character management and captivate players from the moment they join. Below are the key features that make FS-MultiCharacter the ultimate choice for enhancing player engagement and server functionality.
### 1. Seamless Multi-Character Management
- **Multiple Character Slots**: Supports up to three character slots (configurable via `MAX_SLOTS` in `sv_multicharacter.lua`), allowing players to create and manage multiple unique characters.
- **Dynamic Character Selection**: Players can easily select, create, or delete characters through an intuitive NUI interface, with real-time feedback for invalid or locked slots.
- **Persistent Data**: Character data, including `citizenid`, `charinfo`, `money`, and `job`, is securely stored and retrieved from the database, ensuring continuity across sessions.
### 2. Role-Based Slot Locking
- **Discord Integration**: Leverage Discord role-based access to lock specific character slots, ensuring premium or exclusive slots are reserved for players with specific roles (configured via `ServerConfig.Discord` in `sv_config.lua`).
- **Flexible Slot Control**: The first slot (`cid = 0`) is always open, while additional slots can be locked based on Discord role checks, with configurable `LockedSlots` settings.
- **Secure Validation**: Uses Discord API requests to verify player roles, with fallback mechanisms to prevent errors if the bot token or role ID is invalid.
### 3. Immersive Character Creation
- **Detailed Character Profiles**: Players can input essential details like `firstname`, `lastname`, `birthdate`, and `gender` through a user-friendly NUI form (`interface.html`), ensuring a personalized experience.
- **Dynamic Clothing Setup**: Automatically applies gender-specific clothing for new characters via `setNewPlayerClothes` in `cl_utils.lua`, integrating with frameworks like `qb-clothes`.
- **Error Handling**: Robust validation ensures invalid inputs (e.g., incorrect `cid` formats) trigger clear error messages, enhancing user experience.
### 4. Smooth Loading and Transition Effects
- **Cinematic Loading Experience**: Features screen fades (`DoScreenFadeOut`/`DoScreenFadeIn`) and player switching (`SwitchOutPlayer`/`SwitchInPlayer`) for a polished transition between character selection and gameplay.
- **Customizable Spawn Points**: Sets initial player coordinates (e.g., `vector3(192.55, -903.33, 28.42)`) during initialization, with integration for custom spawn systems via `Utils.spawnPlayer`.
- **Audio Feedback**: Plays immersive sound effects (e.g., `CHECKPOINT_PERFECT`) when loading characters, enhancing the premium feel.
### 5. Framework Integration
- **QB-Core Compatibility**: Seamlessly integrates with the QB-Core framework (configurable via `Config.Core` in `config.lua`), leveraging its functions for player login, data retrieval, and command refreshing.
- **Database Support**: Supports modern database drivers like `oxmysql` or `ghmattimysql`, ensuring efficient data handling and compatibility with existing server setups.
- **Extensible Exports**: Utilizes framework exports for core functionality, with fallbacks for missing or invalid exports to prevent crashes.
### 6. User-Friendly NUI Interface
- **Responsive Design**: The NUI interface (`interface.html`) features a clean, modern layout for character creation and selection, with clear buttons for canceling or confirming actions.
- **Dynamic Feedback**: Real-time error messages (e.g., “No character selected” or “Invalid character slot”) are displayed via `SendNUIMessage`, ensuring players are informed of issues.
- **Customizable Branding**: Displays server-specific logos and status (e.g., `Servericon`, `ServerStatus` from `config.lua`) to align with your server’s identity.
### 7. Developer-Friendly Configuration
- **Centralized Config Files**: All settings are managed through `config.lua` and `sv_config.lua`, allowing easy adjustments to framework, database, Discord settings, and server branding.
- **Debugging Support**: Development mode (`Config.Development`) disables initialization for testing, with detailed console logging for errors (e.g., missing `Utils` table or invalid `cid` formats).
- **Modular Codebase**: Well-organized Lua scripts (`cl_main.lua`, `cl_utils.lua`, `sv_multicharacter.lua`) with clear function separation for easy maintenance and extension.
### 8. Robust Error Handling and Security
- **Input Validation**: Ensures all inputs (e.g., `cid`, character data) are validated on both client and server sides to prevent errors or exploits.
- **Database Safety**: Uses synchronous database queries (`executeSync`) for reliable data retrieval and updates, with proper sanitization of inputs like `license` and `cid`.
- **Fallback Mechanisms**: Gracefully handles missing dependencies (e.g., `Utils` table, invalid exports) with informative error messages to aid debugging.
### 9. Performance Optimization
- **Lightweight Execution**: Optimized client and server scripts minimize resource usage, with asynchronous callbacks (`triggerServerCallback`) for efficient communication.
- **Session Awareness**: Waits for `NetworkIsSessionStarted` before initializing, ensuring compatibility with FiveM’s network lifecycle.
- **Resource Management**: Properly handles resource start/stop events (`onResourceStart`, `onResourceStop`) to maintain a clean environment and prevent memory leaks.
### 10. Community and Engagement Features
- **Server Branding**: Configurable server status and logo (`Config.Server.Status`, `Config.Server.Icon`) create a professional first impression for players.
- **Role-Based Exclusivity**: Discord role checks encourage community engagement by offering premium slots to active or subscribed members.
- **Scalable Design**: Easily expandable to support additional slots or features, making it suitable for servers of all sizes.
### Why Choose FS-MultiCharacter?
The FS-MultiCharacter system transforms character management into a seamless, engaging, and professional experience. It’s not just a character selector—it’s a gateway to your server’s world, designed to:
- **Captivate Players**: Smooth transitions, immersive effects, and a polished interface keep players engaged.
- **Strengthen Branding**: Customizable logos and server status align with your server’s identity.
- **Build Community**: Role-based slot locking drives engagement with your Discord community.
- **Enhance Professionalism**: Robust error handling and framework integration set your server apart.
Get the FS-MultiCharacter system today and make every player’s character selection experience unforgettable!
