_SET_PLAYER_AIM_WEAPON
Sets the weapon that the specified player will aim with.
Hash
0xCFFC3ECCD7A5CCEBRuntime name
SetPlayerAimWeaponNamespacePLAYER
SideClient
NameCommunity guess
Docs
Since build1207
Signature
void _SET_PLAYER_AIM_WEAPON(Player player, Hash weapon, int weaponDrawOrder);Parameters
| Name | Type | Description |
|---|---|---|
player | Player | — |
weapon | Hash | — |
weaponDrawOrder | int | — |
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
SetPlayerAimWeapon(player, weapon, weaponDrawOrder)
-- always works, by hash
Citizen.InvokeNative(0xCFFC3ECCD7A5CCEB, player, weapon, weaponDrawOrder)JavaScript and C#
SetPlayerAimWeapon(player, weapon, weaponDrawOrder);
// by hash
Citizen.invokeNative('0xCFFC3ECCD7A5CCEB', player, weapon, weaponDrawOrder);Function.Call((Hash)0xCFFC3ECCD7A5CCEB, player, weapon, weaponDrawOrder);- Hash parameters: the named function also accepts a string and hashes it for you;
Citizen.InvokeNativeneeds the number — passjoaat("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
InvokeNativewith the hash — it always works.
Enums and flags
- eWeaponAttachPoint 33 values
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.