TmpMenu/src/backend/commands/player/kick/script_host_kick.cpp

31 lines
808 B
C++
Raw Normal View History

#include "backend/player_command.hpp"
#include "core/scr_globals.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "util/scripts.hpp"
namespace big
{
class script_host_kick : player_command
{
using player_command::player_command;
virtual CommandAccessLevel get_access_level()
{
return CommandAccessLevel::TOXIC;
}
virtual void execute(player_ptr player, const std::vector<std::uint64_t>& _args, const std::shared_ptr<command_context> ctx)
{
if (!scripts::force_host(RAGE_JOAAT("freemode")))
{
g_notification_service->push_error("Kick", "Force script host failed!");
return;
}
*scr_globals::gsbd_kicking.at(player->id(), 1).as<bool*>() = true;
}
};
script_host_kick g_script_host_kick("shkick", "Script Host Kick", "Blocked by most menus", 0, false);
}