RedM Natives

GET_GAME_NAME

Returns the current game being executed.

Hash0xE8EAA18B
Runtime nameGetGameName
NamespaceCFX
SideClient + server
NameOfficial
Docs

Signature

char* GET_GAME_NAME();

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

Description

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
local retval = GetGameName()

-- always works, by hash
local retval = Citizen.InvokeNative(0xe8eaa18b, Citizen.ResultAsString())
JavaScript and C#
JavaScript
const retval = GetGameName();

// by hash
const retval = Citizen.invokeNative('0xe8eaa18b', Citizen.returnResultAnyway(), Citizen.resultAsString());
C#
string retval = Function.Call<string>((Hash)0xe8eaa18b);

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.