sm-plugins/SMJSONAPI/scripting/API.inc

50 lines
885 B
PHP
Raw Normal View History

2018-08-07 22:22:27 +02:00
public void API_PrintToChatAll(const char[] format, any ...)
{
char buffer[254];
for (int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i))
{
SetGlobalTransTarget(i);
VFormat(buffer, sizeof(buffer), format, 2);
PrintToChat(i, "%s", buffer);
}
}
}
public void API_PrintCenterTextAll(const char[] format, any ...)
{
char buffer[254];
for (int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i))
{
SetGlobalTransTarget(i);
VFormat(buffer, sizeof(buffer), format, 2);
PrintCenterText(i, "%s", buffer);
}
}
}
public void API_PrintHintTextToAll(const char[] format, any ...)
{
char buffer[254];
for (int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i))
{
SetGlobalTransTarget(i);
VFormat(buffer, sizeof(buffer), format, 2);
PrintHintText(i, "%s", buffer);
}
}
}
public int API_GetMaxClients()
{
return MaxClients;
}