sm-plugins/SMJSONAPI/scripting/API.inc

71 lines
1.2 KiB
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);
}
}
}
2024-06-26 11:29:27 +02:00
public void API_PrintToChat(int client, const char[] format, any ...)
{
char buffer[254];
if (IsClientInGame(client))
{
SetGlobalTransTarget(client);
VFormat(buffer, sizeof(buffer), format, 3);
PrintToChat(client, "%s", buffer);
}
}
2018-08-07 22:22:27 +02:00
public int API_GetMaxClients()
{
return MaxClients;
}
public int API_GetUserFlagBits(int client)
{
2024-06-26 11:29:27 +02:00
if (!IsClientConnected(client))
return 0;
2024-06-26 11:29:27 +02:00
return GetUserFlagBits(client);
}
2024-06-26 11:29:27 +02:00