# CFX::GET_RESOURCE_BY_FIND_INDEX

- **Hash:** `0x387246B7`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `GetResourceByFindIndex`
- **Side:** shared (Cfx runtime native)
- **Name status:** official
- **Documentation:** described with examples
- **URL:** https://natives.borderlinerp.com/natives/CFX/GET_RESOURCE_BY_FIND_INDEX

## Signature

```c
char* GET_RESOURCE_BY_FIND_INDEX(int findIndex);
```

## Parameters

- `findIndex` (`int`) — The index of the resource (starting at 0)

## Returns

`char*` — The resource name as a `string`

## Usage

### Lua

```lua
local retval = GetResourceByFindIndex(findIndex)

-- always available, by hash
local retval = Citizen.InvokeNative(0x387246b7, findIndex, Citizen.ResultAsString())
```

### JavaScript

```js
const retval = GetResourceByFindIndex(findIndex);

// by hash
const retval = Citizen.invokeNative('0x387246b7', findIndex, Citizen.returnResultAnyway(), Citizen.resultAsString());
```

### C#

```csharp
string retval = Function.Call<string>((Hash)0x387246b7, findIndex);
```

## Examples

*Source: Cfx.re native reference*

```lua
local resourceList = {}
for i = 0, GetNumResources(), 1 do
  local resource_name = GetResourceByFindIndex(i)
  if resource_name and GetResourceState(resource_name) == "started" then
    table.insert(resourceList, resource_name)
  end
end
print(table.unpack(resourceList))
```

*Sources: Cfx.re native reference.*
