Lua API
  • 🔎Overview
  • Introduction
    • 🚀Creating scripts
      • 🧠First Steps
      • 🖥️Adding UI
      • 📚Creating Libraries
  • API
    • 🌐Global Functions
    • ⚙️Instances
      • 🔢Math
      • ☎️Events
        • event_t
      • 🎮Game
        • global_vars_t
        • cengine_client
          • cnet_chan
        • ccsgo_input
        • cinput_system
        • cgame_ui_funcs
        • ccvar
          • convar
      • 🕹️Mods
        • events_t
      • ✏️Draw
        • ⚙️Types
          • ⚙️rect
          • ⚙️vec2
          • ⚙️color
          • ⚙️accessor
        • 🖥️Adapter
        • ✏️Layer
          • outline_mode
          • rounding
          • glow_parts
          • text_params
            • text_alignment
          • shadow_dir
          • command
            • render_mode
        • 🖼️Managed
          • 🖼️texture
            • svg_texture
            • animated_texture
          • 🖼️shader
          • ™️font_base
            • font
            • font_gdi
            • glyph_t
            • font_flags
      • 🙋Entities
        • entity_list_t
          • entity_entry_t
        • base_entity
          • schema_accessor_t
          • cs2_weapon_base_gun
          • cs2_player_pawn
          • cs2_player_controller
          • cs2_weapon_base
          • cs2_grenade_projectile
        • ccsweapon_base_vdata
          • cfiring_mode
        • chandle
        • csweapon_mode
        • csweapon_type
        • weapon_id
        • csweapon_category
        • observer_mode_t
      • 🖥️Gui
        • ⚙️Types
          • ⚙️bits
          • ⚙️control_id
        • context
          • user_t
        • context_input
          • mouse_button
        • notification_system
          • notification
        • control
          • control_type
          • value_param
          • checkbox
          • slider
          • label
          • selectable
          • button
          • color_picker
          • spacer
          • text_input
          • combo_box
          • image
        • container
          • control_container
            • layout
            • group
      • ⚙️Utils
    • ⚙️Types
      • ⚙️ptr
      • ⚙️ref_holder_t
      • ⚙️vector
      • ⚙️vector4d
      • 🎮veccolor
      • 🎮color
      • 🎮cview_setup
      • 🎮cuser_cmd
      • 🎮game_event_t
    • 🟰Enums
      • 🟰client_frame_stage
      • 🟰input_bit_mask
Powered by GitBook

© 2025 - FATALITY

On this page
  • command_number
  • get_button
  • set_button
  • remove_button
  • get_viewangles
  • set_viewangles
  • lock_angles
  • get_forwardmove
  • get_leftmove
  • set_forwardmove
  • set_leftmove
  • rotate_movement
Export as PDF
  1. API
  2. Types

cuser_cmd

Describes a user command.

command_number

FieldRead only

Type: int

Current command number.


get_button

Method

Returns state of the specified button.

Arguments

1. Button

Name

Type

Description

button

Button.

Returns

Type

Description

bool

Is pressed.

Example

if cmd:get_button(input_bit_mask.in_use) then
    -- ...
end

set_button

Method

Sets the specified button into the command.

Arguments

1. Button

Name

Type

Description

button

Button.

Example

cmd:set_button(input_bit_mask.in_use)

remove_button

Method

Removes the specified button from the command.

Arguments

1. Button

Name

Type

Description

button

Button.

Example

cmd:remove_button(input_bit_mask.in_attack)

get_viewangles

Method

Returns the current viewangles of the command.

Arguments

None.

Returns

Type

Description

Viewangles.

Example

local ang = cmd:get_viewangles();

set_viewangles

Method

Sets the specified angles into the command.

Arguments

1. Angles

Name

Type

Description

angles

Angles.

Example

cmd:set_viewangles(target_angles)

lock_angles

Method

Sets the command viewangles into the games view.

Arguments

None.

Example

cmd:set_viewangles(target_angles)
cmd:lock_angles()

get_forwardmove

Method

Returns the forwardmove of the command. (0.0 - 1.0)

Arguments

None.

Returns

Type

Description

float

forwardmove.

Example

local fmove = cmd:get_forwardmove();

get_leftmove

Method

Returns the leftmove of the command. (0.0 - 1.0)

Arguments

None.

Returns

Type

Description

float

leftmove.

Example

local lmove = cmd:get_leftmove();

set_forwardmove

Method

Sets the specified forwardmove into the command. (0.0 - 1.0)

Arguments

Type

Description

float

forwardmove.

Example

cmd:set_forwardmove(1.0);

set_leftmove

Method

Sets the specified leftmove into the command. (0.0 - 1.0)

Arguments

Type

Description

float

leftmove.

Example

cmd:set_leftmove(1.0);

rotate_movement

Method

Rotates the commands movement toward the specified yaw without affecting viewangles.

Arguments

Type

Description

float

yaw.

Example

cmd:set_leftmove(0.0);
cmd:set_forwardmove(1.0);
cmd:rotate_movement(target_yaw);
Previouscview_setupNextgame_event_t

Last updated 3 months ago

⚙️
🎮
input_bit_mask
input_bit_mask
input_bit_mask
vector
vector