CUserCmd/SelectWeapon

From Garry's Mod
Jump to: navigation, search
 CUserCmd:SelectWeapon( )

Description

Forces the associated player to select a weapon. This is used internally in the default HL2 weapon selection HUD.

This may not work immediately if the current command is in prediction. Use input.SelectWeapon to switch the weapon from the client when the next available command can do so.

NOTE

This is the ideal function to use to create a custom weapon selection HUD, as it allows prediction to run properly for WEAPON:Deploy and GM:PlayerSwitchWeapon

Arguments

Weapon weapon

The weapon entity to select.
Personal tools
Navigation