Quote:
Originally Posted by alongub
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.