RedM Natives

GET_REGISTERED_COMMANDS

Returns all commands that are registered in the command system.

Hash0xD4BEF069
Runtime nameGetRegisteredCommands
NamespaceCFX
SideClient + server
NameOfficial
Docs

Signature

object GET_REGISTERED_COMMANDS();

Returns object — An object containing registered commands.

Description

Cfx.re native reference

Returns all commands that are registered in the command system. The data returned adheres to the following layout:

[
{
"name": "cmdlist",
"resource": "resource",
"arity" = -1,
},
{
"name": "command1"
"resource": "resource_2",
"arity" = -1,
}
]

Usage

Lua
local retval = GetRegisteredCommands()

-- always works, by hash
local retval = Citizen.InvokeNative(0xd4bef069, Citizen.ResultAsObject2(msgpack.unpack))
JavaScript and C#
JavaScript
const retval = GetRegisteredCommands();

// by hash
const retval = Citizen.invokeNative('0xd4bef069', Citizen.returnResultAnyway(), Citizen.resultAsObject2());
C#
Function.Call((Hash)0xd4bef069);

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.