# CFX::GET_GAME_NAME

- **Hash:** `0xE8EAA18B`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `GetGameName`
- **Side:** shared (Cfx runtime native)
- **Name status:** official
- **Documentation:** described
- **URL:** https://natives.borderlinerp.com/natives/CFX/GET_GAME_NAME

## Signature

```c
char* GET_GAME_NAME();
```

## Returns

`char*` — The game the script environment is running in.

## Description

*Source: Cfx.re native reference*

Returns the current game being executed.

Possible values:

| Return value | Meaning                        |
| ------------ | ------------------------------ |
| `fxserver`   | Server-side code ('Duplicity') |
| `fivem`      | FiveM for GTA V                |
| `libertym`   | LibertyM for GTA IV            |
| `redm`       | RedM for Red Dead Redemption 2 |

## Usage

### Lua

```lua
local retval = GetGameName()

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

### JavaScript

```js
const retval = GetGameName();

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

### C#

```csharp
string retval = Function.Call<string>((Hash)0xe8eaa18b);
```

*Sources: Cfx.re native reference.*
