updated fakeclients slightly and changed mapchooser for loops to not miss the last client

This commit is contained in:
jenz 2026-03-27 17:34:04 +01:00
parent 6a5cbf74f1
commit 6790e463fc
4 changed files with 30 additions and 18 deletions

View File

@ -508,7 +508,17 @@ public void CheckPopulation()
int full_client_count = GetClientCount(false);
if (full_client_count > 50) //counting all clients in total.
if (full_client_count > 50 && iFakes > 15)
{
iFakesInTeamNeeded = 3;
iFakesNeeded = 15;
}
else if (full_client_count > 54 && iFakes > 8)
{
iFakesInTeamNeeded = 2;
iFakesNeeded = 5;
}
else if (full_client_count > 59 && iFakes > 0) //counting all clients in total.
{
iFakesInTeamNeeded = 0;
iFakesNeeded = 0;

View File

@ -231,7 +231,7 @@ enum WarningType
//call forward to reset all nominations
public void OnPluginEnd()
{
for (int i = 0; i < MaxClients; i++)
for (int i = 0; i <= MaxClients; i++)
{
int index = FindValueInArray(g_NominateOwners, i);
if (index == -1) continue;
@ -261,7 +261,7 @@ public void OnPluginStart()
g_NextMapList = CreateArray(arraySize);
g_OfficialList = CreateArray(arraySize);
for (int i = 0; i < MaxClients; i++)
for (int i = 0; i <= MaxClients; i++)
{
g_NominateList[i] = CreateArray(arraySize);
if (IsValidClient(i))
@ -587,7 +587,7 @@ public void OnConfigsExecuted()
g_NominateCount = 0;
g_NominateReservedCount = 0;
for (int i = 0; i < MaxClients; i++)
for (int i = 0; i <= MaxClients; i++)
{
if (g_NominateList[i] != INVALID_HANDLE)
{
@ -1233,7 +1233,7 @@ public Handle get_most_nominated_maps(bool create_next_vote)
Handle most_nominated_maps = CreateArray(arraySize);
StringMap sm = new StringMap();
for (int i = 0; i < MaxClients; i++)
for (int i = 0; i <= MaxClients; i++)
{
for (int j = 0; j < GetArraySize(g_NominateList[i]); j++)
{
@ -1563,7 +1563,7 @@ void InitiateVote(MapChange when, Handle inputlist=INVALID_HANDLE)
g_NominateCount = 0;
g_NominateReservedCount = 0;
ClearArray(g_NominateOwners);
for (int j = 0; j < MaxClients; j++)
for (int j = 0; j <= MaxClients; j++)
{
ClearArray(g_NominateList[j]);
}
@ -1616,7 +1616,7 @@ void InitiateVote(MapChange when, Handle inputlist=INVALID_HANDLE)
int clients[MAXPLAYERS + 1];
int count = 0;
//here we pick clients to show the vote to, we dont show it to autismbots.
for (int i = 0; i < MaxClients; i++)
for (int i = 0; i <= MaxClients; i++)
{
Format(player_mapvote[i], 128, "");
//2023 excluding autismbots.
@ -1652,7 +1652,7 @@ public Action Timer_Countdown(Handle timer)
int max_count = 0;
StringMap sm = new StringMap();
char picked_map[PLATFORM_MAX_PATH];
for (int i = 0; i < MaxClients; i++)
for (int i = 0; i <= MaxClients; i++)
{
if (IsValidClient(i) && !StrEqual(player_mapvote[i], "") && !is_bot_player[i] )
{
@ -1679,7 +1679,7 @@ public Action Timer_Countdown(Handle timer)
int total_votes = 0;
int voted_so_far = 0;
for (int i = 0; i < MaxClients; i++)
for (int i = 0; i <= MaxClients; i++)
{
if (IsValidClient(i) && !is_bot_player[i])
{
@ -1888,13 +1888,15 @@ public void Handler_MapVoteFinished(Handle menu,
}
sm.Remove(picked_map);
weighted_votes[i] = max_count;
//LogMessage("weighted_votes[i] %i. i: %i. picked_map: %s", weighted_votes[i], i, picked_map);
Format(weighted_maps[i], 128, picked_map);
delete keys;
}
delete sm;
//LogMessage("finished this time around.");
int total_votes = 0;
for (int i = 0; i < MaxClients; i++)
for (int i = 0; i <= MaxClients; i++)
{
if (IsValidClient(i) && !is_bot_player[i])
{
@ -2402,7 +2404,7 @@ bool InternalRemoveNominationByMap(char[] map)
{
//this seems only to be used by the admin command nominate_removemap, hence it will now exhaust every nomination for a specific map instead of a single one.
bool removed_at_least_once = false;
for (int client = 0; client < MaxClients; client++)
for (int client = 0; client <= MaxClients; client++)
{
for(int i = 0; i < GetArraySize(g_NominateList[client]); i++)
{
@ -2541,7 +2543,7 @@ public int Native_GetNominatedMapList(Handle plugin, int numParams)
return 0;
static char map[PLATFORM_MAX_PATH];
for (int client = 0; client < MaxClients; client++)
for (int client = 0; client <= MaxClients; client++)
{
for(int i = 0; i < GetArraySize(g_NominateList[client]); i++)
{
@ -2976,7 +2978,7 @@ public int Native_GetMapGroupRestriction(Handle plugin, int numParams)
char kv_map[PLATFORM_MAX_PATH];
int groups_[32];
KeyValues kv = CreateKeyValues("cur_groups");
for (int clienti = 0; clienti < MaxClients; clienti++)
for (int clienti = 0; clienti <= MaxClients; clienti++)
{
for(int i = 0; i < GetArraySize(g_NominateList[clienti]); i++)
{
@ -3353,7 +3355,7 @@ stock bool InternalAreRestrictionsActive(bool skip_player_check)
}
int ActivePlayerCount = 0;
for (int i = 0; i < MaxClients; i++)
for (int i = 0; i <= MaxClients; i++)
{
if (IsValidClient(i) && !IsFakeClient(i) && !IsClientSourceTV(i) && !is_bot_player[i] && GetClientIdleTime(i) < g_iPlayerAFKTime
&& (GetClientTeam(i) == CS_TEAM_T || GetClientTeam(i) == CS_TEAM_CT))

View File

@ -837,7 +837,7 @@ bool PopulateNominateListMenu(Menu menu, int client, const char[] filter = "")
else
{
int nominate_worth = GetPlayerWorthRTV_boost_(owner);
//atm everybody just has equal voting again, so this is just += 1
//2026 march: the boosting can now range from 1 to 2. so for most its +=1 and for a few +=2.
nominate_count_for_particular_map += nominate_worth;
}
sm.SetValue(map, nominate_count_for_particular_map, true);

View File

@ -249,7 +249,7 @@ void UpdateRTV()
public int get_voted_rtv()
{
int Votes = 0;
for (int i = 0; i < MaxClients; i++)
for (int i = 0; i <= MaxClients; i++)
{
if (IsValidClient(i) && g_Voted[i])
{
@ -319,10 +319,10 @@ void AttemptRTV(int client)
return;
}
update_g_VotesNeeded();
int Votes = get_voted_rtv();
if (g_Voted[client])
{
int Votes = get_voted_rtv();
ReplyToCommand(client, "[RTVE] You have already voted to Rock the Vote. (%i/%i Votes. (%i RTV boost))", Votes, g_VotesNeeded, GetPlayerWorthRTV_boost_(client));
return;
}
@ -332,7 +332,7 @@ void AttemptRTV(int client)
g_Voted[client] = true;
Votes = get_voted_rtv();
int Votes = get_voted_rtv();
PrintToChatAll("[RTVE] %s wants to rock the vote. (%i/%i RTV reached) (%i RTV boost).", name, Votes, g_VotesNeeded, GetPlayerWorthRTV_boost_(client));