RedM Natives

GET_PLAYER_TOKEN

Gets a player's token.

Hash0x54C06897
Runtime nameGetPlayerToken
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

char* GET_PLAYER_TOKEN(char* playerSrc, int index);

Parameters

NameTypeDescription
playerSrcchar*

A player.

indexint

Index between 0 and GET_NUM_PLAYER_TOKENS.

Returns char* — A token value.

Description

Cfx.re native reference

Gets a player's token. Tokens can be used to enhance banning logic, however are specific to a server.

Usage

Lua
local retval = GetPlayerToken(playerSrc, index)

-- always works, by hash
local retval = Citizen.InvokeNative(0x54c06897, playerSrc, index, Citizen.ResultAsString())
JavaScript and C#
JavaScript
const retval = GetPlayerToken(playerSrc, index);

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

Sources

Cfx.re native reference

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