PHP Code:
stock CenterString(String:sBuffer[], outlen, const String:sInput[], inlen = -1)
{
static const String:sTokenHack[] = "%%%us%%s%%%us";
decl String:sTempBuff[24];
if (inlen == -1)
{
inlen = strlen(sInput);
}
inlen = (outlen >> 1) - (inlen >> 1);
FormatEx(sTempBuff, sizeof(sTempBuff), sTokenHack, inlen, inlen);
return Format(sBuffer, outlen, sTempBuff, "", sInput, "");
}
atcprintf doesn't appear to support %*s, so we have that horrible static const at the top (and double format). Anyways, hopefully this helps someone