Metabolism System
🌊 CAS Metabolism System - Complete Documentation
📋 Table of Contents
Overview
Features
Requirements
Installation
Configuration
API Documentation
Theme System
Level/XP System
Item System
Customization
Troubleshooting
Performance
Support
🌟 Overview
CAS Metabolism System is the most advanced metabolism and HUD system for RedM servers, built specifically for the VORP Framework. This system combines modern React/TypeScript technology with comprehensive gameplay mechanics to deliver an unparalleled player experience.
🎯 Key Highlights
🎨 3 Unique Themes: Western, Minimal, and Wave with animated effects
⚡ Modern React UI with TypeScript for maximum performance
🎮 Complete VORP Integration with character system
🔧 Advanced Customization with drag & drop interface
📊 Comprehensive Level/XP System with persistent data storage
🌍 Multi-language Support (EN, FR, ES, DE, TR)
🎨 Advanced Color System with presets and individual customization
✨ Features
🎨 Three Stunning Themes
1. Western Theme 🤠
Traditional hexagonal design with gradient fills
Progress text display with percentage values
Classic western aesthetic with detailed SVG elements
Perfect for traditional roleplay servers
2. Minimal Theme ⚪
Clean circular progress rings with white stroke indicators
Modern minimalist design
SVG icon fill system for health/stamina cores
Ideal for modern/futuristic servers
3. Wave Theme 🌊 [NEW!]
Square containers with animated wave effects
Bottom-to-top liquid fill animation
Realistic wave physics with CSS animations
Dynamic wave colors based on status
Gold core enhancement with glowing wave effects
📊 Comprehensive Metabolism System
Core Statistics
Health System: Inner/Outer cores with gold enhancement support
Stamina System: Inner/Outer cores with gold enhancement support
Hunger: Realistic decay with running multipliers
Thirst: Dynamic decrease based on activity
Stress System: Visual effects and screen shake
Dirt/Cleanliness: Automatic tracking
Temperature Display: Real-time weather integration
Alcohol Effects: Progressive drunk system with visual distortion
Voice Chat Indicator: Real-time microphone status
Horse Integration: Health & stamina when mounted
Gold Core Enhancement System ✨
Visual Effects: Glowing icons and wave effects
Timer Display: Remaining enhancement time shown above elements
Dual Core Support: Inner and outer cores independently enhanced
Animation Effects: Pulse and glow animations for enhanced attributes
Theme Integration: Works across all three themes
🎯 Level/XP System
Visual Progress
Animated XP Bars: Smooth progress animations across all themes
Level Display: Current level with XP progress (0-100 per level)
Real-time Updates: Instant visual feedback
Theme Integration: Unique display for each theme
Data Management
JSON Storage: Persistent character data in
levelsystem.jsonCharacter-based: Individual progress per character identifier
Automatic Leveling: XP overflow handling (100 XP per level)
Export System: Full API for other resources
🔧 Requirements
Framework Dependencies
VORP Core (Latest version) - Required for character system
VORP Inventory - Required for item usage system
RedM Server (Latest artifacts recommended)
Optional Dependencies
CAS Progress Bar - Enhanced progress bar visuals
CAS Notification - Custom notification system
PMA-Voice or Mumble - Voice chat integration
🚀 Installation
Step 1: Download & Extract
Step 2: Server Configuration
Add to your server.cfg:
Step 3: Database Setup
No database setup required! The system uses JSON file storage for XP data, which is automatically created and managed.
⚙️ Configuration
🎮 Client Configuration (config/client_config.lua)
config/client_config.lua)🎨 HUD Colors Configuration
🌈 Color Presets System
🍎 Item Configuration (config/shared_config.lua)
config/shared_config.lua)🌍 Localization (config/locale.lua)
config/locale.lua)📖 CAS-Metabolism Exports Documentation
This document explains all available exports in the CAS-Metabolism system. You can use these exports in your scripts to get, set, or update player metabolism values such as health, stamina, hunger, thirst, stress, etc.
🔹 Available Metabolism Keys
Each metabolism type is stored in PlayerMetabolism.Values.
Some keys are simple values (e.g., hunger, thirst), while others are tables with multiple attributes (e.g., health, stamina).
✅ Simple values
hunger→0 - 100thirst→0 - 100stress→0 - 100dirt→0 - 100weather→0 - 100drunk→0 - 100
✅ Complex values (with gold cores)
These contain inner, outer, and gold core states:
staminamicrophonehorsehealthhealth
Each of these has:
🔹 Exports
1. getMetabolismValue(metabolism)
getMetabolismValue(metabolism)Get the current value of a metabolism key.
2. getAllMetabolismValues()
getAllMetabolismValues()Get all metabolism values at once.
This returns the full PlayerMetabolism.Values table.
3. setMetabolismValue(metabolism, value)
setMetabolismValue(metabolism, value)Set a specific metabolism value. This will update the player status and sync with React.
Example 1 – Simple value
Example 2 – Complex value (with gold core)
🔹 Notes
All values are clamped between 0 and 100 automatically.
Gold cores (
innerGold,outerGold) are boolean values (true/false).Gold core timers (
innerGoldTime,outerGoldTime) are integers in seconds.When setting a complex value, you must provide the full table structure.
✅ Example Use Case
With these exports, you can fully control the metabolism system for your players in CAS-Metabolism.
🎨 Theme System
Theme Switching
Players can switch between themes in real-time through the HUD settings menu:
Western Theme
Design: Hexagonal containers with gradient fills
Progress: Text-based percentage display
Colors: Traditional western color palette
Animation: Smooth fill animations from bottom to top
Minimal Theme
Design: Circular progress rings
Progress: White stroke progress indicators
Colors: Clean, modern color scheme
Animation: SVG fill animations for inner cores
Wave Theme 🌊
Design: Square containers with liquid wave effects
Progress: Animated wave fill from bottom to top
Colors: Dynamic wave colors with gold enhancement
Animation: Realistic wave physics with CSS animations
Theme Configuration
📊 Level/XP System
System Overview
XP per Level: 100 XP required for each level
Storage: JSON file (
levelsystem.json) for persistenceCharacter-based: Individual progress per character identifier
Real-time Updates: Instant UI feedback with animations
📘 CAS Level System – Export Usage Guide
This document explains how to use the exports provided by the CAS Level System. These functions allow you to get, add, and remove XP/levels for characters.
🔹 Getting Started
First, make sure you correctly retrieve the player’s character identifier from your core system:
You will need identifier for all function calls.
📥 Available Exports
1. getXP(identifier)
getXP(identifier)Returns the current XP of the given character.
2. addXP(amount, identifier, source)
addXP(amount, identifier, source)Adds XP to a character. If XP reaches 100, it automatically levels up.
💡 Example: Reward player XP after finishing a mission.
3. removeXP(amount, identifier, source)
removeXP(amount, identifier, source)Removes XP from a character. If XP goes below 0, the character levels down.
4. getLevel(identifier)
getLevel(identifier)Returns the current level of the given character.
5. getPlayerLevelData(identifier)
getPlayerLevelData(identifier)Returns a table with both XP and level values.
📌 Example Use Case
Reward a player with XP when completing a job:
✨ That’s it! With these exports you can easily integrate XP and leveling into your scripts.
🍎 Item System
40+ Pre-configured Items
Alcoholic Beverages
whisky: High alcohol content with drunk effects
wine: Moderate alcohol with thirst restoration
beer: Light alcohol with stamina boost
vodka: Strong alcohol with health boost
tequila: Premium alcohol with enhanced effects
tropicalPunchMoonshine: Moonshine variant
wildCiderMoonshine: Cider moonshine variant
raspberryale: Fruit-flavored alcoholic beverage
Food Categories
Breakfast Items:
consumable_breakfastFruits:
consumable_peach,consumable_pearVegetables:
consumable_veggiesFish:
consumable_bluegil,consumable_salmon,consumable_troutDesserts:
consumable_chocolate,cheesecake,consumable_blueberrypieBaked Goods: Various cakes and pastries
Medical Supplies
bandage_2: Outer health restoration with bandage animation
syringe_2: Inner health restoration with injection animation
Beverages
consumable_coffee: Stamina boost with gold core enhancement
milk: Nutritious drink with health benefits
consumable_raspberrywater: Fruit-flavored water
Advanced Item Configuration
Gold Core Enhancement Items
Animation System
Available animation types:
"eat": General eating animation with props
"drink": Drinking animation with bottles
"coffee": Special coffee drinking animation
"stew": Eating stew with spoon animation
"syringe": Medical injection animation
"bandage": Bandage application animation
Screen Effects
Item Usage Flow
Player uses item → VORP Inventory triggers usage
Animation plays → 6-second animation with prop
Effects applied → Metabolism values updated
Screen effects → Visual effects if configured
Notification → Success message displayed
Return item → Optional item returned (e.g., empty bottle)
🎨 Customization
Drag & Drop Interface
Activation: Use
/hudsettings→ "Drag Elements"Visual Feedback: DnD indicators appear on all elements
Persistent Positions: All positions saved automatically
Reset Function: One-click position reset to defaults
Individual Element Sizing
Scale Range: 0.5x to 2.0x for each element
Independent Scaling: Each element sized individually
Real-time Preview: See changes instantly
Persistent Settings: Saved across sessions
Advanced Color System
Three Color Types per Element
Background/Stroke Color: Main element color (theme-dependent)
Icon Color: Full state icon color
Empty Icon Color: Empty state icon color
Color Presets
5 Pre-made Presets: Default, Neon, Nature, Fire, Ice
One-click Application: Apply entire color scheme instantly
Theme Compatibility: Works across all themes
Individual Customization
Per-element Colors: Customize each element individually
Bulk Operations: Apply colors to all elements at once
Real-time Preview: See changes immediately
Persistent Storage: Colors saved in localStorage
Theme-specific Color Behavior
Western Theme
Background Color: Hexagon fill gradient
Icon Color: SVG icon fill color
Empty Icon Color: Icon color when empty
Minimal Theme
Stroke Color: Circular progress ring color
Icon Color: Full SVG icon fill
Empty Icon Color: Empty SVG icon fill
Wave Theme 🌊
Wave Color: Liquid wave fill color
Icon Color: Center icon color
Empty Icon Color: Container background color
🔧 Advanced Features
Gold Core Enhancement System ✨
Visual Effects
Glowing Icons: Enhanced icons with gold color and glow effect
Wave Enhancement: Gold-colored waves in Wave theme
Pulse Animation: Breathing glow effect for enhanced attributes
Timer Display: Remaining enhancement time above elements
Implementation
Stress System
Progressive Effects: Different intensities based on stress level
Screen Shake: Configurable shake effects at high stress
Shooting Integration: Stress increases when shooting
Visual Feedback: Real-time stress indication in HUD
Alcohol System
Progressive Intoxication: Multiple drunk levels
Screen Effects: Visual distortion when drunk
Ragdoll Effects: Character stumbles when heavily intoxicated
Realistic Recovery: Time-based alcohol decrease
Horse Integration
Automatic Detection: Shows horse stats when mounted
Health & Stamina: Both inner and outer cores
Dynamic Display: Appears/disappears based on mount status
Gold Core Support: Enhanced horse attributes
Voice Chat Integration
Real-time Indicator: Shows when player is talking
Multiple Systems: Supports PMA-Voice and Mumble
Visual Feedback: Microphone element fills when active
🎮 User Experience
In-Game Commands
Settings Menu Features
1. Element Visibility
Show/hide any HUD element
Individual toggle switches
Real-time preview
Persistent settings
2. Drag Elements
Move elements anywhere on screen
Visual drag indicators
Snap-to-grid feel
Position memory
3. HUD Themes
Switch between Western/Minimal/Wave
Instant theme changes
Position preservation
Theme-specific optimizations
4. Individual Sizes
Scale each element 0.5x-2.0x
Real-time size preview
Independent scaling
Size memory
5. Color Presets
Apply pre-made color schemes
5 beautiful presets included
One-click application
Theme compatibility
6. Color Customization
Individual element color control
3 colors per element
Bulk color operations
Real-time preview
🔧 Technical Implementation
React/TypeScript Architecture
Performance Optimizations
Efficient Rendering: Only updates changed elements
Memory Management: Proper cleanup of resources
Network Optimization: Minimal network traffic
Animation Performance: 60fps smooth animations
Data Persistence
🎯 Integration Examples
Basic Integration
Metabolism Monitoring
XP Rewards System
🔧 Advanced Configuration
Metabolism Decay Rates
Stress System Configuration
Voice Chat Configuration
🎨 Customization Guide
For Server Owners
Setting Default Colors
Adding Custom Items
For Players
Theme Customization
Use
/hudsettingsto open settingsSelect "HUD Themes" to switch themes
Use "Color Presets" for quick color schemes
Use "Color Customization" for individual control
Layout Customization
Use "Drag Elements" to move elements
Use "Individual Sizes" to scale elements
Use "Element Visibility" to show/hide elements
All changes are saved automatically
🐛 Troubleshooting
Common Issues
HUD Not Showing
XP Not Updating
Check server console for errors
Verify character identifier exists
Check
levelsystem.jsonfile permissionsEnsure VORP Core is running properly
Items Not Working
Verify VORP Inventory is running
Check item names match exactly in database
Ensure items exist in VORP items table
Check console for item registration errors
Colors Not Applying
Clear browser cache (F5 in NUI)
Check localStorage for saved settings
Reset to defaults in HUD settings
Verify color format is valid hex
Positions Not Saving
Check browser localStorage permissions
Verify position keys are correct
Reset positions if corrupted
Check console for position errors
Debug Mode
Enable debug mode for detailed logging:
This enables:
Detailed console logging
Automatic HUD display for testing
Development XP data loading
Enhanced error messages
Console Commands for Testing
📈 Performance
Resource Usage
Client Memory: ~15-25MB
Server Memory: ~5-10MB
Network Usage: <1KB/s per player
CPU Usage: <1% on modern hardware
Update Frequency: 250ms for smooth animations
Optimization Features
Efficient React Rendering: Minimal re-renders with proper state management
Optimized Network Traffic: Only sends changed data
Memory Leak Prevention: Proper cleanup of event listeners
Smooth Animations: 60fps performance with Framer Motion
Lazy Loading: Components loaded only when needed
Scalability
High Player Count: Tested with 200+ concurrent players
Low Latency: Minimal network overhead
Stable Performance: No memory leaks or performance degradation
Cross-platform: Works on all RedM supported platforms
🔒 Security & Validation
Server-side Validation
Metabolism Changes: All changes validated server-side
XP System: Anti-cheat protection for level manipulation
Item Usage: Secure item validation through VORP Inventory
Configuration Protection: Server-side config validation
Data Integrity
Character-based Storage: Secure per-character data
JSON Validation: Proper data format validation
Backup System: Automatic data backup on changes
Error Recovery: Graceful handling of corrupted data
🌍 Multi-language Support
Supported Languages
English (en) - Default
French (fr) - Français
Spanish (es) - Español
German (de) - Deutsch
Turkish (tr) - Türkçe
Adding New Languages
Dynamic Language Loading
Language changes without server restart
Automatic UI updates
Fallback to English for missing translations
Client-side language switching
🚀 Future Updates
Planned Features
Additional Themes: More visual themes
Enhanced Animations: More animation types
Extended API: More integration options
Performance Improvements: Continued optimization
Community Requests
Custom Themes: User-created theme support
More Languages: Additional language support
Enhanced Effects: More visual effects
Mobile Optimization: Touch-friendly interface
📞 Support
Getting Help
Read Documentation: Check this guide thoroughly
Check Console: Look for error messages
Debug Mode: Enable for detailed logging
Community: Ask in our Discord server
Reporting Issues
Include in your report:
Server Version: RedM build number
VORP Version: Core and inventory versions
Error Messages: Full console output
Steps to Reproduce: Detailed reproduction steps
Configuration: Your config files
Feature Requests
We welcome suggestions! Include:
Detailed Description: What you want to achieve
Use Case: Why this feature would be useful
Implementation Ideas: How you think it should work
📄 License & Credits
License
This resource is protected and licensed. Please respect the license terms and do not redistribute without permission.
Credits
Development: Code After S*x Team
Framework: VORP Core Integration
UI Framework: React + TypeScript
Animations: Framer Motion
State Management: Redux Toolkit
📊 Version Information
Current Version: v2.0.0
✅ Complete metabolism system
✅ 3 unique themes (Western, Minimal, Wave)
✅ Advanced customization system
✅ Level/XP system with JSON storage
✅ 40+ pre-configured items
✅ Gold core enhancement system
✅ Multi-language support
✅ VORP Framework integration
This documentation covers the complete CAS Metabolism System for RedM servers using the VORP Framework. For additional support or custom development, contact the Code After Sx team.*
🌊 Experience the future of RedM metabolism systems with CAS Metabolism!
Last updated