I want to allow users to set HudText colors with a single Convar. I have the convar set to:
sm_warmup_text_color "21 238 211"
but it isn't working properly. my PrintToChat debug returns:
21
238
38
Theres obviously a problem reading that string, but I can't figure out where it's going wrong.
PHP Code:
GetHudTextColors()
{
new len, i;
decl String:Colors[16], String:Temp[16];
GetConVarString(g_Handle[WarmupTextColor], Colors, 16);
for (i = 0; i <= 2; i++)
{
len = BreakString(Colors[len], Temp, 16);
g_iTextColor[i] = StringToInt(Temp);
if (g_iTextColor[i] < 0 || g_iTextColor[i] > 255)
g_iTextColor[i] = 0;
PrintToChatAll("%d", g_iTextColor[i]);
}
}