This commit is contained in:
Mr-X-GTA 2024-12-13 19:56:06 +01:00
parent e65fb91d9b
commit 148bd232c3
3 changed files with 21 additions and 12 deletions

View File

@ -10,7 +10,7 @@
namespace big
{
class battleye_update_kick : player_command
class battleye_kick : player_command
{
using player_command::player_command;
@ -21,15 +21,17 @@ namespace big
virtual void execute(player_ptr player, const command_arguments& _args, const std::shared_ptr<command_context> ctx) override
{
unsigned char data[] = {0x00, 0x50, 0x31, 0x4A, 0xC0, 0x1A, 0x13, 0xFF, 0xFF, 0xFF};
player->tampered_with_be = true;
for (int i = 0; i < 20; i++)
{
data[0] = i;
g_battleye_service.send_message_to_client(player->get_net_game_player()->get_host_token(), &data, sizeof(data));
}
packet msg{};
msg.write_message(rage::eNetMessage::MsgKickPlayer);
msg.write<KickReason>(KickReason::BATTLEYE_KICK, 5);
msg.write<int>(0, 32);
msg.write<bool>(false, 1);
auto msg_id = player->get_session_player()->m_msg_id;
msg.send(msg_id);
}
};
battleye_update_kick g_battleye_update_kick("battleupdate", "BATTLEYE_UPDATE_KICK", "BATTLEYE_UPDATE_KICK_DESC", 0);
battleye_kick g_battleye_kick("battlekick", "BATTLEYE_KICK", "BATTLEYE_KICK_DESC", 0);
}

View File

@ -20,9 +20,16 @@ namespace big
else
{
if (player->is_host())
player_command::get("battleupdate"_J)->call(player, {});
{
constexpr size_t arg_count = 16;
int64_t args[arg_count] = {(int64_t)eRemoteEvent::InteriorControl, (int64_t)self::id, 1 << player->id(), (int64_t)(int)-1};
g_pointers->m_gta.m_trigger_script_event(1, args, arg_count, 1 << player->id(), (int)eRemoteEvent::InteriorControl);
}
else
{
player_command::get("desync"_J)->call(player, {});
}
}
}
};

View File

@ -13,6 +13,8 @@ namespace big
components::player_command_button<"hostkick">(g_player_service->get_selected());
ImGui::SameLine();
components::player_command_button<"breakup">(g_player_service->get_selected());
ImGui::SameLine();
components::player_command_button<"battlekick">(g_player_service->get_selected());
ImGui::EndDisabled();
components::player_command_button<"smartkick">(g_player_service->get_selected());
@ -24,7 +26,5 @@ namespace big
components::player_command_button<"endkick">(g_player_service->get_selected());
ImGui::SameLine();
components::player_command_button<"desync">(g_player_service->get_selected());
ImGui::SameLine();
components::player_command_button<"battleupdate">(g_player_service->get_selected());
}
}