added so autismbots can become mother zombie if max 3 humans are playing
This commit is contained in:
parent
862c3b4d67
commit
16edc14753
@ -248,15 +248,42 @@ public Action ZR_OnClientMotherZombieEligible(int client)
|
||||
bHasItem = EW_ClientHasItem(client);
|
||||
#endif
|
||||
|
||||
char sAuthID[32];
|
||||
GetClientAuthId(client, AuthId_Steam2, sAuthID, sizeof(sAuthID)); //autism bot
|
||||
|
||||
if(GetClientIdleTime(client) > g_iAFKTime || IsFakeClient(client) || bHasItem || StrEqual(sAuthID, "STEAM_0:1:60189040") || StrEqual(sAuthID, "STEAM_0:0:518094602"))
|
||||
if(GetClientIdleTime(client) > g_iAFKTime || IsFakeClient(client) || bHasItem || is_autism_bot(client))
|
||||
{
|
||||
if (is_autism_bot(client))
|
||||
{
|
||||
int valid_humans = 0;
|
||||
for (int clienti = 1; clienti <= MaxClients; clienti++)
|
||||
{
|
||||
if (!IsValidClient(clienti) || !IsPlayerAlive(clienti) || is_autism_bot(clienti)) continue;
|
||||
valid_humans++;
|
||||
if (valid_humans > 3)
|
||||
break;
|
||||
}
|
||||
if (4 > valid_humans > 0)
|
||||
{
|
||||
return Plugin_Continue;
|
||||
}
|
||||
}
|
||||
return Plugin_Handled;
|
||||
|
||||
}
|
||||
return Plugin_Continue;
|
||||
}
|
||||
|
||||
public bool is_autism_bot(int client)
|
||||
{
|
||||
char sAuthID[32];
|
||||
GetClientAuthId(client, AuthId_Steam2, sAuthID, sizeof(sAuthID)); //autism bot
|
||||
return StrEqual(sAuthID, "STEAM_0:1:60189040") || StrEqual(sAuthID, "STEAM_0:0:518094602") || StrEqual(sAuthID, "STEAM_0:0:204398871") || StrEqual(sAuthID, "STEAM_0:0:610560766");
|
||||
}
|
||||
|
||||
stock bool IsValidClient(int client)
|
||||
{
|
||||
if (client > 0 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public void ZR_OnClientInfected(int client, int attacker, bool motherInfect, bool respawnOverride, bool respawn)
|
||||
{
|
||||
g_iZHPMax[client] = GetClientHealth(client);
|
||||
@ -330,7 +357,16 @@ public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damage
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
public bool Filter_Motherzombies(const char[] sPattern, Handle hClients, int client)
|
||||
/*
|
||||
according to my commandfilters.inc is MultiTargetFilter the following:
|
||||
typeset MultiTargetFilter {
|
||||
function bool (const char[] pattern, Handle clients);
|
||||
function bool (const char[] pattern, ArrayList clients);
|
||||
}
|
||||
so that last int client param would not work, it was anyways an un-used parameter.
|
||||
*/
|
||||
|
||||
public bool Filter_Motherzombies(const char[] sPattern, Handle hClients)
|
||||
{
|
||||
for(int i = 1; i <= MaxClients; i++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user