Permalink
Browse files

Replace IsClientConnected with IsClientInGame

With this i had more success as IsClientConnected, with IsClientConnected i had some errors with client isn't ingame.
  • Loading branch information...
Bara committed Oct 30, 2018
1 parent 2a4331e commit f5da3520013eb79d13f613d015c61d0e6fe8a983
@@ -732,7 +732,7 @@ bool IsClientValid(int client, bool nobots = false)
{
if (client > 0 && client <= MaxClients)
{
if (!IsClientConnected(client) || IsClientSourceTV(client) || !IsClientInGame(client))
if (IsClientSourceTV(client) || !IsClientInGame(client))
{
return false;
}
@@ -630,7 +630,7 @@ stock int C_ShowActivity(int client, const char[] format, any ...)
bool display_in_chat = false;
if (client != 0)
{
if (client < 0 || client > MaxClients || !IsClientConnected(client))
if (client < 0 || client > MaxClients || !IsClientInGame(client))
ThrowError("Client index %d is invalid", client);
GetClientName(client, name, sizeof(name));
@@ -744,7 +744,7 @@ stock int C_ShowActivityEx(int client, const char[] tag, const char[] format, an
bool display_in_chat = false;
if (client != 0)
{
if (client < 0 || client > MaxClients || !IsClientConnected(client))
if (client < 0 || client > MaxClients || !IsClientInGame(client))
ThrowError("Client index %d is invalid", client);
GetClientName(client, name, sizeof(name));
@@ -859,7 +859,7 @@ stock int C_ShowActivity2(int client, const char[] tag, const char[] format, any
char sign[MAX_NAME_LENGTH] = "ADMIN";
if (client != 0)
{
if (client < 0 || client > MaxClients || !IsClientConnected(client))
if (client < 0 || client > MaxClients || !IsClientInGame(client))
ThrowError("Client index %d is invalid", client);
GetClientName(client, name, sizeof(name));
@@ -422,7 +422,7 @@ stock int MC_ShowActivity(int client, const char[] format, any ...)
bool display_in_chat = false;
if (client != 0)
{
if (client < 0 || client > MaxClients || !IsClientConnected(client))
if (client < 0 || client > MaxClients || !IsClientInGame(client))
ThrowError("Client index %d is invalid", client);
GetClientName(client, name, sizeof(name));
@@ -535,7 +535,7 @@ stock int MC_ShowActivityEx(int client, const char[] tag, const char[] format, a
bool display_in_chat = false;
if (client != 0)
{
if (client < 0 || client > MaxClients || !IsClientConnected(client))
if (client < 0 || client > MaxClients || !IsClientInGame(client))
ThrowError("Client index %d is invalid", client);
GetClientName(client, name, sizeof(name));
@@ -649,7 +649,7 @@ stock int MC_ShowActivity2(int client, const char[] tag, const char[] format, an
char sign[MAX_NAME_LENGTH] = "ADMIN";
if (client != 0)
{
if (client < 0 || client > MaxClients || !IsClientConnected(client))
if (client < 0 || client > MaxClients || !IsClientInGame(client))
ThrowError("Client index %d is invalid", client);
GetClientName(client, name, sizeof(name));
@@ -629,17 +629,12 @@ stock bool TTT_IsClientValid(int client)
{
if (client > 0 && client <= MaxClients)
{
if (!IsClientConnected(client))
{
return false;
}
if (IsClientSourceTV(client))
if (!IsClientInGame(client))
{
return false;
}
if (!IsClientInGame(client))
if (IsClientSourceTV(client))
{
return false;
}
@@ -24,7 +24,7 @@ public Action Command_CheckGOTV(int client, int args)
{
for (int i = 1; i <= MaxClients; i++)
{
ReplyToCommand(client, "i: %d, Name: %N, IsFakeClient: %d, IsClientSourceTV: %d, IsClientConnected: %d, IsClientInGame: %d, IsPlayerAlive: %d", i, i, IsFakeClient(i), IsClientSourceTV(i), IsClientConnected(i), IsClientInGame(i), IsPlayerAlive(i));
ReplyToCommand(client, "i: %d, Name: %N, IsFakeClient: %d, IsClientSourceTV: %d, IsClientInGame: %d, IsPlayerAlive: %d", i, i, IsFakeClient(i), IsClientSourceTV(i), IsClientInGame(i), IsPlayerAlive(i));
}
}

0 comments on commit f5da352

Please sign in to comment.