OnPlayerRunCmd Forward

Called when a clients movement buttons are being processed

Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2])


int client

Index of the client.

int& buttons

Copyback buffer containing the current commands (as bitflags - see entity_prop_stocks.inc).

int& impulse

Copyback buffer containing the current impulse command.

float[3] vel

Players desired velocity.

float[3] angles

Players desired view angles.

int& weapon

Entity index of the new weapon if player switches weapon, 0 otherwise.

int& subtype

Weapon subtype when selected from a menu.

int& cmdnum

Command number. Increments from the first command sent.

int& tickcount

Tick count. A client's prediction based on the server's GetGameTickCount value.

int& seed

Random seed. Used to determine weapon recoil, spread, and other predicted elements.

int[2] mouse

Mouse direction (x, y).

Return Value

Plugin_Handled to block the commands from being processed, Plugin_Continue otherwise.


To see if all 11 params are available, use FeatureType_Capability and FEATURECAP_PLAYERRUNCMD_11PARAMS.