PlayerClient

intToPlayerindex

INT_TO_PLAYERINDEX0x41BD2A6B006AF756

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

SignatureJavaScript
intToPlayerindex(value: number): Player
SignatureLua
intToPlayerindex(value: integer): Player

Usage

JavaScript
const player = intToPlayerindex(value);
Lua
local player = intToPlayerindex(value)

Parameters

ParameterTypeJavaScriptLua
valueintnumberinteger

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.

Simply returns whatever is passed to it (Regardless of whether the handle is valid or not).

Reference

Namespace
Player PLAYER
In the game
Player INT_TO_PLAYERINDEX(int value)
Hash
0x41BD2A6B006AF756

Open in the interactive natives reference