Player/DrawViewModel

From Garry's Mod
Jump to: navigation, search
 Player:DrawViewModel( )

Contents

Description

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

Arguments

boolean draw

Should draw

Arguments

number vm=0

Which view model to show/hide, 0-2.

Examples

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)


Personal tools
Navigation