RedM Natives

GET_PLAYER_PING

Hash0xFF1290D4
Runtime nameGetPlayerPing
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

int GET_PLAYER_PING(char* playerSrc);

Parameters

NameTypeDescription
playerSrcchar*—

Returns int — Returns the mean amount of time a packet takes to get to the client

Description

Cfx.re native reference

See GET_PLAYER_PEER_STATISTICS if you want more detailed information, like packet loss, and packet/rtt variance

Usage

Lua
local retval = GetPlayerPing(playerSrc)

-- always works, by hash
local retval = Citizen.InvokeNative(0xff1290d4, playerSrc, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = GetPlayerPing(playerSrc);

// by hash
const retval = Citizen.invokeNative('0xff1290d4', playerSrc, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
int retval = Function.Call<int>((Hash)0xff1290d4, playerSrc);

Sources

Cfx.re native reference

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