mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
29 lines
472 B
C++
Executable File
29 lines
472 B
C++
Executable File
#include "../client.h"
|
|
|
|
void command_kill(Client *c, const Seperator *sep)
|
|
{
|
|
auto target = c->GetTarget();
|
|
if (!target) {
|
|
c->Message(Chat::White, "You must have a target to use this command.");
|
|
return;
|
|
}
|
|
|
|
if (
|
|
!target->IsClient() ||
|
|
target->CastToClient()->Admin() <= c->Admin()
|
|
) {
|
|
if (c != target) {
|
|
c->Message(
|
|
Chat::White,
|
|
fmt::format(
|
|
"Killing {}.",
|
|
c->GetTargetDescription(target)
|
|
).c_str()
|
|
);
|
|
}
|
|
|
|
target->Kill();
|
|
}
|
|
}
|
|
|