RedM Natives

PLAYER_ID

This returns YOUR 'identity' as a Player type.

Hash0x217E9DC48139933D
Runtime namePlayerId
NamespacePLAYER
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x4F8644AF03D0E0D6

Signature

Player PLAYER_ID();

Returns Player

Description

This returns YOUR 'identity' as a Player type.

Always returns 0 in story mode.

Usage

Lua
local retval = PlayerId()

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

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

Sources

alloc8or RDR3 NativeDB

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