Skip to main content


ESX.Command(name, Permissions, cb, allowConsole, suggestion)

Registers a command using ESX functions.


ESX.Command('heal', 'admin', function(xPlayer, args, show_error)
end, false)
ESX.Command('car', 'admin', function(xPlayer, args, show_error)
if not args.model then args.model = "t20" end
end, false, { help = 'Spawn a vehicle', validate = false, arguments = {{name = 'model', type = 'any'}}})

Function Arguments

ArgumentData TypeOptionalDefault ValueExplanation
namestringNo-Name of Command
PermissionsstringNo-Minimum Permission Group
cbFunctionNoxPlayer, args, showErrorFunction to run
AllowConsoleboolNo-Can Be ran from console
suggestiontableYes-Chat Suggestion
argstableYes-Command Arguments

Command Argument Types

numberRequires a Integer Value
playerRequires A playerID, returns player object
stringString Input
itemChecks if input is a valid item
weaponChecks if input is a Weapon
anyAny Input allowed