Rochet2

jamey's Freeze fixd

Jun 12th, 2012
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "ScriptPCH.h"
  2. #include "Chat.h"
  3.  
  4. class Freezeme_Command : public CommandScript
  5. {
  6. public:
  7.     Freezeme_Command() : CommandScript("Freezeme_Command") {}
  8.  
  9.     ChatCommand* GetCommands() const
  10.     {
  11.         static ChatCommand Freezemecommandtable[] =
  12.         {
  13.             { "freezeme",   SEC_PLAYER,  false, &HandleFreezemeCommand,     "", NULL },
  14.             { NULL, 0,      false, NULL,       "", NULL }
  15.         };
  16.         return Freezemecommandtable;
  17.     }
  18.  
  19.     static bool HandleFreezemeCommand(ChatHandler* handler, const char* args)
  20.     {
  21.         WorldSession* Session = handler->GetSession();
  22.         Player* pPlayer = Session->GetPlayer();
  23.         QueryResult Result = LoginDatabase.PQuery("SELECT 1 FROM account WHERE vip = 1 and id = %u", Session->GetAccountId());
  24.         if(!Result)
  25.         {
  26.             Session->SendNotification("You aren't a V.I.P");
  27.             return false;
  28.         }
  29.         if (pPlayer->HasAura(9454))
  30.             pPlayer->RemoveAura(9454);
  31.         else
  32.             pPlayer->AddAura(9454,pPlayer);
  33.         return true;
  34.     }
  35. };
  36.  
  37. void AddSC_Freezeme_Command()
  38. {
  39.     new Freezeme_Command();
  40. }
Add Comment
Please, Sign In to add comment