# CFX::GET_RESOURCE_COMMANDS

- **Hash:** `0x97628584`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `GetResourceCommands`
- **Side:** shared (Cfx runtime native)
- **Name status:** official
- **Documentation:** described
- **URL:** https://natives.borderlinerp.com/natives/CFX/GET_RESOURCE_COMMANDS

## Signature

```c
object GET_RESOURCE_COMMANDS(char* resource);
```

## Parameters

- `resource` (`char*`)

## Returns

`object` — An object containing registered commands.

## Description

*Source: 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

```lua
local retval = GetResourceCommands(resource)

-- always available, by hash
local retval = Citizen.InvokeNative(0x97628584, resource, Citizen.ResultAsObject2(msgpack.unpack))
```

### JavaScript

```js
const retval = GetResourceCommands(resource);

// by hash
const retval = Citizen.invokeNative('0x97628584', resource, Citizen.returnResultAnyway(), Citizen.resultAsObject2());
```

### C#

```csharp
Function.Call((Hash)0x97628584, resource);
```

*Sources: Cfx.re native reference.*
