Herramienta gratis

Generador de comandos FiveM

Crea un comando con permisos en segundos para QBCore, ESX o sin framework, con el ACE listo si lo restringes.

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)
Generador de comandos para FiveM (QBCore, ESX) | Crxative-M