By using this character (#), you will able to access to admins private chat
Example: #Hello > (Admin Chat) Mario: Hello
PHP Code:
#pragma semicolon 1
#pragma newdecls required
#include <sourcemod>
public Action OnClientSayCommand(int client, const char[] command, const char[] message)
{
int startidx;
if (message[startidx] != '#') return Plugin_Continue;
startidx++;
if (strcmp(command, "say_team", false) == 0 || strcmp(command, "say", false) == 0)
{
if (message[startidx] != '#')
{
if (!CheckCommandAccess(client, "sm_say", ADMFLAG_CHAT)) return Plugin_Continue;
PrintToAdmins(client, message[startidx]);
return Plugin_Stop;
}
return Plugin_Stop;
}
return Plugin_Continue;
}
void PrintToAdmins(int client, const char[] sMessage)
{
for(int i = 1; i <= MaxClients; i++)
{
if (!IsClientInGame(i) || IsFakeClient(i) || !CheckCommandAccess(i, "sm_say", ADMFLAG_CHAT)) continue;
PrintToChat(i, "(Admin Chat) %N: %s", client, sMessage);
}
}
__________________