> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: User Command
icon: user-cog
sidebar_position: 2
---

# <ApiPageIcon icon="user-cog" />User Command

<ApiExposes data="[{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;UserCmd&#x22;,&#x22;h&#x22;:&#x22;#usercmd&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;h&#x22;:&#x22;#usercmdinbuttonhandle&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;UserCmd.SubtickMoveStepHandle&#x22;,&#x22;h&#x22;:&#x22;#usercmdsubtickmovestephandle&#x22;},{&#x22;k&#x22;:&#x22;CDATA&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;CSGOInterpolationInfo&#x22;,&#x22;h&#x22;:&#x22;#csgointerpolationinfo&#x22;},{&#x22;k&#x22;:&#x22;CDATA&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;,&#x22;h&#x22;:&#x22;#tickandinterpolationamount_t&#x22;},{&#x22;k&#x22;:&#x22;CTYPE&#x22;,&#x22;c&#x22;:&#x22;ctor&#x22;,&#x22;s&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;,&#x22;h&#x22;:&#x22;#tickandinterpolationamount_t-1&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;UserCmd.InputHistoryEntryHandle&#x22;,&#x22;h&#x22;:&#x22;#usercmdinputhistoryentryhandle&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;UserCmd.SubtickMoves&#x22;,&#x22;h&#x22;:&#x22;#usercmdsubtickmoves&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;UserCmd.InputHistory&#x22;,&#x22;h&#x22;:&#x22;#usercmdinputhistory&#x22;},{&#x22;k&#x22;:&#x22;NAMESPACE&#x22;,&#x22;c&#x22;:&#x22;fn&#x22;,&#x22;s&#x22;:&#x22;simulation&#x22;,&#x22;h&#x22;:&#x22;#simulation&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;simulation.Player&#x22;,&#x22;h&#x22;:&#x22;#simulationplayer&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;simulation.Movement&#x22;,&#x22;h&#x22;:&#x22;#simulationmovement&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;simulation.Weapon&#x22;,&#x22;h&#x22;:&#x22;#simulationweapon&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;simulation.GrenadePoint&#x22;,&#x22;h&#x22;:&#x22;#simulationgrenadepoint&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;simulation.GrenadeDamage&#x22;,&#x22;h&#x22;:&#x22;#simulationgrenadedamage&#x22;},{&#x22;k&#x22;:&#x22;OBJECT&#x22;,&#x22;c&#x22;:&#x22;method&#x22;,&#x22;s&#x22;:&#x22;simulation.Grenade&#x22;,&#x22;h&#x22;:&#x22;#simulationgrenade&#x22;}]" />

## UserCmd<ApiTag label="object type" />

The input command that the client sends to the server every tick. It holds the movement, the
view angles and the button states.

It is passed to the `createmove`, `pre_movement` and `post_movement` events. You can read the
fields and assign new values to change the input of the player. Reading an unknown field
returns nil. Assigning an unknown field throws an error.

To turn the view, use the `events.input_poll` event with `input.InputPollContext:GetViewAngles`
and `input.InputPollContext:SetViewAngles` instead.

The button fields are handles. To change the state of a button, assign a value to a field of the
handle, for example `cmd.in_jump.down = true`. Assigning a value to the button field itself throws
an error.

The user command for a single tick. It holds the input and view state that is sent to the server.

