lyx.ac
ChocoHax Exports

Complete guide to integrating ChocoHax into your FiveM resources

Step 1: Initialize the SDK

Get access to ChocoHax functionality in your scripts

SDK Initialization:

Replace chocohaxResourceName with your actual ChocoHax resource folder name:

Important: Replace chocohaxResourceName with the actual folder name of your ChocoHax resource

Step 2: Logging & Messages

Send messages and log player actions

Console Logging (_P):

Send formatted messages to console with colors and localization:

Message Types Examples:
Message Types:
"s" - Success message
"w" - Warning message
"i" - Info message
"e" - Error message

Step 3: System Information

Access system data and configuration

Available System Data:

Step 4: Player Actions & Logging

Send alerts and log player activities

Player Alerts & Logging:
Simple Kick Example
Ban with Permission Check
Punishment Types:
"alert" - Show alert only
"warn" - Warning message
"kick" - Kick player
"ban" - Ban player

Step 5: Player Data & Identifiers

Work with player identifiers and information

Get Player Identifiers:

Step 6: Event Handlers

Use ChocoHax events for advanced functionality

Available Events:
Permission Check (Client-side)
Send Player Alert
Log Other Player
Log Self

Step 7: Ban Management Exports

Check, manage, and retrieve ban information

Ban Management Functions:
Check Player Ban
Check Global Ban
Unban Player
⚠️ Performance Warning:

getAllBans() is available but should NOT be spammed as it may cause performance issues. Use sparingly for administrative purposes only.