GetCmdArg Function

Retrieves a command argument given its index, from the current console or server command.

int GetCmdArg(int argnum, char[] buffer, int maxlength)


int argnum

Argument number to retrieve.

char[] buffer

Buffer to use for storing the string.

int maxlength

Maximum length of the buffer.

Return Value

Length of string written to buffer.


Argument indexes start at 1; 0 retrieves the command name.