Skip to content

user_cmd

Represents in-game user command

Properties

Type Name Description
vec3 viewangles Current view angle
number forwardmove Move X
number sidemove Move Y

Methods

get_tickcount(): number

Returns current command's tick count

1
local tc = cmd:get_tickcount()

get_button(btn): bool

Type Name Description Default
number btn Button to check (buttons) none

Returns if usercmd button is pressed

1
local is_firing = cmd:get_button(buttons.attack)

set_button(btn)

Type Name Description Default
number btn Button to set (buttons) none

Forces button to be pressed

1
cmd:set_button(buttons.duck)

unset_button(btn)

Type Name Description Default
number btn Button to unset (buttons) none

Forces button to be released

1
cmd:unset_button(buttons.duck)