RedM Natives

GET_RESOURCE_COMMANDS

Returns all commands registered by the specified resource.

Hash0x97628584
Runtime nameGetResourceCommands
NamespaceCFX
SideClient + server
NameOfficial
Docs

Signature

object GET_RESOURCE_COMMANDS(char* resource);

Parameters

NameTypeDescription
resourcechar*—

Returns object — An object containing registered commands.

Description

Cfx.re native reference

Returns all commands registered by the specified resource. The data returned adheres to the following layout:

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

Usage

Lua
local retval = GetResourceCommands(resource)

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

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

Sources

Cfx.re native reference

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