GetSVarType

Description

Gets the type (integer, float or string) of a server variable.

NameDescription
varnameThe name of the server variable to get the type of.

Returns

Returns the type of the SVar. See table below.

Examples

stock PrintSVar(varname[])
{
switch(GetSVarType(varname))
{
case SERVER_VARTYPE_NONE:
{
return 0;
}
case SERVER_VARTYPE_INT:
{
printf("Integer SVar '%s': %i", varname, GetSVarInt(varname));
}
case SERVER_VARTYPE_FLOAT:
{
printf("Float SVar '%s': %f", varname, GetSVarFloat(varname));
}
case SERVER_VARTYPE_STRING:
{
new varstring[256];
GetSVarString(varname, varstring);
printf("String SVar '%s': %s", varname, varstring);
}
}
return 1;
}

Related Functions