Skip to content

Commit

Permalink
Create anticheatann.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
SymbolixDEV committed Sep 16, 2015
1 parent 2c2bd21 commit fe957ad
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions Function/anticheatann.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//by SymbolixDEV
#include "ScriptPCH.h"
#include "Chat.h"

/* Colors */
#define MSG_COLOR_WHITE "|cffffffff"
#define MSG_COLOR_LIGHTBLUE "|cffADD8E6"

class anticheatcommand : public CommandScript
{
public:
anticheatcommand() : CommandScript("Anticheat") { }

ChatCommand* GetCommands() const
{
static ChatCommand IngameCommandTable[] =
{
{ "anticheat", SEC_GAMEMASTER, true, &HandleAnticheatCommand, "", NULL },
{ NULL, 0, false, NULL, "", NULL }
};
return IngameCommandTable;
}
static bool HandleAnticheatCommand(ChatHandler * handler, const char * args)
{
if(!*args)
return false;
char message[1024];

if(handler->GetSession()->GetSecurity() >= SEC_GAMEMASTER)
{
snprintf(message, 1024, "[GM-Anticheat]Banned From - [%s%s|r]: %s%s|r", MSG_COLOR_WHITE, handler->GetSession()->GetPlayer()->GetName().c_str(), MSG_COLOR_LIGHTBLUE, args);
sWorld->SendServerMessage(SERVER_MSG_STRING, message, NULL);
}
return true;
}
};

void AddSC_anticheat()
{
new anticheatcommand;
}

0 comments on commit fe957ad

Please sign in to comment.