networkGetHostOfScript
NETWORK_GET_HOST_OF_SCRIPT0x1D6A14F1F9A736FCThe GTA V native NETWORK_GET_HOST_OF_SCRIPT of the NETWORK namespace, as LS:MP client scripts call it: the global function networkGetHostOfScript, in JavaScript and in Lua.
networkGetHostOfScript(
scriptName: string,
instance_id: number,
position_hash: number
): PlayernetworkGetHostOfScript(
scriptName: string,
instance_id: integer,
position_hash: integer
): PlayerUsage
JavaScript
const player = networkGetHostOfScript(scriptName, instance_id, position_hash);Lua
local player = networkGetHostOfScript(scriptName, instance_id, position_hash)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
scriptName | string | string | string |
instance_id | int | number | integer |
position_hash | int | number | integer |
Returns
Player JavaScript number, Lua integerThe 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.
scriptName examples:
"freemode", "AM_CR_SecurityVan", ...
Most of the time, these values are used:
instance_id = -1
position_hash = 0
Reference
- Namespace
- Network NETWORK
- In the game
Player NETWORK_GET_HOST_OF_SCRIPT(const char* scriptName, int instance_id, int position_hash)- Hash
0x1D6A14F1F9A736FC