Free tool

FiveM command generator

Create a command with permissions in seconds for QBCore, ESX or standalone, with the ACE ready if you restrict it.

Configura el comando

Framework

Argumentos

Función Pro

Comando QBCore · Pégalo en: tu_recurso/server/main.lua

lua
local QBCore = exports['qb-core']:GetCoreObject()
-- QBCore.Commands.Add(nombre, ayuda, argumentos, requeridos, callback, permiso)
QBCore.Commands.Add('curar', 'Cura al jugador', {
        { name = 'id', help = 'ID del jugador' }
    }, false, function(source, args)
    local src = source
    local Player = QBCore.Functions.GetPlayer(src)
    if not Player then return end
    -- TODO: tu lógica aquí
    -- args[1] = id
    TriggerClientEvent('QBCore:Notify', src, 'Has usado /curar', 'success')
end, 'admin')

Sugerencia en el chat (autocompletar) · Pégalo en: tu_recurso/client.lua

lua
RegisterNetEvent('onClientResourceStart', function(res)
    if res ~= GetCurrentResourceName() then return end
    TriggerEvent('chat:addSuggestion', '/curar', 'Cura al jugador', {
        { name = 'id', help = 'ID del jugador' }
    })
end)
FiveM command generator (QBCore, ESX) | Crxative-M