# CFX::GET_RESOURCE_KVP_INT

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

## Signature

```c
int GET_RESOURCE_KVP_INT(char* key);
```

## Parameters

- `key` (`char*`) — The key to fetch

## Returns

`int` — The integer value stored under the specified key, or 0 if not found.

## Description

*Source: Cfx.re native reference*

A getter for [SET_RESOURCE_KVP_INT](#\_0x6A2B1E8).

## Usage

### Lua

```lua
local retval = GetResourceKvpInt(key)

-- always available, by hash
local retval = Citizen.InvokeNative(0x557b586a, key, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetResourceKvpInt(key);

// by hash
const retval = Citizen.invokeNative('0x557b586a', key, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0x557b586a, key);
```

## Examples

*Source: Cfx.re native reference*

```lua
local kvpValue = GetResourceKvpInt('bananabread') 
if kvpValue ~= 0 then
	-- do something!
end
```

## See also

- [CFX::SET_RESOURCE_KVP_INT](https://natives.borderlinerp.com/natives/CFX/SET_RESOURCE_KVP_INT.md) — A setter for GET_RESOURCE_KVP_INT.

*Sources: Cfx.re native reference.*
