https://forums.alliedmods.net/showthread.php?t=321089#9
GetClientUserId to store a clients userid (each new client connecting has a userid + 1 to the last person who joined).
GetClientOfUserId to retrieve a clients index from userid, if they have disconnected the value will be 0. Must use with IsClientInGame too.
EntIndexToEntRef to store an entity index by converting it into a unique serial reference.
EntRefToEntIndex to retrieve an entity index from a reference, if the entity no longer exists the value will be -1 (INVALID_ENT_REFERENCE).
CreateTimer(10.0, XXX, GetClientUserId(client));
public Action XXX(Handle timer, any client)
{
client = GetClientOfUserId(client);
if( client != 0 && IsClientInGame(client) )
{
......
}
}