NetworkClient

networkGetHostPlayerIndex

NETWORK_GET_HOST_PLAYER_INDEX0x8251FB94DC4FDFC8

The GTA V native NETWORK_GET_HOST_PLAYER_INDEX of the NETWORK namespace, as LS:MP client scripts call it: the global function networkGetHostPlayerIndex, in JavaScript and in Lua.

SignatureJavaScript
networkGetHostPlayerIndex(): Player
SignatureLua
networkGetHostPlayerIndex(): Player

Usage

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

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.

Reference

Namespace
Network NETWORK
In the game
Player NETWORK_GET_HOST_PLAYER_INDEX()
Hash
0x8251FB94DC4FDFC8
Introduced
Game build 2612 legacy numbering
Formerly
_NETWORK_GET_HOST

Open in the interactive natives reference