You need something like this:
PHP Code:
#pragma semicolon 1
#pragma newdecls required
#define START "\x01\x0B\x04"
#define WHITE "\x01"
#define YELLOW "\x09"
#define GREY "\x08"
#define RED "\x02"
#define PINK "\x03"
#define BLUE "\x0B"
#define LBLUE "\x0A"
#define GREEN "\x04"
bool bIsAdmin[MAXPLAYERS + 1];
bool bLateLoad;
public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max) {
bLateLoad = late;
return APLRes_Success;
}
public void OnPluginStart() {
RegAdminCmd("sm_adminchat", Command_adminchat, ADMFLAG_GENERIC);
if (bLateLoad) {
LookupClients();
bLateLoad = false;
}
}
void LookupClients() {
for (int i = 1; i <= MaxClients; i++) {
if (IsClientInGame(i)) OnClientPostAdminCheck(i);
}
}
public void OnClientPostAdminCheck(int client) {
if (1 <= client <= MaxClients && !IsFakeClient(client)) bIsAdmin[client] = CheckCommandAccess(client, "sm_admin", ADMFLAG_GENERIC);
}
public Action Command_adminchat(int client, int args) {
if (args <= 0) {
ReplyToCommand(client, "[SM] Usage: sm_adminchat <message>");
return Plugin_Handled;
}
char cArg[PLATFORM_MAX_PATH];
GetCmdArgString(cArg, sizeof(cArg));
for (int i = 1; i <= MaxClients; i++) {
if(!IsClientInGame(i) || !bIsAdmin[i]) continue;
PrintToChat(i, "%s[%sADMIN%s] %s%N%s: %s", START, RED, GREEN, BLUE, client, WHITE, cArg); //[ADMIN] Kar: sup dawgs
}
return Plugin_Handled;
}
__________________