NetworkGetHostOfScript
Docslocal retval = NetworkGetHostOfScript(scriptName, p1, p2)Description
scriptName examples:
"freemode", "AM_CR_SecurityVan", ...
Most of the time, these values are used:
p1 = -1
p2 = 0Parameters
| Name | Type | Description |
|---|---|---|
scriptName | char* | — |
p1 | int | — |
p2 | int | — |
Quick Snippet: Get Player→ Player
→ PlayerUse this to get the local player ID or a target player's server ID.
-- Get the local player index (client-side)
local playerId = PlayerId()
-- Get the local player's server ID (for server events)
local serverId = GetPlayerServerId(playerId)
print("Player ID: " .. playerId)
print("Server ID: " .. serverId)
-- Get player ped from a server ID:
-- local targetPed = GetPlayerPed(GetPlayerFromServerId(targetServerId))Returns
PlayerReturns a player handle/index.