mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-01-06 01:23:35 +08:00
Added Empty lobby button (#1812)
This commit is contained in:
parent
8b415d5186
commit
17e79dbaaa
21
src/backend/commands/session/wipe_session.cpp
Normal file
21
src/backend/commands/session/wipe_session.cpp
Normal 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);
|
||||||
|
}
|
@ -15,6 +15,7 @@
|
|||||||
#include <network/Network.hpp>
|
#include <network/Network.hpp>
|
||||||
#include <network/netTime.hpp>
|
#include <network/netTime.hpp>
|
||||||
|
|
||||||
|
|
||||||
inline void gamer_handle_deserialize(rage::rlGamerHandle& hnd, rage::datBitBuffer& buf)
|
inline void gamer_handle_deserialize(rage::rlGamerHandle& hnd, rage::datBitBuffer& buf)
|
||||||
{
|
{
|
||||||
constexpr int PC_PLATFORM = 3;
|
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("breakup")))->call(player, {}),
|
||||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("hostkick")))->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, {});
|
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("nfkick")))->call(player, {});
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -479,6 +479,7 @@ namespace big
|
|||||||
},
|
},
|
||||||
true,
|
true,
|
||||||
"Teleport");
|
"Teleport");
|
||||||
|
components::command_button<"emptysession">({}, "Empty Session");
|
||||||
|
|
||||||
components::sub_title("SCRIPT_HOST_FEATURES"_T);
|
components::sub_title("SCRIPT_HOST_FEATURES"_T);
|
||||||
ImGui::Checkbox("DISABLE_CEO_MONEY"_T.data(), &g.session.block_ceo_money);
|
ImGui::Checkbox("DISABLE_CEO_MONEY"_T.data(), &g.session.block_ceo_money);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user