1.1 --- a/plugins/basechat.sp Tue Nov 20 17:16:50 2007 +0000
1.2 +++ b/plugins/basechat.sp Wed Nov 21 01:21:32 2007 +0000
1.3 @@ -50,7 +50,6 @@
1.4 new g_Colors[13][3] = {{255,255,255},{255,0,0},{0,255,0},{0,0,255},{255,255,0},{255,0,255},{0,255,255},{255,128,0},{255,0,128},{128,255,0},{0,255,128},{128,0,255},{0,128,255}};
1.5
1.6 new Handle:g_Cvar_Chatmode = INVALID_HANDLE;
1.7 -new Handle:g_Cvar_Psaymode = INVALID_HANDLE;
1.8
1.9 new bool:g_DoColor = true;
1.10
1.11 @@ -59,7 +58,6 @@
1.12 LoadTranslations("common.phrases");
1.13
1.14 g_Cvar_Chatmode = CreateConVar("sm_chat_mode", "1", "Allows player's to send messages to admin chat.", 0, true, 0.0, true, 1.0);
1.15 - g_Cvar_Psaymode = CreateConVar("sm_psay_mode", "0", "Allows player's to use psay 'say @@' alias.", 0, true, 0.0, true, 1.0);
1.16
1.17 RegConsoleCmd("say", Command_SayChat);
1.18 RegConsoleCmd("say_team", Command_SayAdmin);
1.19 @@ -114,17 +112,17 @@
1.20 decl String:name[64];
1.21 GetClientName(client, name, sizeof(name));
1.22
1.23 - if (msgStart == 1 && CheckAdminForChat(client)) // sm_say alias
1.24 + if (msgStart == 1 && CheckCommandAccess(client, "sm_say", ADMFLAG_CHAT)) // sm_say alias
1.25 {
1.26 SendChatToAll(name, message);
1.27 LogAction(client, -1, "%L triggered sm_say (text %s)", client, message);
1.28 }
1.29 - else if (msgStart == 3 && CheckAdminForChat(client)) // sm_csay alias
1.30 + else if (msgStart == 3 && CheckCommandAccess(client, "sm_csay", ADMFLAG_CHAT)) // sm_csay alias
1.31 {
1.32 PrintCenterTextAll("%s: %s", name, message);
1.33 LogAction(client, -1, "%L triggered sm_csay (text %s)", client, text);
1.34 }
1.35 - else if (msgStart == 2 && (CheckAdminForChat(client) || GetConVarBool(g_Cvar_Psaymode))) // sm_psay alias
1.36 + else if (msgStart == 2 && CheckCommandAccess(client, "sm_psay", ADMFLAG_CHAT)) // sm_psay alias
1.37 {
1.38 decl String:arg[64];
1.39
1.40 @@ -158,7 +156,7 @@
1.41
1.42 public Action:Command_SayAdmin(client, args)
1.43 {
1.44 - if (!CheckAdminForChat(client) && !GetConVarBool(g_Cvar_Chatmode))
1.45 + if (!CheckCommandAccess(client, "sm_chat", ADMFLAG_CHAT) && !GetConVarBool(g_Cvar_Chatmode))
1.46 {
1.47 return Plugin_Continue;
1.48 }
1.49 @@ -359,16 +357,6 @@
1.50 return Plugin_Handled;
1.51 }
1.52
1.53 -bool:CheckAdminForChat(client)
1.54 -{
1.55 - if (client == 0)
1.56 - {
1.57 - return true;
1.58 - }
1.59 -
1.60 - return CheckCommandAccess(client, "sm_chat", ADMFLAG_CHAT);
1.61 -}
1.62 -
1.63 FindColor(String:color[])
1.64 {
1.65 for (new i = 0; i < 13; i++)
1.66 @@ -400,7 +388,7 @@
1.67 {
1.68 if (IsClientInGame(i))
1.69 {
1.70 - if (CheckAdminForChat(i))
1.71 + if (CheckCommandAccess(i, "sm_chat", ADMFLAG_CHAT))
1.72 {
1.73 if (g_DoColor)
1.74 {