Hi! What I'm trying to do is create a PrintCenterTextAll type function that omits a given client, and for the sake of getting to the point, here is that function:
Code:
PrintCenterTextOmit(omitClient, const String:format[], any:...)
{
new String:formattedString[strlen(format) + 255];
VFormat(formattedString, sizeof(formattedString), format, 3);
for (new i = 0; i < MaxClients; i++)
{
if (IsValidClient(i) && i != omitClient)
{
PrintCenterText(i, formattedString);
//PrintCenterText(i, "Blablabla");
}
}
}
By setting omitClient to -1, this function should behave just like PrintCenterTextAll. And it works just like it's supposed to, as you can see in the commented out line I tested it to make sure it filters the client properly.
However the issue seems to be with formatting the string using the any:... parameter. I do get a warning with VFormat: warning 224: indeterminate array size in "sizeof" expression (symbol "")
Basically, when I use: PrintCenterText(i, formattedString);
it prints nothing.
If I use formattedString[512], it works just fine. So the issue is in using strlen and as the warning specifies, the length seems to be indeterminable. However, I followed the guide here on the wiki:
https://wiki.alliedmods.net/Format_C...n_Format-Class
So why doesn't it work?