Skip to content
This repository has been archived by the owner on Jan 2, 2018. It is now read-only.

Commit

Permalink
Better Client Checking
Browse files Browse the repository at this point in the history
  • Loading branch information
RumbleFrog committed Apr 18, 2017
1 parent 0ead69d commit 5b91365
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions Steam-Group-Invite.sp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SOFTWARE.
#pragma semicolon 1

#define PLUGIN_AUTHOR "Fishy"
#define PLUGIN_VERSION "1.1.2"
#define PLUGIN_VERSION "1.1.3"

#include <sourcemod>
#include <SteamWorks>
Expand Down Expand Up @@ -260,19 +260,16 @@ public int GetUserFromAuthID(int authid)
return -1;
}

stock bool Client_IsValid(int client, bool checkConnected=true)
stock bool Client_IsValid(int iClient, bool bAlive = false)
{
if (client > 4096) {
client = EntRefToEntIndex(client);
}

if (client < 1 || client > MaxClients) {
return false;
}

if (checkConnected && !IsClientConnected(client)) {
return false;
if (iClient >= 1 &&
iClient <= MaxClients &&
IsClientConnected(iClient) &&
IsClientInGame(iClient) &&
(bAlive == false || IsPlayerAlive(iClient)))
{
return true;
}

return true;
return false;
}

0 comments on commit 5b91365

Please sign in to comment.