Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- #include "Chat.h"
- class Freezeme_Command : public CommandScript
- {
- public:
- Freezeme_Command() : CommandScript("Freezeme_Command") {}
- ChatCommand* GetCommands() const
- {
- static ChatCommand Freezemecommandtable[] =
- {
- { "freezeme", SEC_PLAYER, false, &HandleFreezemeCommand, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
- return Freezemecommandtable;
- }
- static bool HandleFreezemeCommand(ChatHandler* handler, const char* args)
- {
- QueryResult Result = LoginDatabase.Query("SELECT id,vip FROM account WHERE vip= '1'");
- if(!Result)
- return false;
- Field * fields = NULL;
- Player* Executer = handler->GetSession()->GetPlayer();
- do
- {
- fields = Result->Fetch();
- }while(Result->NextRow());
- if(fields[0].GetUInt32() == Executer->GetSession()->GetAccountId() && fields[1].GetUInt32() == 1 )
- {
- if(Executer->GetSelectedPlayer() == Executer)
- {
- Executer->AddAura(9454,Executer);
- if (Executer->HasAura(9454))
- {
- Executer->RemoveAura(9454);
- return true;
- }
- }
- else
- {
- handler->GetSession()->SendNotification("You can only do this on yourself.");
- return false;
- }
- }
- else
- {
- handler->GetSession()->SendNotification("You aren't a V.I.P");
- return false;
- }
- return true;
- }
- };
- void AddSC_Freezeme_Command()
- {
- new Freezeme_Command();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement