VFormat Function

Formats a string according to the SourceMod format rules (see documentation).

int VFormat(char[] buffer, int maxlength, const char[] format, int varpos)


char[] buffer

Destination string buffer.

int maxlength

Maximum length of output string buffer.

const char[] format

Formatting rules.

int varpos

Argument number which contains the '...' symbol. Note: Arguments start at 1.

Return Value

Number of bytes written.


Invalid argument index.


This is the same as Format(), except it grabs parameters from a parent parameter stack, rather than a local. This is useful for implementing your own variable argument functions.