Add kill command
This commit is contained in:
parent
c9d01afa7f
commit
ca01e5d1ec
@ -7,6 +7,7 @@
|
||||
#include "game/scripting/execution.hpp"
|
||||
|
||||
#include "command.hpp"
|
||||
#include "scheduler.hpp"
|
||||
#include "game_console.hpp"
|
||||
#include "chat.hpp"
|
||||
#include "fastfiles.hpp"
|
||||
@ -426,6 +427,26 @@ namespace command
|
||||
{
|
||||
}
|
||||
});
|
||||
|
||||
add("kill", [](const params& params)
|
||||
{
|
||||
if (!game::SV_Loaded())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
scheduler::once([]()
|
||||
{
|
||||
try
|
||||
{
|
||||
const scripting::entity player = scripting::call("getentbynum", {0}).as<scripting::entity>();
|
||||
player.call("kill");
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
}, scheduler::pipeline::server);
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user