From af12ff000b15facabe2a779d05c9593020be0bec Mon Sep 17 00:00:00 2001 From: Michael McKoy Date: Tue, 2 Oct 2007 00:20:18 +0000 Subject: [PATCH] @ symbol moved to a #define. say_team now checks if in a chat trigger. --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401522 --- plugins/basechat.sp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/basechat.sp b/plugins/basechat.sp index faf91f06..d6b528cf 100644 --- a/plugins/basechat.sp +++ b/plugins/basechat.sp @@ -44,6 +44,8 @@ public Plugin:myinfo = url = "http://www.sourcemod.net/" }; +#define CHAT_SYMBOL '@' + new String:g_ColorNames[13][10] = {"White", "Red", "Green", "Blue", "Yellow", "Purple", "Cyan", "Orange", "Pink", "Olive", "Lime", "Violet", "Lightblue"}; 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}}; @@ -93,16 +95,16 @@ public Action:Command_SayChat(client, args) startidx = 1; } - if (text[startidx] != '@') + if (text[startidx] != CHAT_SYMBOL) return Plugin_Continue; new msgStart = 1; - if (text[startidx+1] == '@') + if (text[startidx+1] == CHAT_SYMBOL) { msgStart = 2; - if (text[startidx+2] == '@') + if (text[startidx+2] == CHAT_SYMBOL) msgStart = 3; } @@ -162,7 +164,7 @@ public Action:Command_SayAdmin(client, args) } decl String:text[192]; - if (GetCmdArgString(text, sizeof(text)) < 1) + if (IsChatTrigger() || GetCmdArgString(text, sizeof(text)) < 1) { return Plugin_Continue; } @@ -174,7 +176,7 @@ public Action:Command_SayAdmin(client, args) startidx = 1; } - if (text[startidx] != '@') + if (text[startidx] != CHAT_SYMBOL) return Plugin_Continue; decl String:message[192];