<ApiMembers>
  <ApiMember kind="prop" name="UserCmd.attack1_start_history_index" summary="The index in the input history at which the primary attack started, or nil if it did not start." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.attack2_start_history_index" summary="The index in the input history at which the secondary attack started, or nil if it did not start." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.client_tick" summary="The client tick at which this command was created." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.forwardmove" summary="The forward and backward movement, as a fraction of the maximum movement speed. Assigned values are normalized when the command is processed." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.has_new_snapshot" summary="True if a new world snapshot arrived before this pass. Read-only." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.impulse" summary="The impulse command number. An impulse triggers an action for a single tick." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_attack" summary="Primary fire." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_attack2" summary="Secondary fire or scope." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_back" summary="Move backward." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_duck" summary="Duck." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_forward" summary="Move forward." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_joyautosprint" summary="Automatic sprint with a gamepad." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_jump" summary="Jump." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_look_at_weapon" summary="Inspect the weapon." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_moveleft" summary="Move left." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_moveright" summary="Move right." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_reload" summary="Reload." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_score" summary="Show the scoreboard." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_speed" summary="Walk." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_turnleft" summary="Turn left with the keyboard or a gamepad." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_turnright" summary="Turn right with the keyboard or a gamepad." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_use" summary="Use or interact." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_useorreload" summary="The shared button for use and reload." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.in_zoom" summary="Zoom or toggle the scope." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinbuttonhandle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.input_history" summary="The input samples of each frame that are attached to this command. Read-only." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InputHistory&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinputhistory&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.is_first_pass" summary="True on the first pass over this command, and false while the command is processed again. Read-only." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.leftmove" summary="The left and right movement, as a fraction of the maximum movement speed. Assigned values are normalized when the command is processed." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.legacy_command_number" summary="The sequence number of the command. The server uses it to confirm the command." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.mousedx" summary="The raw horizontal mouse movement in this tick." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.mousedy" summary="The raw vertical mouse movement in this tick." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.moveangles" summary="The angles that give the direction of movement. They are separate from the view angles." ret="[[{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.needs_full_recompute" summary="True if the command must be built again from the start. Read-only." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.random_seed" summary="The random seed that client side prediction uses to get the same results as the server." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.should_set_viewangles" summary="Assign `true` to apply `viewangles` to the local camera after the callback. The angles are copied at the moment of the assignment, so later changes to `viewangles` are not applied. Assign `false` to cancel the request. This moves the camera even when it is set on a copy, so do not set it on copies used for simulation. It does not change what is sent to the server." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.subtick_moves" summary="The subtick input steps. Read-only." ret="[[{&#x22;s&#x22;:&#x22;UserCmd.SubtickMoves&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdsubtickmoves&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.upmove" summary="The vertical movement, for example when swimming up or down." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.viewangles" summary="The view angles of the player, as pitch, yaw and roll." ret="[[{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.weaponselect" summary="The entity index of the weapon that the player wants to switch to." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="method" name="UserCmd:Finalized" summary="Returns a copy of this command with the movement resolved and corrected against the given simulation. This command is not changed." args="sim" sig="[{&#x22;s&#x22;:&#x22;UserCmd:Finalized&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;sim&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;simulation.Player&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulationplayer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;UserCmd&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmd&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;UserCmd&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmd&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;sim&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;simulation.Player&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulationplayer&#x22;}],&#x22;d&#x22;:&#x22;The simulation that the command is finalized against.&#x22;}]" nodiscard>
    <ApiNotes>
      Clone a simulation that an event gave you before you run commands on it. The result is only a
      prediction and is not sent to the server.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="UserCmd:Clone" summary="Returns a full copy of this command." args="" sig="[{&#x22;s&#x22;:&#x22;UserCmd:Clone&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;UserCmd&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmd&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;UserCmd&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmd&#x22;}]]" nodiscard />
</ApiMembers>

## UserCmd.InButtonHandle<ApiTag label="object type" />

The state of one button in a command. Reading an unknown field returns nil. Assigning an
unknown field throws an error.

<ApiMembers>
  <ApiMember kind="prop" name="UserCmd.InButtonHandle.down" summary="True if the button is down. Assigning a value forces the button state." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.InButtonHandle.pressed" summary="True if the button was pressed in this command. Assigning a value throws an error." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.InButtonHandle.released" summary="True if the button was released in this command. Assigning a value throws an error." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.InButtonHandle.state" summary="The raw state of the button. Assigning a value sets the button state." ret="[[{&#x22;s&#x22;:&#x22;server.EInButtonState&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/server/EInButtonState&#x22;}]]" />

  <ApiMember kind="method" name="UserCmd.InButtonHandle:RemoveButton" summary="Removes this button from the command for this tick." args="" sig="[{&#x22;s&#x22;:&#x22;UserCmd.InButtonHandle:RemoveButton&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" />
</ApiMembers>

## UserCmd.SubtickMoveStepHandle<ApiTag label="object type" />

One subtick input step. Assigning an unknown field throws an error. If the step was removed from
the command, using the handle throws an error.

<ApiMembers>
  <ApiMember kind="prop" name="UserCmd.SubtickMoveStepHandle.button" summary="The button that this step presses or releases." ret="[[{&#x22;s&#x22;:&#x22;server.InputBitMask_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/server/InputBitMask_t&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.SubtickMoveStepHandle.index" summary="The index of this step. Read-only." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.SubtickMoveStepHandle.move" summary="The analog movement. Assign nil to remove it." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.SubtickMoveStepHandle.moveangles" summary="The direction used for the movement fix. Assign nil to remove it." ret="[[{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.SubtickMoveStepHandle.preserve" summary="Set it to true to stop the engine from removing this step." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.SubtickMoveStepHandle.pressed" summary="True if the button is pressed, false if it is released." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.SubtickMoveStepHandle.viewangles" summary="The absolute view angles. The roll is ignored. Assign nil to remove them." ret="[[{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.SubtickMoveStepHandle.when" summary="The fraction of the tick at which the step happens." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />
</ApiMembers>

## CSGOInterpolationInfo<ApiTag label="cdata" href="/cs2/api_reference/tutorials/ffi-crash-course#ctype-and-cdata" title="cdata<struct CSGOInterpolationInfo>" />

An FFI cdata value that describes an interpolation between two recorded ticks.

Use `ffi.new("CSGOInterpolationInfo", { src_tick = 100, dst_tick = 101, frac = 0.5 })` to create
a separate value.

A value read from the command history is a reference into the history. Get it again after you
replace the field or change the history that holds it.

<ApiMembers>
  <ApiMember kind="prop" name="CSGOInterpolationInfo.dst_tick" summary="The tick at which the interpolation ends." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="CSGOInterpolationInfo.frac" summary="The interpolation amount between the start tick and the end tick." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="CSGOInterpolationInfo.src_tick" summary="The tick at which the interpolation starts." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />
</ApiMembers>

## TickAndInterpolationAmount\_t<ApiTag label="cdata" href="/cs2/api_reference/tutorials/ffi-crash-course#ctype-and-cdata" title="cdata<struct TickAndInterpolationAmount_t>" />

<ApiSymbol inherits="[{&#x22;n&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#tickandinterpolationamount_t-1&#x22;}]" />

An FFI cdata value that stores a tick and a fraction of a tick. It holds an `int tick` followed
by a `float fraction`.

Create one with `TickAndInterpolationAmount_t(tick, fraction)`. Keep the fraction at 0 or more
and less than 1. The constructor does not normalize it.

The tick fields of the command history return separate copies. To update an entry, assign the
edited copy back to the field. Assign nil to clear the field.

<ApiMembers>
  <ApiMember kind="prop" name="TickAndInterpolationAmount_t.fraction" summary="The fraction of a tick, at 0 or more and less than 1, stored as a 32-bit float." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="TickAndInterpolationAmount_t.tick" summary="The whole number of ticks, stored as a signed 32-bit integer." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />
</ApiMembers>

<Heading level={2} id="tickandinterpolationamount_t-1">
  TickAndInterpolationAmount_t

  <ApiTag label="ctype · callable" href="/cs2/api_reference/tutorials/ffi-crash-course#ctype-and-cdata" title="ctype<struct TickAndInterpolationAmount_t>" />
</Heading>

<ApiMembers>
  <ApiMember kind="ctor" name="TickAndInterpolationAmount_t()" summary="Zero tick and fraction" syntax="TickAndInterpolationAmount_t()" mm="__call" sig="[{&#x22;s&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#tickandinterpolationamount_t&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#tickandinterpolationamount_t&#x22;}]]" />

  <ApiMember kind="ctor" name="TickAndInterpolationAmount_t(tick, fraction)" syntax="TickAndInterpolationAmount_t(tick, fraction)" mm="__call" sig="[{&#x22;s&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;tick&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;fraction&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#tickandinterpolationamount_t&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#tickandinterpolationamount_t&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;tick&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]},{&#x22;n&#x22;:&#x22;fraction&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]}]" />

  <ApiMember kind="ctor" name="TickAndInterpolationAmount_t(self)" summary="Copy" syntax="TickAndInterpolationAmount_t(self)" mm="__call" sig="[{&#x22;s&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;self&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#tickandinterpolationamount_t&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#tickandinterpolationamount_t&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#tickandinterpolationamount_t&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;self&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#tickandinterpolationamount_t&#x22;}]}]" />
</ApiMembers>

## UserCmd.InputHistoryEntryHandle<ApiTag label="object type" />

One recorded input sample of a command. Assigning an unknown field throws an error. If the entry
was removed from the command, using the handle throws an error.

The tick fields return separate FFI cdata copies. To update the entry, edit a copy and assign it
back. Assign nil to clear an optional field.

The interpolation fields return `CSGOInterpolationInfo` references into the entry, and you can
change them in place. Get them again after you replace or clear the field, change the history,
or after the command is no longer valid. Assigning an interpolation value copies it into the entry.

<ApiMembers>
  <ApiMember kind="prop" name="UserCmd.InputHistoryEntryHandle.cl_interp" summary="The client interpolation amount. Assign nil to clear it." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.InputHistoryEntryHandle.index" summary="The index of this entry, starting at zero. Read-only." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.InputHistoryEntryHandle.player_interp" summary="The player interpolation sample, as a reference into the entry. Assigning a value copies it. Assign nil to clear it." ret="[[{&#x22;s&#x22;:&#x22;CSGOInterpolationInfo&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#csgointerpolationinfo&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.InputHistoryEntryHandle.player_tick" summary="The player time, as a separate FFI cdata copy. Assign it back after you edit it. Assign nil to clear it." ret="[[{&#x22;s&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#tickandinterpolationamount_t&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.InputHistoryEntryHandle.render_tick" summary="The render time, as a separate FFI cdata copy. Assign it back after you edit it. Assign nil to clear it." ret="[[{&#x22;s&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#tickandinterpolationamount_t&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.InputHistoryEntryHandle.sv_interp0" summary="The first server interpolation sample, as a reference into the entry. Assigning a value copies it. Assign nil to clear it." ret="[[{&#x22;s&#x22;:&#x22;CSGOInterpolationInfo&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#csgointerpolationinfo&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.InputHistoryEntryHandle.sv_interp1" summary="The second server interpolation sample, as a reference into the entry. Assigning a value copies it. Assign nil to clear it." ret="[[{&#x22;s&#x22;:&#x22;CSGOInterpolationInfo&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#csgointerpolationinfo&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="UserCmd.InputHistoryEntryHandle.viewangles" summary="The view angles recorded in this sample. It is a reference into the entry, and you can change it in place." ret="[[{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;}]]" />
</ApiMembers>

## UserCmd.SubtickMoves<ApiTag label="object type" />

<ApiSymbol inherits="[{&#x22;n&#x22;:&#x22;{ [integer]: (UserCmd.SubtickMoveStepHandle)? }&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;{&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;UserCmd.SubtickMoveStepHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdsubtickmovestephandle&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;}&#x22;}]}]" />

The subtick steps of a command. Indices start at zero. Reading an index that does not exist
returns nil. A command can hold at most 32 steps.

<ApiMembers>
  <ApiMember kind="method" name="UserCmd.SubtickMoves:Size" args="" sig="[{&#x22;s&#x22;:&#x22;UserCmd.SubtickMoves:Size&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="method" name="UserCmd.SubtickMoves:Remove" summary="Removes the step at index `i`. Indices start at zero. The indices of the steps after it go down by one, so get new handles afterwards. If the index does not exist, the function throws an error." args="i" sig="[{&#x22;s&#x22;:&#x22;UserCmd.SubtickMoves:Remove&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;i&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;i&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]}]" />

  <ApiMember kind="method" name="UserCmd.SubtickMoves:PopBack" summary="Removes the last step. If there are no steps, nothing happens." args="" sig="[{&#x22;s&#x22;:&#x22;UserCmd.SubtickMoves:PopBack&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" />

  <ApiMember kind="method" name="UserCmd.SubtickMoves:Clear" summary="Removes all steps." args="" sig="[{&#x22;s&#x22;:&#x22;UserCmd.SubtickMoves:Clear&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" />

  <ApiMember kind="method" name="UserCmd.SubtickMoves:EmplaceBack" summary="Adds a step at the end and returns its handle. If `when` is not given, it is `0`." args="when?" sig="[{&#x22;s&#x22;:&#x22;UserCmd.SubtickMoves:EmplaceBack&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;when&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;UserCmd.SubtickMoveStepHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdsubtickmovestephandle&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;UserCmd.SubtickMoveStepHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdsubtickmovestephandle&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;when&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],&#x22;o&#x22;:true}]">
    <ApiNotes>
      A command can hold at most 32 steps. Adding more throws an error. With a button, the value must
      be a single button, otherwise the function throws an error.
    </ApiNotes>
  </ApiMember>
</ApiMembers>

## UserCmd.InputHistory<ApiTag label="object type" />

<ApiSymbol inherits="[{&#x22;n&#x22;:&#x22;{ [integer]: (UserCmd.InputHistoryEntryHandle)? }&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;{&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;:&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;UserCmd.InputHistoryEntryHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinputhistoryentryhandle&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;},{&#x22;s&#x22;:&#x22; &#x22;},{&#x22;s&#x22;:&#x22;}&#x22;}]}]" />

The input history entries of a command. Indices start at zero. Reading an index that does not
exist returns nil. A command can hold at most 16 entries.

<ApiMembers>
  <ApiMember kind="method" name="UserCmd.InputHistory:Size" args="" sig="[{&#x22;s&#x22;:&#x22;UserCmd.InputHistory:Size&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="method" name="UserCmd.InputHistory:Remove" summary="Removes the entry at index `i`. Indices start at zero. The indices of the entries after it go down by one, so get new handles afterwards. If the index does not exist, the function throws an error." args="i" sig="[{&#x22;s&#x22;:&#x22;UserCmd.InputHistory:Remove&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;i&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;i&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]}]" />

  <ApiMember kind="method" name="UserCmd.InputHistory:PopBack" summary="Removes the last entry. If there are no entries, nothing happens." args="" sig="[{&#x22;s&#x22;:&#x22;UserCmd.InputHistory:PopBack&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" />

  <ApiMember kind="method" name="UserCmd.InputHistory:Clear" summary="Removes all entries." args="" sig="[{&#x22;s&#x22;:&#x22;UserCmd.InputHistory:Clear&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" />

  <ApiMember kind="method" name="UserCmd.InputHistory:EmplaceBack" summary="Adds an empty entry at the end and returns its handle. A command can hold at most 16 entries. Adding more throws an error. Update the attack history indices of the command when you change the history." args="" sig="[{&#x22;s&#x22;:&#x22;UserCmd.InputHistory:EmplaceBack&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;UserCmd.InputHistoryEntryHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinputhistoryentryhandle&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;UserCmd.InputHistoryEntryHandle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmdinputhistoryentryhandle&#x22;}]]" />

  <ApiMember kind="method" name="UserCmd.InputHistory:Resize" summary="Adds or removes entries at the end, so that the history has exactly `size` entries." args="size" sig="[{&#x22;s&#x22;:&#x22;UserCmd.InputHistory:Resize&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;size&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;size&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;The new number of entries, from 0 to 16.&#x22;}]">
    <ApiNotes>
      If `size` is less than 0 or more than 16, the function throws an error.
    </ApiNotes>
  </ApiMember>
</ApiMembers>

## simulation<ApiTag label="global table" />

The simulation of players, movement and weapons. It is used by `entity:GetPlayerSimulation` and
the movement events.

<ApiMembers>
  <ApiMember kind="fn" name="simulation.Grenade" summary="Creates a grenade simulation." args="source, thrower?" sig="[{&#x22;s&#x22;:&#x22;simulation.Grenade&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;source&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;thrower&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;simulation.Grenade&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulationgrenade&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;simulation.Grenade&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulationgrenade&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;source&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;|&#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}],&#x22;d&#x22;:&#x22;An item definition index, a held grenade, or a grenade projectile.&#x22;},{&#x22;n&#x22;:&#x22;thrower&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;}],&#x22;d&#x22;:&#x22;The thrower. For entities, the default is the owner of the grenade.&#x22;,&#x22;o&#x22;:true}]" returns="[{&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;simulation.Grenade&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulationgrenade&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}],&#x22;d&#x22;:&#x22;Nil if the entity is not valid, or is not a held grenade or a projectile. An unsupported index or an argument of another type throws an error.&#x22;}]" nodiscard>
    <ApiNotes>
      Pass an item definition index to simulate a grenade without an entity. The supported indices
      are 43 for the flashbang, 44 for the HE grenade, 45 for the smoke grenade, 46 for the molotov,
      47 for the decoy and 48 for the incendiary grenade. You can also pass the `m_iItemDefinitionIndex`
      of a held weapon.

      Pass a held grenade or a grenade projectile in flight to simulate that entity. A projectile
      follows its networked state during `Run`.

      Without a thrower, hits on players are skipped. If the simulation has neither a thrower nor a
      grenade entity, `GetDamage` throws an error for HE grenades. The spread of fire from a molotov
      or incendiary grenade is not simulated.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="type" name="simulation.SimOpt" summary="Flags that make a simulation faster by skipping parts of it. Combine them with `bit.bor` into the mask that `entity:GetPlayerSimulation` takes. Each flag skips the named part. Only combine the flags for parts that your simulation does not need." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]">
    <ApiEnum name="simulation.SimOpt" values="[[&#x22;kNone&#x22;,&#x22;0&#x22;,&#x22;Nothing is skipped, so the full simulation runs&#x22;],[&#x22;kNoPlayerCollision&#x22;,&#x22;1&#x22;,&#x22;Skips collision between players&#x22;],[&#x22;kNoEyePos&#x22;,&#x22;2&#x22;,&#x22;Skips updates of the eye position&#x22;],[&#x22;kNoWeaponSimulation&#x22;,&#x22;4&#x22;,&#x22;Skips the weapon simulation&#x22;],[&#x22;kNoRareEvents&#x22;,&#x22;8&#x22;,&#x22;Skips rare events&#x22;]]" />
  </ApiMember>
</ApiMembers>

## simulation.Player<ApiTag label="object type" />

A snapshot of a player for prediction.

A snapshot that an event gives you can be write protected. Changing it or running a command on
it then throws an error. Call `Clone` first and change the copy.

Reading an unknown field returns nil. Assigning an unknown field or a read-only field does nothing.

<ApiMembers>
  <ApiMember kind="prop" name="simulation.Player.controller" summary="The controller of the simulated pawn, or nil if it no longer exists. Read-only." ret="[[{&#x22;s&#x22;:&#x22;client.CCSPlayerController&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/CCSPlayerController&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.curtime" summary="The current simulation time, in seconds." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.frametime" summary="The length of one simulation tick, in seconds." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_MoveType" summary="The current movement type, for example walk, fly, ladder or noclip." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_angEyeAngles" summary="The final eye angles after the subtick and aim punch changes." ret="[[{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_angStashedShootAngles" summary="The saved shoot angles for the queued grenade throw." ret="[[{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_bCanMove" summary="The saved result of whether the player can move." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_bCarryingHostage" summary="True while the player carries a hostage." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_bFreezePeriod" summary="True while the round is in its freeze time." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_bGrenadeParametersStashed" summary="True if the throw parameters of a grenade are saved for a queued throw." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_bIsDefusing" summary="True while the player is defusing the bomb." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_bIsGrabbingHostage" summary="True while the player is picking up a hostage." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_bIsScoped" summary="True while the player is scoped in." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_bIsWalking" summary="True while the player holds the walk key." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_bResumeZoom" summary="True if the scope zooms in again after a shot." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_bWaitForNoAttack" summary="True if the player cannot fire until the attack button is released." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_fFlags" summary="The bit mask of entity flags, for example on ground, ducking or frozen." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_fImmuneToGunGameDamageTime" summary="The time at which the spawn protection in gun game ends." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_fRoundStartTime" summary="The time at which the current round started." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_flFlinchStack" summary="The flinch that has built up from recent damage." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_flFriction" summary="The friction multiplier of the surface for the player." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_flGravityScale" summary="The multiplier for the world gravity for this player." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_flPlayerMaxSpeed" summary="The maximum speed at which the player can move." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_flVelocityModifier" summary="The speed multiplier after the player takes damage." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_flWaterJumpTime" summary="The time that is left in the current water jump." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_flWaterLevel" summary="How deep the player is in water." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_grenadeParameterStashTime" summary="The time at which the throw parameters of the grenade were saved." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_hGroundEntity" summary="The entity the player stands on, or nil. Read-only." ret="[[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_iShotsFired" summary="The number of shots fired in a row. Recoil grows with it." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_iTeamNum" summary="The team number of the player." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_ignoreLadderJumpTime" summary="The time until the player can jump off a ladder again." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_nInteractsWith" summary="The collision mask of the contents that the player interacts with." ret="[[{&#x22;s&#x22;:&#x22;uint64_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#uint64_t&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_nRandomSeed" summary="The random seed for spread and recoil." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_nTickBase" summary="The tick base. The prediction time of the player is calculated from it." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_nWaterType" summary="The contents mask of the water the player is in." ret="[[{&#x22;s&#x22;:&#x22;uint64_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#uint64_t&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_nodeToWorld" summary="The transform from the scene node of the player to world space. Read-only." ret="[[{&#x22;s&#x22;:&#x22;CTransform&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/transform#ctransform&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_predictableBaseAngle" summary="The base angle of the predictable part of the aim punch." ret="[[{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_predictableBaseAngleVel" summary="The base angular velocity of the predictable part of the aim punch." ret="[[{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_predictableBaseTick" summary="The base tick of the predictable part of the aim punch." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_predictableBaseTickInterpAmount" summary="The interpolation fraction of the base tick of the predictable aim punch." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_unpredictableBaseAngle" summary="The base angle of the unpredictable part of the aim punch." ret="[[{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_unpredictableBaseTick" summary="The base tick of the unpredictable part of the aim punch." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_vecAbsOrigin" summary="The origin of the player in world space." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_vecAbsVelocity" summary="The velocity of the player in world space." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_vecBaseVelocity" summary="The velocity given by the surface the player stands on, for example a conveyor or a moving platform." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_vecRootBoneOffset" summary="The offset of the root bone of the skeleton from the origin." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_vecStashedGrenadeThrowPosition" summary="The saved throw position for the queued grenade throw." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_vecStashedVelocity" summary="The saved velocity of the player for the queued grenade throw." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_vecViewOffset" summary="The offset from the origin to the eye position." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.m_vecWaterJumpVel" summary="The velocity used during the current water jump." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.movement" summary="The movement part, which handles walking, jumping, ducking and collision. Read-only." ret="[[{&#x22;s&#x22;:&#x22;simulation.Movement&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulationmovement&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.mp_teammates_are_enemies" summary="True if teammates count as enemies for collision and damage." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.optimizations" summary="The mask of enabled `simulation.SimOpt` flags." ret="[[{&#x22;s&#x22;:&#x22;simulation.SimOpt&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulation-SimOpt&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.pawn" summary="The pawn this snapshot was taken from, or nil if it no longer exists. Read-only." ret="[[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.tick_frac" summary="The fraction of the current tick, from 0 to 1." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.tickcount" summary="The current tick of the simulation." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.v_angle" summary="The raw view angles from the command." ret="[[{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Player.weapon" summary="The weapon part, which handles firing, accuracy and grenades. Read-only." ret="[[{&#x22;s&#x22;:&#x22;simulation.Weapon&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulationweapon&#x22;}]]" />

  <ApiMember kind="method" name="simulation.Player:RunCommand" summary="Advances the simulation by one user command." args="cmd" sig="[{&#x22;s&#x22;:&#x22;simulation.Player:RunCommand&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;cmd&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;UserCmd&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmd&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;cmd&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;UserCmd&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#usercmd&#x22;}],&#x22;d&#x22;:&#x22;The command to simulate for this tick.&#x22;}]">
    <ApiNotes>
      Clone a simulation that an event gave you before you run commands on it. If the simulation is
      write protected, this function throws an error. The result is only a prediction and is not sent
      to the server.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="simulation.Player:Clone" summary="Returns a full copy of this simulation snapshot. The copy is not write protected." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Player:Clone&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;simulation.Player&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulationplayer&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;simulation.Player&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulationplayer&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="simulation.Player:IsFreezePeriod" summary="Returns true if the round is in its freeze time and the player cannot move yet." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Player:IsFreezePeriod&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="simulation.Player:SetAbsOrigin" summary="Moves the player to the given origin in world space. If the simulation is write protected, this function throws an error." args="origin" sig="[{&#x22;s&#x22;:&#x22;simulation.Player:SetAbsOrigin&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;origin&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" params="[{&#x22;n&#x22;:&#x22;origin&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}],&#x22;d&#x22;:&#x22;The new origin of the player.&#x22;}]" />

  <ApiMember kind="method" name="simulation.Player:IsThrowingGrenade" summary="Returns true if the player is throwing a grenade at this moment." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Player:IsThrowingGrenade&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="simulation.Player:IsJumpThrow" summary="Checks the timing window of a jump throw. The function adds the given throw delay to the current simulation time and subtracts the time at which the grenade parameters were saved. It returns true if the result is more than 0 and at most 0.2 seconds. The delay is not the time for which a button is held." args="throw_duration" sig="[{&#x22;s&#x22;:&#x22;simulation.Player:IsJumpThrow&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;throw_duration&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;throw_duration&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],&#x22;d&#x22;:&#x22;The planned throw delay, in seconds.&#x22;}]" nodiscard />

  <ApiMember kind="method" name="simulation.Player:GetEyePosition" summary="Returns the current eye position of the player in world space." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Player:GetEyePosition&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="simulation.Player:IsEnemy" summary="Returns true if `other` is an enemy of the simulated player. The `mp_teammates_are_enemies` setting is taken into account. Returns false if `other` is nil or the simulated player." args="other" sig="[{&#x22;s&#x22;:&#x22;simulation.Player:IsEnemy&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;other&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;other&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}],&#x22;d&#x22;:&#x22;The entity to check.&#x22;}]" nodiscard />

  <ApiMember kind="method" name="simulation.Player:IsTeamMate" summary="Returns true if `other` is a teammate of the simulated player. It always returns the opposite of `player:IsEnemy`, so it also returns true if `other` is nil or the simulated player." args="other" sig="[{&#x22;s&#x22;:&#x22;simulation.Player:IsTeamMate&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;other&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;other&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;}],&#x22;d&#x22;:&#x22;The entity to check.&#x22;}]" nodiscard />

  <ApiMember kind="method" name="simulation.Player:GetSimpleFilter" summary="Returns a trace filter that is set up in the same way as the filter of the movement code. The filter ignores the simulated player and uses the given collision group." args="collision_group?" sig="[{&#x22;s&#x22;:&#x22;simulation.Player:GetSimpleFilter&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;collision_group&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;trace.Filter&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/trace#tracefilter&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;trace.Filter&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/engine/trace#tracefilter&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;collision_group&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;The collision group of the trace. The default is `trace.StandardCollisionGroups_t.PLAYER_MOVEMENT`.&#x22;,&#x22;o&#x22;:true}]" nodiscard />

  <ApiMember kind="method" name="simulation.Player:GetShape" summary="Returns the current collision shape of the player. Its size depends on the current duck amount." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Player:GetShape&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;userdata&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#userdata&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;userdata&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#userdata&#x22;}]]" nodiscard>
    <ApiNotes>
      <Warning>
        The shape is an opaque `GenericShape_t` value for FFI code. It has no fields or methods in Lua.
      </Warning>
    </ApiNotes>
  </ApiMember>
</ApiMembers>

## simulation.Movement<ApiTag label="object type" />

The movement part of a simulated player. It handles walking, movement in the air, jumping,
ducking, ladders, and the console variables that control them.

Reading an unknown field returns nil. Assigning an unknown field does nothing. If the simulation
is write protected, assigning a field throws an error.

<ApiMembers>
  <ApiMember kind="prop" name="simulation.Movement.host_timescale" summary="The time scale of the simulation." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_bDesiresDuck" summary="True while the duck button is held." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_bDuckOverride" summary="True if ducking is forced, whatever the input is." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_bDucked" summary="True if the player is fully ducked." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_bDucking" summary="True while the player is ducking." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_bHasWalkMovedSinceLastJump" summary="True if the player has walked since the last jump." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_bJumpApexPending" summary="True while the player is still rising toward the highest point of a jump." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_bUseFrictionStashedSpeed" summary="True if the speed saved before friction is used again." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_bUsingGroundTopologyOffset" summary="True if a view offset for the shape of the ground is applied." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_fStashGrenadeParameterWhen" summary="The subtick time at which the grenade parameters should be saved." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_flAccumulatedJumpError" summary="The error in subtick jump timing that has built up." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_flBombPlantViewOffset" summary="The vertical view offset caused by planting the bomb." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_flDuckAmount" summary="The current duck progress. `0` means standing and `1` means fully ducked." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_flDuckRootOffset" summary="The vertical offset of the root bone caused by ducking." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_flDuckSpeed" summary="The speed at which the duck amount changes." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_flDuckViewOffset" summary="The vertical view offset caused by ducking." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_flFallVelocity" summary="The downward speed during the current fall." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_flFrictionStashedSpeed" summary="The speed saved before friction was applied." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_flLastDuckTime" summary="The time of the last change between ducking and standing." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_flLastJumpFrac" summary="The subtick fraction of the last jump." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_flLastJumpVelocityZ" summary="The vertical velocity at the moment of the last jump." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_flMaxspeed" summary="The current maximum movement speed." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_flStamina" summary="The current stamina. Low stamina limits repeated jumps." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_flSurfaceFriction" summary="The friction of the surface the player stands on." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_flUseFrictionStashedSpeedUntilFrac" summary="The subtick fraction until which the saved speed is used." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_flUsingGroundTopologyOffsetTransitionSmoothing" summary="The smoothing amount for changes of the ground shape offset." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_nLastJumpTick" summary="The tick at which the player last jumped." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_vecCmdMove" summary="The movement input of the previous command." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_vecLadderNormal" summary="The surface normal of the ladder the player is on." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_vecLastMovementImpulses" summary="The movement impulses applied in the previous tick." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_vecLastPositionAtFullCrouchSpeed" summary="The last position recorded while the player moved at full crouch speed." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.m_vecWalkWishVel" summary="The walking velocity that the input asks for." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.mp_solid_teammates" summary="The collision mode between teammates." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.mp_tagging_scale" summary="The multiplier for the slowdown when the player is hit by enemy fire." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_accelerate" summary="The acceleration rate on the ground." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_accelerate_use_weapon_speed" summary="True if the acceleration depends on the speed of the active weapon." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_air_max_wishspeed" summary="The maximum wish speed for acceleration in the air." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_airaccelerate" summary="The acceleration rate in the air." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_autobunnyhopping" summary="True if automatic bunny hopping is enabled." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_bhop_time_window" summary="The time window in which a queued jump can start a bunny hop." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_bounce" summary="How much speed is kept when bouncing off surfaces." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_enablebunnyhopping" summary="True if bunny hopping without a speed limit on jumps is allowed." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_falldamage_scale" summary="The multiplier for fall damage." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_friction" summary="The base friction on the ground." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_gravity" summary="The world gravity, in units per second squared." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_jump_impulse" summary="The upward velocity added by a jump." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_jump_precision_enable" summary="True if exact subtick jump timing is enabled." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_jump_spam_penalty_time" summary="The cooldown that punishes pressing jump too often." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_ladder_angle" summary="The view angle limit that affects getting onto a ladder." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_ladder_dampen" summary="How much movement is slowed down on ladders." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_ladder_scale_speed" summary="The speed multiplier for climbing ladders." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_legacy_jump" summary="True if the old jump behavior is used." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_maxspeed" summary="The global maximum speed of players." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_maxvelocity" summary="The maximum velocity along any single axis." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_noclipaccelerate" summary="The acceleration rate in noclip." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_noclipspeed" summary="The movement speed in noclip." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_optimizedmovement" summary="True if the optimized movement code is used." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_quantize_movement_input" summary="True if the movement input is rounded before it is applied." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_staminajumpcost" summary="The stamina that a jump costs." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_staminalandcost" summary="The stamina that a landing costs." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_staminamax" summary="The maximum stamina." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_staminarecoveryrate" summary="The rate at which stamina recovers." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_standable_normal" summary="The minimum Z value of a surface normal for a slope that the player can stand on." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_step_move_vel_min" summary="The minimum velocity needed to try a step move." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_stepsize" summary="The maximum height that the player can step up without a jump." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_stopspeed" summary="The speed below which stronger stopping friction is applied." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_subtick_movement_view_angles" summary="True if the subtick view angles are used for movement." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_timebetweenducks" summary="The minimum time between two duck inputs." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_walkable_normal" summary="The minimum Z value of a surface normal for a slope that the player can walk on." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Movement.sv_water_slow_amount" summary="How much the player is slowed down in water." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="method" name="simulation.Movement:CanMove" summary="Returns true if the player can move. The player cannot move while frozen, while defusing the bomb, or while arming the bomb." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Movement:CanMove&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="simulation.Movement:CanJump" summary="Returns true if the player can jump. The player must be on the ground, and the jump cooldown must be over." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Movement:CanJump&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="simulation.Movement:GetMaxSpeed" summary="Returns the current maximum movement speed. The `forwardmove` and `leftmove` input is multiplied by this speed to get the wish velocity." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Movement:GetMaxSpeed&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" nodiscard>
    <ApiNotes>
      The value uses the current state. It includes the walk speed limit, the duck speed limit,
      stamina, the slowdown from damage, the surface, the movement speed while attacking, and the
      slowdown after landing.

      To find the `forwardmove` or `leftmove` fraction for a given speed, divide that speed by this
      value, for example `cmd.forwardmove = target_speed / sim.movement:GetMaxSpeed()`.
    </ApiNotes>
  </ApiMember>
</ApiMembers>

## simulation.Weapon<ApiTag label="object type" />

The weapon part of a simulated player. It handles when the weapon can fire, accuracy and recoil,
reloading, and the throw parameters of grenades. Use a full simulation with
`simulation.SimOpt.kNone` to include the weapon behavior.

Reading an unknown field returns nil. Assigning an unknown field or a read-only field does
nothing. If the simulation is write protected, assigning a field throws an error.

<ApiMembers>
  <ApiMember kind="prop" name="simulation.Weapon.m_bBurstMode" summary="True if the weapon is in burst fire mode." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_bFireOnEmpty" summary="True if the weapon tried to fire with an empty clip." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_bInReload" summary="True while the weapon is reloading." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_bIsHauledBack" summary="True while the hammer of the revolver is pulled back." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_bIsHeldByPlayer" summary="True while the player holds the grenade." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_bJumpThrow" summary="True if the grenade is queued for a jump throw." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_bJustPulledPin" summary="True if the pin of the grenade was pulled in this tick." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_bPinPulled" summary="True if the pin of the grenade is pulled." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_bRedraw" summary="True while the weapon is drawn again after a throw." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_bStartedArming" summary="True if the player has started to arm the bomb." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_fAccuracyPenalty" summary="The inaccuracy penalty that has built up from recent actions." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_fLastShotTime" summary="The time of the last shot." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_fThrowTime" summary="The time at which the grenade is thrown." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_flNextAttack" summary="The earliest time at which the player can attack again." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_flNextHoldFrac" summary="The subtick fraction at which the next grenade hold action is ready." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_flNextPrimaryAttackTickRatio" summary="The subtick fraction at which the next primary attack is ready." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_flNextSecondaryAttackTickRatio" summary="The subtick fraction at which the next secondary attack is ready." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_flPostponeFireReadyFrac" summary="The subtick fraction at which the delayed shot is ready." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_flRecoilIndex" summary="The current recoil index. It goes up with each shot." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_flThrowStrength" summary="The throw strength of the held grenade, from 0 to 1." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_flWatTickOffset" summary="The tick offset of the weapon attack time. It is used to interpolate the shoot position." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_hActiveWeapon" summary="The weapon the player is holding. Read-only." ret="[[{&#x22;s&#x22;:&#x22;client.C_CSWeaponBase&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSWeaponBase&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_iClip1" summary="The ammo in the primary clip." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_iClip2" summary="The ammo in the secondary clip." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_iItemDefinitionIndex" summary="The item definition index, which identifies the weapon type." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_nNextHoldTick" summary="The tick at which the next grenade hold action is ready." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_nNextPrimaryAttackTick" summary="The tick at which the next primary attack is ready." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_nNextSecondaryAttackTick" summary="The tick at which the next secondary attack is ready." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_nOldTotalInputHistoryCount" summary="The previous total number of recorded input history entries." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_nOldTotalShootPositionHistoryCount" summary="The previous total number of recorded shoot positions." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_nPostponeFireReadyTicks" summary="The tick at which a delayed shot, for example of the revolver, is ready." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_weaponMode" summary="The current fire mode of the weapon." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Weapon.m_zoomLevel" summary="The current zoom level of the scope. `0` means not zoomed." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="method" name="simulation.Weapon:GetMaxSpeed" summary="Returns the maximum movement speed while the player holds this weapon in its current mode." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Weapon:GetMaxSpeed&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="simulation.Weapon:GetInaccuracy" summary="Returns the current inaccuracy of the weapon. It includes movement, jumping and the built up accuracy penalty." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Weapon:GetInaccuracy&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="simulation.Weapon:GetSpread" summary="Returns the base spread of the weapon in its current mode." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Weapon:GetSpread&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="simulation.Weapon:IsPrimaryAttackReady" summary="Returns true if the primary attack of the weapon is ready at the current simulation time." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Weapon:IsPrimaryAttackReady&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="simulation.Weapon:IsSecondaryAttackReady" summary="Returns true if the secondary attack of the weapon is ready at the current simulation time." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Weapon:IsSecondaryAttackReady&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="simulation.Weapon:IsPostponeFireReady" summary="Returns true if the delayed shot of the revolver is ready at the current simulation time." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Weapon:IsPostponeFireReady&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="simulation.Weapon:GetThrowStrength" summary="Returns the throw strength of the held grenade, from 0 to 1." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Weapon:GetThrowStrength&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="simulation.Weapon:GetPlayerShootPosition" summary="Returns the position in world space from which shots are fired at the given tick and fraction. The position is interpolated from the recorded shoot position history." args="tick" sig="[{&#x22;s&#x22;:&#x22;simulation.Weapon:GetPlayerShootPosition&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;tick&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#tickandinterpolationamount_t&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;tick&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;TickAndInterpolationAmount_t&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#tickandinterpolationamount_t&#x22;}],&#x22;d&#x22;:&#x22;The tick and fraction to sample. Take it from a history entry or create it with `TickAndInterpolationAmount_t(tick, fraction)`.&#x22;}]" nodiscard>
    <ApiNotes>
      For the shot of the current input poll, read the `shoot_position` field of the input poll
      context instead.
    </ApiNotes>
  </ApiMember>

  <ApiMember kind="method" name="simulation.Weapon:UpdateAccuracyPenalty" summary="Advances the accuracy penalty of the player. If the simulation is write protected, this function throws an error." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Weapon:UpdateAccuracyPenalty&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;}]" />

  <ApiMember kind="method" name="simulation.Weapon:IsGun" summary="Returns true if the active weapon is a gun. Guns are pistols, rifles, submachine guns, shotguns, sniper rifles, machine guns and the taser." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Weapon:IsGun&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="simulation.Weapon:IsKnife" summary="Returns true if the active weapon is a knife." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Weapon:IsKnife&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="simulation.Weapon:HasZoom" summary="Returns true if the active weapon has a scope with zoom levels." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Weapon:HasZoom&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="simulation.Weapon:HasSecondaryAttack" summary="Returns true if the active weapon has a secondary attack. This is true for weapons with zoom, burst mode, a removable silencer or secondary ammo, and for the revolver." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Weapon:HasSecondaryAttack&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" nodiscard />

  <ApiMember kind="method" name="simulation.Weapon:CanAttack" summary="Returns true if the weapon can attack in the given mode at the current simulation time." args="mode" sig="[{&#x22;s&#x22;:&#x22;simulation.Weapon:CanAttack&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;mode&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;mode&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}],&#x22;d&#x22;:&#x22;The attack mode to check. `0` is the primary attack and `1` is the secondary attack.&#x22;}]" nodiscard />
</ApiMembers>

## simulation.GrenadePoint<ApiTag label="object type" />

One point of a simulated grenade path.

<ApiMembers>
  <ApiMember kind="prop" name="simulation.GrenadePoint.bounced" summary="True if the grenade bounced at this point." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.GrenadePoint.position" summary="The position in world space." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.GrenadePoint.tick" summary="The simulation tick of this point." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.GrenadePoint.time" summary="The time since the start of the simulation, in seconds." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.GrenadePoint.velocity" summary="The velocity at this point." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />
</ApiMembers>

## simulation.GrenadeDamage<ApiTag label="object type" />

The predicted damage of an HE grenade to one player.

<ApiMembers>
  <ApiMember kind="prop" name="simulation.GrenadeDamage.is_enemy" summary="True if the player is an enemy of the thrower." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.GrenadeDamage.max_damage" summary="The highest predicted damage." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.GrenadeDamage.min_damage" summary="The lowest predicted damage." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.GrenadeDamage.passed" summary="True if the lowest damage reaches the health of the player or the quarter range limit of the game. It does not always mean that the grenade kills the player." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.GrenadeDamage.player" summary="The damaged player." ret="[[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;}]]" />
</ApiMembers>

## simulation.Grenade<ApiTag label="object type" />

A grenade simulation that runs separately from the real game state. Each `Run` traces up to
1000 ticks, so do not run it more often than the result can change. All fields are read-only.

<ApiMembers>
  <ApiMember kind="prop" name="simulation.Grenade.definition_index" summary="The item definition index of the simulated grenade." ret="[[{&#x22;s&#x22;:&#x22;integer&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#integer&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Grenade.detonated" summary="True if the last `Run` reached a detonation." ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Grenade.detonation_time" summary="The detonation time in seconds, or nil if the grenade did not detonate." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Grenade.entity" summary="The grenade entity, or nil if there is none or it no longer exists." ret="[[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Grenade.exploded_from_inferno" summary="The fire that set off this smoke grenade, or nil." ret="[[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Grenade.extinguished_by_smoke" summary="The smoke that put out this grenade, or nil." ret="[[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Grenade.ground_entity" summary="The entity that the grenade came to rest on, or nil." ret="[[{&#x22;s&#x22;:&#x22;client.C_BaseEntity&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_BaseEntity&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Grenade.hit_enemy" summary="The player that the grenade hit, or nil." ret="[[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Grenade.initial_position" summary="The start position." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Grenade.initial_velocity" summary="The start velocity." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Grenade.molotov_burn_position" summary="The position at which a molotov starts to burn, or nil." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Grenade.molotov_splash_normal" summary="The surface normal at which the molotov splashed, or nil." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Grenade.origin" summary="The current simulated origin. After `Run`, this is the final origin." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Grenade.simulated_time" summary="The time simulated so far, in seconds." ret="[[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Grenade.thrower" summary="The thrower, or nil if there is none or it no longer exists." ret="[[{&#x22;s&#x22;:&#x22;client.C_CSPlayerPawn&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/dumped_data/schema/client/C_CSPlayerPawn&#x22;},{&#x22;s&#x22;:&#x22;?&#x22;}]]" />

  <ApiMember kind="prop" name="simulation.Grenade.velocity" summary="The current simulated velocity." ret="[[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}]]" />

  <ApiMember kind="method" name="simulation.Grenade:SetInitial" summary="Sets the start position and the start velocity directly. If a value is not a finite vector, the function throws an error." args="position, velocity" sig="[{&#x22;s&#x22;:&#x22;simulation.Grenade:SetInitial&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;position&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;velocity&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;position&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}],&#x22;d&#x22;:&#x22;The start position.&#x22;},{&#x22;n&#x22;:&#x22;velocity&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}],&#x22;d&#x22;:&#x22;The start velocity.&#x22;}]" returns="[{&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;`false` for projectiles, or if the grenade entity no longer exists.&#x22;}]" />

  <ApiMember kind="method" name="simulation.Grenade:SetThrow" summary="Sets the start state from a throw, with the same calculation as the game. If a value is not finite, the function throws an error." args="eye_position, angles, velocity, strength, pawn_center?" sig="[{&#x22;s&#x22;:&#x22;simulation.Grenade:SetThrow&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;eye_position&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;angles&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;velocity&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;, &#x22;},{&#x22;s&#x22;:&#x22;strength&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;[, &#x22;},{&#x22;s&#x22;:&#x22;pawn_center&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;eye_position&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}],&#x22;d&#x22;:&#x22;The eye position of the thrower.&#x22;},{&#x22;n&#x22;:&#x22;angles&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;QAngle&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/angle#qangle&#x22;}],&#x22;d&#x22;:&#x22;The throw angles.&#x22;},{&#x22;n&#x22;:&#x22;velocity&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}],&#x22;d&#x22;:&#x22;The velocity of the thrower.&#x22;},{&#x22;n&#x22;:&#x22;strength&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],&#x22;d&#x22;:&#x22;The throw strength, from 0 to 1.&#x22;},{&#x22;n&#x22;:&#x22;pawn_center&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}],&#x22;d&#x22;:&#x22;The center of the thrower in world space. If the simulation has no thrower, this value is required and leaving it out throws an error.&#x22;,&#x22;o&#x22;:true}]" returns="[{&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;`false` if the throw could not be applied, for example for projectiles.&#x22;}]" />

  <ApiMember kind="method" name="simulation.Grenade:Run" summary="Runs the simulation. You can call it again to simulate again." args="" sig="[{&#x22;s&#x22;:&#x22;simulation.Grenade:Run&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}]]" returns="[{&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;boolean&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#boolean&#x22;}],&#x22;d&#x22;:&#x22;`false` if the grenade entity no longer exists, or if a grenade that is not a projectile has no start state from `SetInitial` or `SetThrow` yet.&#x22;}]" />

  <ApiMember kind="method" name="simulation.Grenade:GetPath" summary="Returns the simulated path." args="time_offset?" sig="[{&#x22;s&#x22;:&#x22;simulation.Grenade:GetPath&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;time_offset&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;simulation.GrenadePoint&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulationgrenadepoint&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;simulation.GrenadePoint&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulationgrenadepoint&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;time_offset&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],&#x22;d&#x22;:&#x22;Points earlier than this many seconds are left out. The default is `0`.&#x22;,&#x22;o&#x22;:true}]" nodiscard />

  <ApiMember kind="method" name="simulation.Grenade:GetBounces" summary="Returns only the points of the simulated path at which the grenade bounced." args="time_offset?" sig="[{&#x22;s&#x22;:&#x22;simulation.Grenade:GetBounces&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;time_offset&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;simulation.GrenadePoint&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulationgrenadepoint&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;simulation.GrenadePoint&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulationgrenadepoint&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;time_offset&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;number&#x22;,&#x22;k&#x22;:&#x22;prim&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/lua/base#number&#x22;}],&#x22;d&#x22;:&#x22;Points earlier than this many seconds are left out. The default is `0`.&#x22;,&#x22;o&#x22;:true}]" nodiscard />

  <ApiMember kind="method" name="simulation.Grenade:GetDamage" summary="Returns the predicted damage of an HE grenade. For other grenades, it returns an empty table." args="origin?" sig="[{&#x22;s&#x22;:&#x22;simulation.Grenade:GetDamage&#x22;},{&#x22;s&#x22;:&#x22;(&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;origin&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;},{&#x22;s&#x22;:&#x22;)&#x22;},{&#x22;s&#x22;:&#x22;: &#x22;},{&#x22;s&#x22;:&#x22;simulation.GrenadeDamage&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulationgrenadedamage&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]" ret="[[{&#x22;s&#x22;:&#x22;simulation.GrenadeDamage&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/input/cmd#simulationgrenadedamage&#x22;},{&#x22;s&#x22;:&#x22;[&#x22;},{&#x22;s&#x22;:&#x22;]&#x22;}]]" params="[{&#x22;n&#x22;:&#x22;origin&#x22;,&#x22;t&#x22;:[{&#x22;s&#x22;:&#x22;Vector&#x22;,&#x22;k&#x22;:&#x22;class&#x22;,&#x22;h&#x22;:&#x22;/cs2/api_reference/mathlib/vector#vector-1&#x22;}],&#x22;d&#x22;:&#x22;The point of the explosion. The default is the simulated detonation point.&#x22;,&#x22;o&#x22;:true}]" nodiscard>
    <ApiNotes>
      If `origin` is given, the damage is calculated at that point and `Run` is not needed. This way
      you can use the end point of a recorded path directly. If `origin` is not given, the damage is
      calculated at the point where the last `Run` detonated. If the grenade did not detonate, the
      table is empty.

      Players are checked at their positions at the time of the call, not at the time of the
      detonation. Dormant, dead and immune players are left out.
    </ApiNotes>
  </ApiMember>
</ApiMembers>
