Garry's Mod Wiki

Garry's Mod Wiki

  CUserCmd:SelectWeapon( Weapon weapon )

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.

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

1 Weapon weapon
The weapon entity to select.

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...