PlayerClient

playerId

PLAYER_ID0x4F8644AF03D0E0D6

The GTA V native PLAYER_ID of the PLAYER namespace, as LS:MP client scripts call it: the global function playerId, in JavaScript and in Lua.

SignatureJavaScript
playerId(): Player
SignatureLua
playerId(): Player

Usage

JavaScript
const player = playerId();
Lua
local player = playerId()

Parameters

None.

Returns

Player JavaScript number, Lua integer

The game's own player index: a local slot, as playerId() returns it. Not an LS:MP playerId.

On LS:MP

ℹ
Not your LS:MP player id

This is the game's local player slot: what the Player parameters of other natives expect. Your LS:MP playerId is lsmp.getLocalPlayer.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

This returns YOUR 'identity' as a Player type.

Always returns 0 in story mode.

Reference

Namespace
Player PLAYER
In the game
Player PLAYER_ID()
Hash
0x4F8644AF03D0E0D6

Open in the interactive natives reference