-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin-chat.sp
More file actions
47 lines (39 loc) · 999 Bytes
/
admin-chat.sp
File metadata and controls
47 lines (39 loc) · 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <sourcemod>
#include <cstrike>
#pragma semicolon 1
public Plugin:myinfo =
{
name = "AdminChatColor",
author = "k725",
description = "Admin chat color.",
version = "1.0",
url = ""
}
public OnPluginStart()
{
RegConsoleCmd("say", Say_Hook);
}
public Action:Say_Hook(client, args)
{
decl String:sText[192];
decl String:sDead[8];
GetCmdArgString(sText, sizeof(sText));
StripQuotes(sText);
new Team = GetClientTeam(client);
if(GetUserAdmin(client) != INVALID_ADMIN_ID)
{
if(strlen(sText) > 0 && client > 0 && client <= MaxClients && IsClientInGame(client))
{
sDead = IsPlayerAlive(client) ? "" : "*DEAD* ";
if(Team == CS_TEAM_T)
PrintToChatAll("[iesaba] %s\x09%N: \x05%s", sDead, client, sText);
else if (Team == CS_TEAM_CT)
PrintToChatAll("[iesaba] %s\x0d%N: \x05%s", sDead, client, sText);
else
PrintToChatAll("[iesaba] \x0e%N: \x05%s", client, sText);
}
}
else
return Plugin_Continue;
return Plugin_Handled;
}