RedM Natives

GIVE_WEAPON_TO_PED_WITH_OPTIONS

Hash0xBE7E42B07FD317AC
Runtime nameGiveWeaponToPedWithOptions
NamespaceWEAPON
SideClient
NameOfficial
Docs
Since build1207

Signature

BOOL GIVE_WEAPON_TO_PED_WITH_OPTIONS(Ped ped, Any* inData, Any* outData);

Parameters

NameTypeDescription
pedPed—
inDataAny*—
outDataAny*—

Returns BOOL

Usage

Lua
local retval, inData, outData = GiveWeaponToPedWithOptions(ped)

-- always works, by hash
local retval, inData, outData = Citizen.InvokeNative(0xBE7E42B07FD317AC, ped, Citizen.PointerValueInt(), Citizen.PointerValueInt(), Citizen.ReturnResultAnyway())
JavaScript and C#
JavaScript
const [retval, inData, outData] = GiveWeaponToPedWithOptions(ped);

// by hash
const [retval, inData, outData] = Citizen.invokeNative('0xBE7E42B07FD317AC', ped, Citizen.pointerValueInt(), Citizen.pointerValueInt(), Citizen.returnResultAnyway());
C#
var inData = new OutputArgument();
var outData = new OutputArgument();
bool retval = Function.Call<bool>((Hash)0xBE7E42B07FD317AC, ped, inData, outData);
// inData.GetResult<int>()
// outData.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.

Enums and flags

Sources

alloc8or RDR3 NativeDB

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