FiveM Docs
es_extended

Commands

All built-in ESX Legacy chat and console commands with arguments, aliases and default permissions, plus how to change who can use them and add your own.

es_extended registers a set of chat commands for staff and players. Admin commands handle teleporting, money, items, jobs and groups. A few player commands show information about your character. Who may run each command is set in Config.CommandPermissions, and every command is registered through ESX.RegisterCommand.

Overview

FactValue
Defined ines_extended/server/modules/commands/registrations/*.lua
PermissionsConfig.CommandPermissions in shared/config/main.lua
Default admin groupsowner, admin
Player targetServer ID, or me for yourself
LoggingMost admin commands log to the UserActions webhook when Config.AdminLogging = true

How permissions work

When a command is registered, ESX runs add_ace group.<group> command.<name> allow for every group in its Config.CommandPermissions entry. Every loaded player gets the principal identifier.<license> → group.<their group>, so a player in group admin may run all commands that list admin.

shared/config/main.lua
Config.CommandPermissions = {
    ["car"] = { "owner", "admin", "mod" }, -- let the "mod" group spawn cars
    ["clear"] = { "user", "admin", "owner" },
    -- ...
}

A command whose key is missing from Config.CommandPermissions falls back to admin only and prints a warning. Aliases share the permission of the main name, for example /tp uses the setcoords entry.

Arguments marked "player" accept a server ID of an online player or me. When an argument has the wrong type, ESX shows an error notification (or prints it in the console) and does not run the command.

Player commands

Default permission: user, admin, owner.

CommandAliasesArgumentsConsoleWhat it does
/clear/clsnoneNoClears your own chat.
/groupnoneNoPrints your name and group to the server console.
/jobnoneNoPrints your job name, grade label and duty state to the server console.
/infononeNoPrints your server ID, name, group and job name to the server console.
/playtimenoneNoPrints the total playtime of your character in days, hours and minutes to the server console.

Teleport and movement

Default permission: owner, admin.

CommandAliasesArgumentsConsoleWhat it does
/setcoords/tpx y z (coordinates)NoTeleports you to the coordinates. Commas are ignored, so /tp 215.7, -810.1, 30.7 works.
/tpmnoneNoTeleports you to your map waypoint.
/gotoplayerId (player)NoTeleports you to the player and moves you into their routing bucket.
/bringplayerId (player)NoTeleports the player to you and moves them into your routing bucket.
/noclipnoneNoToggles noclip for yourself.
/coordsnoneNoPrints your position as vector3 and vector4 to the server console.
/setdim/setbucketplayerId (player), dimension (number)YesSets the player's routing bucket. Bucket 0 is the default world.
/setcoords -1037.5 -2737.6 20.2
/goto 12
/setbucket me 5

Player control

CommandArgumentsConsoleWhat it does
/killplayerId (player)YesKills the player.
/freezeplayerId (player)YesFreezes the player in place.
/unfreezeplayerId (player)YesUnfreezes the player.
/setjobplayerId (player), job (string), grade (number)YesSets job and grade. Fails with an error if the job or grade does not exist. Duty uses Config.DefaultJobDuty.
/setgroupplayerId (player), group (string)YesSets the permission group. superadmin is changed to admin.
/saveplayerId (player)YesSaves the player to the database now.
/saveallnoneYesSaves all online players.
/playersnoneYesPrints ID, name, group and identifier of every online player to the console.
/setjob 4 police 2
/setgroup 4 admin

Money

CommandArgumentsConsoleWhat it does
/setaccountmoneyplayerId (player), account (string), amount (number)YesSets the balance of an account (money, bank, black_money or a custom one).
/giveaccountmoneyplayerId (player), account (string), amount (number)YesAdds money to the account.
/removeaccountmoneyplayerId (player), account (string), amount (number)YesRemoves money from the account. The balance never goes below 0.
/giveaccountmoney 4 bank 25000
/setaccountmoney me money 0

Use positive amounts. 0 or negative values make the underlying xPlayer method throw an error in the server console. See xPlayer money functions.

Items and weapons

These commands only exist with the default ESX inventory. With ox_inventory they are not registered.

CommandArgumentsConsoleWhat it does
/giveitemplayerId (player), item (item), count (number above 0)YesAdds items. Does not check the weight limit.
/giveweaponplayerId (player), weapon (weapon), ammo (number)YesGives a weapon. Fails if the player already has it.
/giveammoplayerId (player), weapon (weapon), ammo (number above 0)YesAdds ammo to a weapon the player has.
/giveweaponcomponentplayerId (player), weaponName (weapon), componentName (string)YesAttaches a component. Uses ESX component names such as suppressor or clip_extended.
/clearinventoryplayerId (player)YesRemoves all items. Fires esx:playerInventoryCleared.
/clearloadoutplayerId (player)YesRemoves all weapons. Fires esx:playerLoadoutCleared.
/refreshitemsnoneYesReloads the items table and reports how many items were loaded.
/giveitem me bread 5
/giveweapon 4 weapon_pistol 120
/giveweaponcomponent 4 weapon_pistol flashlight

Weapon names are not case-sensitive in commands. Component names come from Config.Weapons.

Vehicles

CommandAliasesArgumentsConsoleWhat it does
/carcar (model, optional)NoDeletes the vehicle you sit in, spawns the model (default adder) server-side and puts you in the driver seat.
/cardel/dvradius (number, optional)NoDeletes the vehicle you are in and every vehicle within radius (default 5).
/fix/repairplayerId (player)YesRepairs the vehicle the player is driving. The target must be in the driver seat. Use /fix me for yourself.

Server and chat

CommandAliasesArgumentsConsoleWhat it does
/clearall/clsallnoneYesClears the chat for every player.
/refreshjobsnoneYesReloads all jobs and grades from the database.

Console-only commands

These are plain FiveM commands that only work in the server console.

CommandWhat it does
clearvehicletypesClears the cached vehicle types used by ESX.GetVehicleType.
resetmigrationsMarks all ESX database migrations as not run, so they run again on the next start.

Add your own command

Use ESX.RegisterCommand. It handles permissions, argument parsing and chat suggestions:

server/commands.lua
ESX.RegisterCommand("heal", { "admin", "owner" }, function(xPlayer, args, showError)
    local target = args.playerId
    target.triggerEvent("myadmin:client:heal")
    showError(("Healed %s"):format(target.getName()))
end, true, {
    help = "Heal a player",
    validate = true,
    arguments = {
        { name = "playerId", help = "Player ID or me", type = "player" },
    },
})

Use a table for the group to keep it in line with Config.CommandPermissions. If you register a name that already exists (for example car), your handler replaces the built-in one.

Common issues

  • "Command Cannot be executed from console": the command needs a player (for example /car, /tp, /noclip).
  • Nothing happens for players in a custom group: add the group to the command in Config.CommandPermissions and restart es_extended.
  • /giveweapon errors with an invalid name: the weapon must exist in Config.Weapons. An unknown name fails the internal lookup.
  • /tpm or /noclip do nothing for a custom staff group: besides the command permission, the client asks the esx:isUserAdmin callback. That only passes for players with the ACE command or a group in Config.AdminGroups.
  • Everyone is admin on a local test server: with sv_lan "true", xPlayer.isAdmin() returns true for every player.

Frequently asked questions

Independent documentation

esx-fivem.com is a community project and is not affiliated with the ESX Framework team. Facts on this page were checked against the upstream source. Official resources: docs.esx-framework.org and github.com/esx-framework.
Edit on GitHub

Last updated on

On this page