This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/src/backend/looped/session/auto_kick_host.cpp

25 lines
606 B
C++
Raw Normal View History

2022-12-06 16:12:02 +00:00
#include "backend/looped/looped.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "backend/player_command.hpp"
2022-12-06 16:12:02 +00:00
namespace big
{
static bool bLastKickHost = false;
void looped::session_auto_kick_host()
{
bool kick_host = *g_pointers->m_is_session_started && g.session.force_session_host && g.session.kick_host_when_forcing_host;
2022-12-06 16:12:02 +00:00
if (kick_host && !bLastKickHost)
{
g_player_service->iterate([](auto& plyr)
{
if (plyr.second->is_host())
{
((player_command*)(command::get(RAGE_JOAAT("lckick"))))->call(plyr.second, {});
}
2022-12-06 16:12:02 +00:00
});
}
bLastKickHost = kick_host;
}
}