GET_RESOURCE_BY_FIND_INDEX
Signature
char* GET_RESOURCE_BY_FIND_INDEX(int findIndex);Parameters
| Name | Type | Description |
|---|---|---|
findIndex | int | The index of the resource (starting at 0) |
Returns char* — The resource name as a `string`
Usage
local retval = GetResourceByFindIndex(findIndex)
-- always works, by hash
local retval = Citizen.InvokeNative(0x387246b7, findIndex, Citizen.ResultAsString())JavaScript and C#
const retval = GetResourceByFindIndex(findIndex);
// by hash
const retval = Citizen.invokeNative('0x387246b7', findIndex, Citizen.returnResultAnyway(), Citizen.resultAsString());string retval = Function.Call<string>((Hash)0x387246b7, findIndex);Examples
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
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.