Garry's Mod Wiki

CUserCmd:SelectWeapon

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.

Page Links


Special Pages


Wikis

?

Render Time: 33ms

DB GetPage 4
Generate Html 5
SaveChanges (1) 16
Render Body 0
Render Sidebar 6