RedM Natives

NETWORK_ADD_FRIEND

Hash0x8E02D73914064223
Runtime nameNetworkAddFriend
NamespaceNETWORK
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x8E02D73914064223

Signature

BOOL NETWORK_ADD_FRIEND(Any* gamerHandle, const char* message);

Parameters

NameTypeDescription
gamerHandleAny*—
messageconst char*—

Returns BOOL

Usage

Lua
local retval, gamerHandle = NetworkAddFriend(message)

-- always works, by hash
local retval, gamerHandle = Citizen.InvokeNative(0x8E02D73914064223, Citizen.PointerValueInt(), message, Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const [retval, gamerHandle] = NetworkAddFriend(message);

// by hash
const [retval, gamerHandle] = Citizen.invokeNative('0x8E02D73914064223', Citizen.pointerValueInt(), message, Citizen.returnResultAnyway());
C#
var gamerHandle = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0x8E02D73914064223, gamerHandle, message);
// gamerHandle.GetResult<int>()
  • Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
  • 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.