mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-13 23:28:04 +03:00
Print reason kick also added reason message for kick
This commit is contained in:
parent
0ad1232786
commit
9ed19456f0
@ -900,14 +900,21 @@ void CCSBotManager::MaintainBotQuota()
|
||||
}
|
||||
|
||||
// attempt to kick a bot from the given team
|
||||
if (UTIL_KickBotFromTeam(kickTeam))
|
||||
return;
|
||||
bool atLeastOneKicked = UTIL_KickBotFromTeam(kickTeam);
|
||||
|
||||
// if there were no bots on the team, kick a bot from the other team
|
||||
if (kickTeam == TERRORIST)
|
||||
UTIL_KickBotFromTeam(CT);
|
||||
else
|
||||
UTIL_KickBotFromTeam(TERRORIST);
|
||||
if (!atLeastOneKicked)
|
||||
{
|
||||
// if there were no bots on the team, kick a bot from the other team
|
||||
if (kickTeam == TERRORIST)
|
||||
atLeastOneKicked = UTIL_KickBotFromTeam(CT);
|
||||
else
|
||||
atLeastOneKicked = UTIL_KickBotFromTeam(TERRORIST);
|
||||
}
|
||||
|
||||
if (atLeastOneKicked)
|
||||
{
|
||||
CONSOLE_ECHO("These bots kicked to maintain quota.\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -563,8 +563,16 @@ void ProcessKickVote(CBasePlayer *pVotingPlayer, CBasePlayer *pKickPlayer)
|
||||
|
||||
if (iVotesNeeded >= int(fKickPercent))
|
||||
{
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
SERVER_COMMAND(UTIL_VarArgs("kick #%d \"You have been voted off.\"\n", iVoteID));
|
||||
SERVER_EXECUTE();
|
||||
#endif
|
||||
|
||||
UTIL_ClientPrintAll(HUD_PRINTCENTER, "#Game_kicked", STRING(pKickPlayer->pev->netname));
|
||||
|
||||
#ifndef REGAMEDLL_FIXES
|
||||
SERVER_COMMAND(UTIL_VarArgs("kick # %d\n", iVoteID));
|
||||
#endif
|
||||
pTempEntity = nullptr;
|
||||
|
||||
while ((pTempEntity = UTIL_FindEntityByClassname(pTempEntity, "player")))
|
||||
@ -1767,17 +1775,26 @@ BOOL EXT_FUNC __API_HOOK(HandleMenu_ChooseTeam)(CBasePlayer *pPlayer, int slot)
|
||||
{
|
||||
team = (RANDOM_LONG(0, 1) == 0) ? TERRORIST : CT;
|
||||
|
||||
if (!UTIL_KickBotFromTeam(team))
|
||||
bool atLeastOneLeft = UTIL_KickBotFromTeam(team);
|
||||
|
||||
if (!atLeastOneLeft)
|
||||
{
|
||||
// no bots on that team, try the other
|
||||
team = (team == CT) ? TERRORIST : CT;
|
||||
|
||||
if (!UTIL_KickBotFromTeam(team))
|
||||
atLeastOneLeft = UTIL_KickBotFromTeam(team);
|
||||
|
||||
if (!atLeastOneLeft)
|
||||
{
|
||||
// couldn't kick any bots, fail
|
||||
team = UNASSIGNED;
|
||||
}
|
||||
}
|
||||
|
||||
if (atLeastOneLeft)
|
||||
{
|
||||
CONSOLE_ECHO("These bots has left the game to make room for human players.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1905,7 +1922,10 @@ BOOL EXT_FUNC __API_HOOK(HandleMenu_ChooseTeam)(CBasePlayer *pPlayer, int slot)
|
||||
if (cv_bot_auto_vacate.value > 0 && !pPlayer->IsBot())
|
||||
{
|
||||
if (UTIL_KickBotFromTeam(team))
|
||||
{
|
||||
CONSOLE_ECHO("These bots has left the game to make room for human players.\n");
|
||||
madeRoom = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!madeRoom)
|
||||
|
@ -854,7 +854,7 @@ void CHostage::ApplyHostagePenalty(CBasePlayer *pAttacker)
|
||||
else if (pAttacker->m_iHostagesKilled >= iHostagePenalty)
|
||||
{
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
SERVER_COMMAND(UTIL_VarArgs("kick #%d\n", GETPLAYERUSERID(pAttacker->edict())));
|
||||
SERVER_COMMAND(UTIL_VarArgs("kick #%d \"For killing too many hostages\"\n", GETPLAYERUSERID(pAttacker->edict())));
|
||||
#else
|
||||
CLIENT_COMMAND(pAttacker->edict(), "disconnect\n");
|
||||
#endif
|
||||
|
@ -3806,7 +3806,11 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(PlayerKilled)(CBasePlayer *pVictim,
|
||||
int iUserID = GETPLAYERUSERID(killer->edict());
|
||||
if (iUserID != -1)
|
||||
{
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
SERVER_COMMAND(UTIL_VarArgs("kick #%d \"For killing too many teammates\"\n", iUserID));
|
||||
#else
|
||||
SERVER_COMMAND(UTIL_VarArgs("kick # %d\n", iUserID));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4244,7 +4244,16 @@ void EXT_FUNC CBasePlayer::__API_HOOK(PreThink)()
|
||||
UTIL_LogPrintf("\"%s<%i><%s><%s>\" triggered \"Game_idle_kick\" (auto)\n", STRING(pev->netname), GETPLAYERUSERID(edict()), GETPLAYERAUTHID(edict()), GetTeam(m_iTeam));
|
||||
UTIL_ClientPrintAll(HUD_PRINTCONSOLE, "#Game_idle_kick", STRING(pev->netname));
|
||||
|
||||
#ifdef REGAMEDLL_FIXES
|
||||
int iUserID = GETPLAYERUSERID(edict());
|
||||
if (iUserID != -1)
|
||||
{
|
||||
SERVER_COMMAND(UTIL_VarArgs("kick #%d \"Player idle\"\n", iUserID));
|
||||
}
|
||||
#else
|
||||
SERVER_COMMAND(UTIL_VarArgs("kick \"%s\"\n", STRING(pev->netname)));
|
||||
#endif // #ifdef REGAMEDLL_FIXES
|
||||
|
||||
m_fLastMovement = gpGlobals->time;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user