NetworkHandleFromPlayer
Docslocal networkHandle = NetworkHandleFromPlayer(player, bufferSize)Description
Returns a handle to networkHandle* from the specified player handle and stores it in a given buffer.
* Currently unknown struct
Example:
std::vector<UINT64> GetPlayerNetworkHandle(Player player) {
const int size = 13;
uint64_t *buffer = std::make_unique<uint64_t[]>(size).get();
NETWORK::NETWORK_HANDLE_FROM_PLAYER(player, reinterpret_cast<int *>(buffer), 13);
for (int i = 0; i < size; i++) {
Log::Msg("networkhandle[%i]: %llx", i, buffer[i]);
}
std::vector<UINT64> result(buffer, buffer + sizeof(buffer));
return result;
}Parameters
| Name | Type | Description |
|---|---|---|
player | Player | — |
networkHandle | int* | — |
bufferSize | int | — |
Quick Snippet: Get Playerplayer
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
voidThis native does not return a value.