RedM Natives

NETWORK_HANDLE_FROM_FRIEND

Hash0xD45CB817D7E177D2
Runtime nameNetworkHandleFromFriend
NamespaceNETWORK
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0xD45CB817D7E177D2

Signature

void NETWORK_HANDLE_FROM_FRIEND(int friendIndex, Any* gamerHandle);

Parameters

NameTypeDescription
friendIndexint—
gamerHandleAny*—

Returns void

Usage

Lua
local gamerHandle = NetworkHandleFromFriend(friendIndex, gamerHandle)

-- always works, by hash
local gamerHandle = Citizen.InvokeNative(0xD45CB817D7E177D2, friendIndex, Citizen.PointerValueIntInitialized(gamerHandle))
JavaScript and C#
JavaScript
const gamerHandle = NetworkHandleFromFriend(friendIndex, gamerHandle);

// by hash
const gamerHandle = Citizen.invokeNative('0xD45CB817D7E177D2', friendIndex, Citizen.pointerValueIntInitialized(gamerHandle));
C#
var gamerHandle = new OutputArgument();
Function.Call((Hash)0xD45CB817D7E177D2, friendIndex, gamerHandle);
// gamerHandle.GetResult<int>()
  • The last argument is an in/out pointer: pass its initial value, and the updated value is returned after the result.
  • Any* arguments are often structs. Build them with a DataView buffer and pass it with :Buffer() — see the examples and notes below.

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.