Added Empty lobby button (#1812)

This commit is contained in:
Rxann 2023-07-24 16:10:44 -04:00 committed by GitHub
parent 8b415d5186
commit 17e79dbaaa
3 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,21 @@
#include "backend/player_command.hpp"
#include "network/CNetworkPlayerMgr.hpp"
#include "pointers.hpp"
#include "services/players/player_service.hpp"
namespace big
{
class empty_session : command
{
using command::command;
virtual void execute(const std::vector<uint64_t>&, const std::shared_ptr<command_context> ctx)
{
g_player_service->iterate([](const player_entry& player) {
auto mgr = *g_pointers->m_gta.m_network_player_mgr;
mgr->RemovePlayer(player.second->get_net_game_player());
});
g_notification_service->push_success("Empty Session", "Completed");
}
};
empty_session g_empty_session("emptysession", "Remove All Players From Session", "Removes everyone from the session", 0);
}

View File

@ -15,6 +15,7 @@
#include <network/Network.hpp>
#include <network/netTime.hpp>
inline void gamer_handle_deserialize(rage::rlGamerHandle& hnd, rage::datBitBuffer& buf)
{
constexpr int PC_PLATFORM = 3;
@ -121,7 +122,7 @@ namespace big
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("breakup")))->call(player, {}),
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("hostkick")))->call(player, {});
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("bailkick")))->call(player, {});
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("endkick")))->call(player, {});
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("nfkick")))->call(player, {});
}
return true;

View File

@ -479,6 +479,7 @@ namespace big
},
true,
"Teleport");
components::command_button<"emptysession">({}, "Empty Session");
components::sub_title("SCRIPT_HOST_FEATURES"_T);
ImGui::Checkbox("DISABLE_CEO_MONEY"_T.data(), &g.session.block_ceo_money);