Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Player* player = GetSession()->GetPlayer();
- Unit* target = getSelectedUnit();
- if (!target || !GetSession()->GetPlayer()->GetSelection())
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
- if (target->GetTypeId() == TYPEID_PLAYER && player->GetSession()->GetSecurity() < 9)
- {
- if (HasLowerSecurity((Player*)target, 0, false))
- return false;
- if(!*args)
- {
- PSendSysMessage("You must enter a reason to kill the player.");
- SetSentErrorMessage(true);
- return false;
- }
- if (target->GetMap()->IsBattlegroundOrArena())
- {
- SendSysMessage("You can not kill players in a battleground or arena.");
- SetSentErrorMessage(true);
- return false;
- }
- std::string diereason = args;
- ChatHandler((Player*)target).PSendSysMessage("GM: |cffFF0000%s|cffFFFF05 has killed you with the kill command. The reason was: |cffFF0000%s|cffFFFF05.|r", player->GetName(), diereason.c_str());
- }
- if (target->isAlive())
- {
- if (sWorld->getBoolConfig(CONFIG_DIE_COMMAND_MODE))
- player->Kill(target);
- else
- player->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
- }
- return true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement