ReservedSlots: give non-donators a chance to join a team before getting kicked

This commit is contained in:
hubdom 2020-12-27 21:56:23 +01:00
parent 1fd1248528
commit cf1299454a

View File

@ -156,8 +156,8 @@ public void AsyncHasSteamIDReservedSlotCallback(const char[] sSteam32ID, int Res
stock bool KickValidClient(const char[] sName, const char[] sSteam32ID, AdminId admin, int Immunity)
{
int HighestValue[3] = {-1, ...};
int HighestValueClient[3] = {0, ...};
int HighestValue[4] = {-1, ...};
int HighestValueClient[4] = {0, ...};
for(int client = 1; client <= MaxClients; client++)
{
@ -180,11 +180,11 @@ stock bool KickValidClient(const char[] sName, const char[] sSteam32ID, AdminId
#endif
/* Spectators
* Sort by idle time and also kick donators if IdleTime > 30
* Sort by idle time and kick non-donators if IdleTime > 10
*/
if(GetClientTeam(client) <= CS_TEAM_SPECTATOR)
{
if(!Donator || IdleTime > 30)
if(!Donator && IdleTime > 10)
{
if(IdleTime > HighestValue[0])
{
@ -193,6 +193,20 @@ stock bool KickValidClient(const char[] sName, const char[] sSteam32ID, AdminId
}
}
}
/* Spectators
* Sort by idle time and also kick donators if IdleTime > 30
*/
if(GetClientTeam(client) <= CS_TEAM_SPECTATOR)
{
if(Donator && IdleTime > 30)
{
if(IdleTime > HighestValue[0])
{
HighestValue[1] = IdleTime;
HighestValueClient[1] = client;
}
}
}
/* Spectators */
/* Dead non-donator with IdleTime > 30
@ -202,8 +216,8 @@ stock bool KickValidClient(const char[] sName, const char[] sSteam32ID, AdminId
{
if(IdleTime > 30 && IdleTime > HighestValue[1])
{
HighestValue[1] = IdleTime;
HighestValueClient[1] = client;
HighestValue[2] = IdleTime;
HighestValueClient[2] = client;
}
}
/* Dead non-donator with IdleTime > 30 */
@ -215,8 +229,8 @@ stock bool KickValidClient(const char[] sName, const char[] sSteam32ID, AdminId
{
if(IdleTime > 30 && IdleTime > HighestValue[2])
{
HighestValue[2] = IdleTime;
HighestValueClient[2] = client;
HighestValue[3] = IdleTime;
HighestValueClient[3] = client;
}
}
/* Alive non-donator with IdleTime > 30 */