RedM Natives

GET_CURRENT_SERVER_ENDPOINT

Returns the peer address of the remote game server that the user is currently connected to.

Hash0xEA11BFBA
Runtime nameGetCurrentServerEndpoint
NamespaceCFX
SideClient
NameOfficial
Docs

Signature

char* GET_CURRENT_SERVER_ENDPOINT();

Returns char* — The peer address of the game server (e.g. `127.0.0.1:30120`), or NULL if not available.

Description

Cfx.re native reference

Returns the peer address of the remote game server that the user is currently connected to.

Usage

Lua
local retval = GetCurrentServerEndpoint()

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

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

Sources

Cfx.re native reference

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