Try some of these:
PHP Code:
stock bool:IsPlayerTank(client)
{
if (client > 0 && IsClientInGame(client) && GetClientTeam(client) == 3 && IsPlayerAlive(client)) //We do these checks just in case the bot is a Tank because IsValidClient would return false otherwise.
{
decl String: classname[32];
GetClientModel(client, classname, sizeof(classname));
if (StrContains(classname, "hulk", false) != -1)
return true;
return false;
}
return false;
}
PHP Code:
stock bool:IsValidClient(client) //For detecting valid human players only
{
if(client > 0 && client <= MaxClients)
{
if (IsClientInGame(client) && !IsFakeClient(client))
{
return true;
}
}
return false;
}
Those should make things easier to work with and prevent errors.
__________________