Skip to Content

user_cmd_t

Read-only snapshot of the user command passed to the createmove callback.


Read-only copy of the command passed to createmove. It may be retained after the callback. Assigning any field raises; modifying returned copies does not change the real command.

MemberTypeDescription
cmd.command_numberintegerCommand number.
cmd.tickintegerClient tick.
cmd.buttonsuint64_tHeld buttons; new cdata on every read.
cmd.buttons_changeduint64_tButtons whose state changed.
cmd.buttons_scrolluint64_tScroll bits.
cmd.forwardmove, cmd.upmovenumberMovement values.
cmd.sidemovenumberPositive means left: the engine's leftmove.
cmd.view_anglesangleCopy; (0, 0, 0) if absent.
cmd.weaponselectintegerWeapon selection.
cmd:has_button(mask)

Returns true if any masked bit is set in buttons. A press and release within a single command reads as false.

No button constants are defined. Build masks with bit.lshift(1ULL, n); attack is 1ULL and jump is 2ULL.

BitButton
0Attack
1Jump
2Duck
3Forward
4Back
5Use
7Turn left
8Turn right
9Move left
10Move right
11Attack2
13Reload
16Speed / walk
32Use or reload
33Score
34Zoom
35Look at weapon