RedM Natives

_SET_PLAYER_AIM_WEAPON

Sets the weapon that the specified player will aim with.

Hash0xCFFC3ECCD7A5CCEB
Runtime nameSetPlayerAimWeapon
NamespacePLAYER
SideClient
NameCommunity guess
Docs
Since build1207

Signature

void _SET_PLAYER_AIM_WEAPON(Player player, Hash weapon, int weaponDrawOrder);

Parameters

NameTypeDescription
playerPlayer—
weaponHash—
weaponDrawOrderint—

Returns void

Description

Sets the weapon that the specified player will aim with. The weapon must already be assigned to the PED. This also determines the weapon order, specifying which weapon the player will automatically switch to when the current weapon runs out of ammo.
Example usage:

Set the player's aim weapon to the specified weapon hash in slot 0
PLAYER::_SET_PLAYER_AIM_WEAPON(PLAYER::PLAYER_ID(), GetHashKey("WEAPON_RIFLE_VARMINT"), 0);

Video: https://youtu.be/-fUMrLIm9ng

Usage

Lua
SetPlayerAimWeapon(player, weapon, weaponDrawOrder)

-- always works, by hash
Citizen.InvokeNative(0xCFFC3ECCD7A5CCEB, player, weapon, weaponDrawOrder)
JavaScript and C#
JavaScript
SetPlayerAimWeapon(player, weapon, weaponDrawOrder);

// by hash
Citizen.invokeNative('0xCFFC3ECCD7A5CCEB', player, weapon, weaponDrawOrder);
C#
Function.Call((Hash)0xCFFC3ECCD7A5CCEB, player, weapon, weaponDrawOrder);
  • Hash parameters: the named function also accepts a string and hashes it for you; Citizen.InvokeNative needs the number — pass joaat("name") or a backtick literal like `name`.
  • The name is a community guess and may change. If the named call is missing in your client build, use InvokeNative with the hash — it always works.

Enums and flags

Sources

alloc8or RDR3 NativeDB

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