Fixed invalid client index errors.
This commit is contained in:
@ -48,7 +48,7 @@ public TraceAttack(client, inflictor, attacker, damage, hitbox, hitgroup)
|
||||
{
|
||||
new bool:enabled = GetConVarBool(gCvars[CVAR_ENABLE]);
|
||||
|
||||
if (!attacker || !IsClientConnected(attacker) || !IsClientInGame(attacker) || !enabled)
|
||||
if (!attacker || !IsClientPlayer(attacker) || !IsClientInGame(attacker) || !enabled)
|
||||
{
|
||||
return Hacks_Continue;
|
||||
}
|
||||
@ -99,7 +99,7 @@ public OnTakeDamage(client, inflictor, attacker, damage, damagetype, ammotype)
|
||||
|
||||
if (damagetype & DMG_BLAST)
|
||||
{
|
||||
if (!IsPlayerHuman(client) || !IsClientInGame(attacker))
|
||||
if (!IsPlayerHuman(client) || !IsClientPlayer(attacker) || !IsClientInGame(attacker))
|
||||
{
|
||||
return Hacks_Continue;
|
||||
}
|
||||
@ -109,12 +109,12 @@ public OnTakeDamage(client, inflictor, attacker, damage, damagetype, ammotype)
|
||||
|
||||
if (damagetype & DMG_BULLET)
|
||||
{
|
||||
if (!client || !IsClientInGame(client))
|
||||
if (!client || !IsClientPlayer(client) || !IsClientInGame(client))
|
||||
{
|
||||
return Hacks_Continue;
|
||||
}
|
||||
|
||||
if (!attacker || !IsClientInGame(attacker))
|
||||
if (!attacker || !IsClientPlayer(attacker) || !IsClientInGame(attacker))
|
||||
{
|
||||
return Hacks_Continue;
|
||||
}
|
||||
|
@ -53,6 +53,8 @@ new teleCount[MAXPLAYERS+1];
|
||||
new protCount[MAXPLAYERS+1];
|
||||
new Float:spawnLoc[MAXPLAYERS+1][3];
|
||||
|
||||
new maxclients;
|
||||
|
||||
new Handle:tRound = INVALID_HANDLE;
|
||||
new Handle:tInfect = INVALID_HANDLE;
|
||||
|
||||
@ -187,4 +189,16 @@ bool:IntToBool(intval)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool:IsClientPlayer(client)
|
||||
{
|
||||
if (client > 1 || client <= maxclients)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user