RedM Natives

GET_PLAYER_INDEX

Returns the same as PLAYER_ID and NETWORK_PLAYER_ID_TO_INT

Hash0x47E385B0D957C8D4
Runtime nameGetPlayerIndex
NamespacePLAYER
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0xA5EDC40EF369B48D

Signature

Player GET_PLAYER_INDEX();

Returns Player

Description

Returns the same as PLAYER_ID and NETWORK_PLAYER_ID_TO_INT

Usage

Lua
local retval = GetPlayerIndex()

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

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

Sources

alloc8or RDR3 NativeDB

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