🗞️custom commands

Create unlimited custom commands for your Discord bot. The editable/custom_commands.lua file is fully open source and can be freely modified.


📂 Open Source File

The file editable/custom_commands.lua is not encrypted and fully editable. You can:

  • ✅ Create unlimited new commands

  • ✅ Modify existing commands

  • ✅ Add framework-specific functionality

  • ✅ Integrate with other resources

  • ✅ Use all FiveM natives and exports


🎯 Command Structure

Every custom command follows this structure:

CustomCommands.commandname = function(args, admin)
    -- args = table of arguments from Discord
    -- admin = Discord username who executed command
    
    -- Your code here...
    
    return { 
        success = true,      -- or false
        message = 'Result message for Discord'
    }
end

📝 Creating a New Command

1

Add Command Function

Open editable/custom_commands.lua and add your command:

2

Add Permissions

In shared/config.lua:

3

Add Logging (Optional)

In editable/logs.lua:

4

Add to Help (Optional)

In editable/help.lua:


🛠️ Built-in Commands (Editable)

These commands come pre-built but are fully editable:

Player Control

Command
Description

!heal

Heal player to full HP

!revive

Revive dead player

!freeze

Freeze player in place

!unfreeze

Unfreeze player

!crashplayer

Crash player's game

Economy (Framework)

Command
Description

!givemoney

Give money (cash/bank)

!giveitem

Give inventory item

!givecar

Spawn vehicle

Jobs (Framework)

Command
Description

!setjob

Set player job

!setgroup

Set permission group

Teleport

Command
Description

!bring

Bring player to another

!teleport

Teleport to coordinates

Utilities

Command
Description

!announce

Server announcement

!ss

Take screenshot

!blackout

Toggle lights

!ping

Bot status

!serverinfo

Server info

!player

Detailed player info

!help

Show all commands


🎮 Framework Detection

The script auto-detects your framework:

ESX Example

QB-Core Example


🔌 Using Other Resources

Call exports from other resources:


📡 Client Events

Trigger client-side events:


✅ Helper Functions

Available helper functions:


💡 Example Commands

Revive All Players

Clear Inventory

Set Time

Get Player Vehicle


⚠️ Important Notes

  1. Always validate input - Check if player ID exists, if arguments are valid

  2. Use SendLog - Log all administrative actions for accountability

  3. Return proper response - Always return { success, message }

  4. Test thoroughly - Test commands before using in production

  5. Don't break escrow - Only edit files in editable/ folder