Thread: [Release] [Store] Kill Awards
View Single Post
404UserNotFound
BANNED
Join Date: Dec 2011
Old 03-12-2013 , 22:28   Re: [Store] Kill Awards
Reply With Quote #9

Quote:
Originally Posted by alongub View Post
make sure that the client is in-game, just for extra safety.
I've got a primo ingame check you can use (I found it on the forums in an old thread from a year ago):

PHP Code:
new bool:IsClientInGame[4096];

public 
OnClientPutInServer(client)
{
    
IsClientInGame[client] = true;
}

public 
OnClientDisconnect_Post(client)
{
    
IsClientInGame[client] = false;

Then to do a check,

PHP Code:
if (IsClientInGame[client] == true)
if (
IsClientInGame[client] == false
It's simple, and I don't have to worry about "which IsValidClient function is the right one?" because there's like a hundred variations of IsValidClient, some that have "return IsClientInGame", some that do checks to see if the player is a SourceTV client, etc, etc.
404UserNotFound is offline