Advertisement
Guest User

df

a guest
Jun 12th, 2012
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  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. QueryResult Result = LoginDatabase.Query("SELECT id,vip FROM account WHERE vip= '1'");
  22. if(!Result)
  23. return false;
  24. Field * fields = NULL;
  25. Player* Executer = handler->GetSession()->GetPlayer();
  26. do
  27. {
  28. fields = Result->Fetch();
  29. }while(Result->NextRow());
  30. if(fields[0].GetUInt32() == Executer->GetSession()->GetAccountId() && fields[1].GetUInt32() == 1 )
  31. {
  32.  
  33. if(Executer->GetSelectedPlayer() == Executer)
  34. {
  35. Executer->AddAura(9454,Executer);
  36.  
  37. if (Executer->HasAura(9454))
  38. {
  39. Executer->RemoveAura(9454);
  40.  
  41. return true;
  42.  
  43. }
  44. }
  45. else
  46. {
  47. handler->GetSession()->SendNotification("You can only do this on yourself.");
  48. return false;
  49. }
  50. }
  51. else
  52. {
  53. handler->GetSession()->SendNotification("You aren't a V.I.P");
  54. return false;
  55. }
  56. return true;
  57. }
  58. };
  59.  
  60. void AddSC_Freezeme_Command()
  61. {
  62. new Freezeme_Command();
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement