Garry's Mod Wiki

Revision Difference

Player:SetActiveWeapon#528754

<function name="SetActiveWeapon" parent="Player" type="classfunc"> <description> Sets the player's active weapon. You should use <page>CUserCmd:SelectWeapon</page> or <page>Player:SelectWeapon</page>, instead in most cases. ⤶ <note>This function will not trigger the weapon switch event or associated equip animations. You can achieve this using <page>Player:SelectWeapon</page> with <page>Entity:GetClass</page>.</note>⤶ ⤶ <note>This will not call <page>GM:PlayerSwitchWeapon</page>.</note>⤶ ⤶ This function will not trigger the weapon switch events or associated equip animations. It will bypass ⤶ <page>GM:PlayerSwitchWeapon</page> and the currently active weapon's <page>WEAPON:Holster</page> return value. </description> <realm>Server</realm> <args> <arg name="weapon" type="Weapon">The weapon to equip.</arg> </args> </function>