the "No Access" phrase now replies correctly from chat triggers

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40901
This commit is contained in:
David Anderson 2007-06-06 22:26:40 +00:00
parent c094ea1b22
commit 1eb1072687
4 changed files with 16 additions and 9 deletions

View File

@ -18,6 +18,8 @@
#include "sm_stringutil.h" #include "sm_stringutil.h"
#include "PlayerManager.h" #include "PlayerManager.h"
#include "Translator.h" #include "Translator.h"
#include "HalfLife2.h"
#include "ChatTriggers.h"
ConCmdManager g_ConCmds; ConCmdManager g_ConCmds;
@ -448,10 +450,17 @@ bool ConCmdManager::CheckAccess(int client, const char *cmd, AdminCmdInfo *pAdmi
snprintf(buffer, sizeof(buffer), "You do not have access to this command"); snprintf(buffer, sizeof(buffer), "You do not have access to this command");
} }
unsigned int replyto = g_ChatTriggers.GetReplyTo();
if (replyto == SM_REPLY_CONSOLE)
{
char fullbuffer[192]; char fullbuffer[192];
snprintf(fullbuffer, sizeof(fullbuffer), "[SM] %s.\n", buffer); snprintf(fullbuffer, sizeof(fullbuffer), "[SM] %s.\n", buffer);
engine->ClientPrintf(player->GetEdict(), fullbuffer); engine->ClientPrintf(player->GetEdict(), fullbuffer);
} else if (replyto == SM_REPLY_CHAT) {
char fullbuffer[192];
snprintf(fullbuffer, sizeof(fullbuffer), "[SM] %s.", buffer);
g_HL2.TextMsg(client, HUD_PRINTTALK, fullbuffer);
}
return false; return false;
} }

View File

@ -26,6 +26,9 @@
using namespace SourceHook; using namespace SourceHook;
#define HUD_PRINTTALK 3
#define HUD_PRINTCENTER 4
struct DataTableInfo struct DataTableInfo
{ {
ServerClass *sc; ServerClass *sc;

View File

@ -29,8 +29,6 @@ enum ConVarBounds
ConVarBound_Lower ConVarBound_Lower
}; };
#define HUD_PRINTTALK 3
static cell_t sm_CreateConVar(IPluginContext *pContext, const cell_t *params) static cell_t sm_CreateConVar(IPluginContext *pContext, const cell_t *params)
{ {
char *name, *defaultVal, *helpText; char *name, *defaultVal, *helpText;

View File

@ -19,9 +19,6 @@
#include "PlayerManager.h" #include "PlayerManager.h"
#include "HalfLife2.h" #include "HalfLife2.h"
#define HUD_PRINTTALK 3
#define HUD_PRINTCENTER 4
IServerPluginCallbacks *g_VSP = NULL; IServerPluginCallbacks *g_VSP = NULL;
class HalfLifeNatives : public SMGlobalClass class HalfLifeNatives : public SMGlobalClass