PlayerClient

getPlayerIndex

GET_PLAYER_INDEX0xA5EDC40EF369B48D

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

SignatureJavaScript
getPlayerIndex(): Player
SignatureLua
getPlayerIndex(): Player

Usage

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

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.

Notes

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

Returns the same as playerId and networkPlayerIdToInt

Reference

Namespace
Player PLAYER
In the game
Player GET_PLAYER_INDEX()
Hash
0xA5EDC40EF369B48D

Open in the interactive natives reference