Add kill command

This commit is contained in:
Federico Cecchetto 2022-01-03 23:32:40 +01:00
parent c9d01afa7f
commit ca01e5d1ec

View File

@ -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);
});
}
};
}