My version (using it in my plugins).
Code:
#include <amxmodx>
new g_iSayText, g_iMaxPlayers;
public plugin_cfg()
{
g_iSayText = get_user_msgid("SayText");
g_iMaxPlayers = get_maxplayers();
}
stock print(iCl, const szMsg[], {Float, Sql, Result,_}:...)
{
static szBuffer[192];
szBuffer[0] = 0x01;
vformat(szBuffer[1], 190, szPrefix, 3);
if (iCl && iCl <= g_iMaxPlayers)
{
message_begin(MSG_ONE, g_iSayText, {0, 0, 0}, iCl);
write_byte(iCl);
write_string(szBuffer);
message_end();
}
else if (!iCl)
{
for (iCl = 1; iCl <= g_iMaxPlayers; iCl++)
{
if (!is_user_connected(iCl))
continue;
message_begin(MSG_ONE, g_iSayText, {0, 0, 0}, iCl);
write_byte(iCl);
write_string(szBuffer);
message_end();
}
}
return 1;
}
__________________