View Single Post
BrutalGoerge
AlliedModders Donor
Join Date: Jul 2007
Old 03-04-2015 , 02:48   Re: [TF2] gScramble Team Balancer/Scrambler -- 3.0.29 3/2/2015
Reply With Quote #1447

Quote:
Originally Posted by Phaiz View Post
The balance immunity worked just fine with the redux version that david did. What's the difference between yours and his?
Id think that mine should work better than the redux version atm....

here

REDUX FORCE BALANCE PRIORITY READER
Code:
		else if (GetClientTeam(i) == team) 
		{
			if (GetConVarBool(cvar_Preference) && g_aPlayers[i][iTeamPreference] == smallTeam && !TF2_IsClientUbered(i))
			{
				iFatTeam[counter][1] = 3;
			}
			else if (IsValidTarget(i, balance))
			{
				iFatTeam[counter][1] = GetPlayerPriority(i);
			}
			else
			{
				iFatTeam[counter][1] = -5;
			}
			
			iFatTeam[counter][0] = i;
			counter++;
		}
	}
GSCRAMBLE
Code:
		else if (GetClientTeam(i) == team) 
		{
			// player wants to be on the other team, give him preference 
			if (GetConVarBool(cvar_Preference) && g_aPlayers[i][iTeamPreference] == smallTeam && !TF2_IsClientUbered(i))
			{
				iFatTeam[counter][1] = 100;
			}
			else
				iFatTeam[counter][1] = GetPlayerPriority(i);
			//else if (IsClientValidBalanceTarget(i))
			//{
			//}
			//else
			//{
				//iFatTeam[counter][1] = -5;
			//}
			iFatTeam[counter][0] = i;
			counter++;
		}
	}
REDUX
Code:
stock GetPlayerPriority(client)
{
	if (IsFakeClient(client))
	{
		return 0;
	}
	
	if (TF2_IsPlayerInDuel(client))
	{
		return -10;
	}
	
	if (g_bUseBuddySystem)
	{
		if (g_aPlayers[client][iBuddy])
		{
			if (GetClientTeam(client) == GetClientTeam(g_aPlayers[client][iBuddy]))
			{
				return -10;
			}
			else if (IsValidTeam(g_aPlayers[client][iBuddy]))
			{
				return 10;
			}
		}
		
		if (IsClientBuddy(client))
		{
			return -2;
		}
	}
	
	new iPriority;
	
	if (IsClientInGame(client) && IsValidTeam(client))
	{
		if (g_aPlayers[client][iBalanceTime] > GetTime())
		{
			return -5;
		}
		
		if (g_aPlayers[client][iTeamworkTime] >= GetTime())
		{
			iPriority -= 3;
		}
		
		if (g_RoundState != bonusRound)
		{
			if (TF2_HasBuilding(client)||TF2_IsClientUberCharged(client)||TF2_IsClientUbered(client)|| !IsNotTopPlayer(client, GetClientTeam(client))||TF2_IsClientOnlyMedic(client))
			{
				return -10;
			}
			
			if (!IsPlayerAlive(client))
			{
				iPriority += 5;
			}
			else
			{
				if (g_aPlayers[client][bHasFlag])
				{
					iPriority -= 20;
				}
				
				iPriority -= 1;
			}
		}		
		/**
		make new clients more likely to get swapped
		*/
		if (GetClientTime(client) < 180)		
		{
			iPriority += 5;	
		}
	}
	
	return iPriority;
}
GSCRAMBLE

Code:
GetPlayerPriority(client)
{
	if (IsFakeClient(client))
	{
		return 0;
	}
	new iPriority;
	if (!IsClientValidBalanceTarget(client, false))
		iPriority -=50;
	if (!IsPlayerAlive(client))
	{
		iPriority += 5;
	}
	
	
	if (GetConVarInt(cvar_BalanceImmunity) == 1 || GetConVarInt(cvar_BalanceImmunity) == 3)
	{
		char sFlags[32];
		GetConVarString(cvar_BalanceAdmFlags, sFlags, sizeof(sFlags));
		if (IsAdmin(client, sFlags))
			iPriority -=100;
	}
	if (g_aPlayers[client][iBalanceTime] > GetTime())
	{
		iPriority -=20;
	}
	if (GetClientTime(client) < 180)
	{
		iPriority += 5;	
	}
	return iPriority;
}
Can you answer me when exactly it's choosing your admins? On the death event? Or on the force-balance timeout, or both?
__________________
My Pluggies If you like, consider to me.

Last edited by BrutalGoerge; 03-04-2015 at 02:53.
BrutalGoerge is offline