GetConsoleVarAsString
From SA-MP Wiki
Description:
Get the string value of a console variable.
(const varname[], buffer[], len)
const varname[] | The name of the string variable to get the value of. |
buffer[] | An array into which to store the value, passed by reference. |
len | The length of the string that should be stored. |
Return Values:
The length of the returned string. 0 if the specified console variable is not a string or doesn't exist.
Tip | Type 'varlist' in the server console to display a list of available console variables and their types. |
Note | When filterscripts or plugins are specified as the varname, this function only returns the name of the first specified filterscript or plugin. |
Example Usage:
public OnGameModeInit() { new hostname[64]; GetConsoleVarAsString("hostname", hostname, sizeof(hostname)); printf("Hostname: %s", hostname); }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- GetConsoleVarAsInt: Retreive a server variable as an integer.
- GetConsoleVarAsBool: Retreive a server variable as a boolean.