Garry's Mod Wiki

Garry's Mod Wiki

  Player:DrawViewModel( boolean draw, number vm = 0 )

Description

Show/Hide the player's weapon's viewmodel.

Arguments

1 boolean draw
Should draw
2 number vm = 0
Which view model to show/hide, 0-2.

Example

Create a ConVar object on the client realm to enable/disable the viewmodel.

local cvarObject = CreateClientConVar("nogun", "1", true, false, "Hide the current viewmodel.") -- Create the ConVar object hook.Add("HUDPaint", "draw_viewmodel", function() LocalPlayer():DrawViewModel( cvarObject:GetBool() ) -- Call ConVar:GetBool() inside the parameters of DrawViewModel end)

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 twice a day. Edits and history are not available.

Last Parsed: Loading...