# CFX::GET_EXTERNAL_KVP_INT

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

## Signature

```c
int GET_EXTERNAL_KVP_INT(char* resource, char* key);
```

## Parameters

- `resource` (`char*`) — The resource to fetch from.
- `key` (`char*`) — The key to fetch

## Returns

`int` — A int that contains the value stored in the Kvp or nil/null if none.

## Description

*Source: Cfx.re native reference*

A getter for [SET_RESOURCE_KVP_INT](#\_0x6A2B1E8), but for a specified resource.

## Usage

### Lua

```lua
local retval = GetExternalKvpInt(resource, key)

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

### JavaScript

```js
const retval = GetExternalKvpInt(resource, key);

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

### C#

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

## Examples

*Source: Cfx.re native reference*

```lua
local kvpValue = GetExternalKvpInt('food', 'bananabread') 
if kvpValue then
	-- do something!
end
```

*Sources: Cfx.re native reference.*
