# CFX::GET_RESOURCE_KVP_STRING

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

## Signature

```c
char* GET_RESOURCE_KVP_STRING(char* key);
```

## Parameters

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

## Returns

`char*` — The string value stored under the specified key, or nil/null if not found.

## Description

*Source: Cfx.re native reference*

A getter for [SET_RESOURCE_KVP](#\_0x21C7A35B).

## Usage

### Lua

```lua
local retval = GetResourceKvpString(key)

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

### JavaScript

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

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

### C#

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

## Examples

*Source: Cfx.re native reference*

```lua
local kvpValue = GetResourceKvpString('codfish') 
if kvpValue then
	-- do something!
end
```

*Sources: Cfx.re native reference.*
