summaryrefslogtreecommitdiff
path: root/sourcemod/scripting/include/gamechaos/isvalidclient.inc
diff options
context:
space:
mode:
Diffstat (limited to 'sourcemod/scripting/include/gamechaos/isvalidclient.inc')
-rw-r--r--sourcemod/scripting/include/gamechaos/isvalidclient.inc16
1 files changed, 16 insertions, 0 deletions
diff --git a/sourcemod/scripting/include/gamechaos/isvalidclient.inc b/sourcemod/scripting/include/gamechaos/isvalidclient.inc
new file mode 100644
index 0000000..bf80246
--- /dev/null
+++ b/sourcemod/scripting/include/gamechaos/isvalidclient.inc
@@ -0,0 +1,16 @@
+
+#if defined _gamechaos_isvalidclient_client_included
+ #endinput
+#endif
+#define _gamechaos_isvalidclient_client_included
+
+/**
+ * Checks if a client is valid.
+ *
+ * @param client Client index.
+ * @return True if valid, false otherwise.
+ */
+stock bool IsValidClient(int client)
+{
+ return (client >= 0 && client <= MaxClients && IsValidEntity(client) && IsClientConnected(client) && IsClientInGame(client));
+} \ No newline at end of file