# NETWORK::NETWORK_HANDLE_FROM_FRIEND

- **Hash:** `0xD45CB817D7E177D2`
- **Namespace:** NETWORK
- **Runtime name (Lua/JS):** `NetworkHandleFromFriend`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** named only
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/NETWORK/NETWORK_HANDLE_FROM_FRIEND

## Signature

```c
void NETWORK_HANDLE_FROM_FRIEND(int friendIndex, Any* gamerHandle);
```

## Parameters

- `friendIndex` (`int`)
- `gamerHandle` (`Any*`)

## Returns

`void`

## Usage

### Lua

```lua
local gamerHandle = NetworkHandleFromFriend(friendIndex, gamerHandle)

-- always available, by hash
local gamerHandle = Citizen.InvokeNative(0xD45CB817D7E177D2, friendIndex, Citizen.PointerValueIntInitialized(gamerHandle))
```

### JavaScript

```js
const gamerHandle = NetworkHandleFromFriend(friendIndex, gamerHandle);

// by hash
const gamerHandle = Citizen.invokeNative('0xD45CB817D7E177D2', friendIndex, Citizen.pointerValueIntInitialized(gamerHandle));
```

### C#

```csharp
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.*
