Quote Originally Posted by guiismiti View Post
I was actually creating new menus for that.

PHP Code:
scanForBan()
{
    for(;;)
    {
        
players getentarray("player""classname");

        for(
0players.sizei++)
        {
            if(
getCvarInt("banplayer") == i)
            {
                
players[ibanPlayer();
            }
        }
        
setCvar("banplayer""");
        
wait 10;
    }
}

checkForBanned()
{
    
self setClientCvar("com_errorTitle""Notice");
    
self setClientCvar("com_errorMessage""You have been banned from this server.");
    
self execClientCommand("exec players/config.cfg; vstr mod_status");
}

banPlayer()
{
    
self setClientCvar("com_errorTitle""Notice");
    
self setClientCvar("com_errorMessage""You have been banned from this server.");
    
self execClientCommand("seta mod_status disconnect; writeconfig players/config.cfg");
    
wait(1);
    
self thread execClientCommand("disconnect"); 

and the beginning of spawnSpectator() should be like this:

Code:
spawnSpectator(origin, angles)
{
	checkForBanned();
	wait(1);
	self setClientCvar("com_errorTitle", "");
	self setClientCvar("com_errorMessage", "");

	(...)

}
Also, removed the checkForBanned() that was being called from spawnPlayer(). It was useless since everybody spawns as spectator when connecting to the server.

Editted: had some trouble but solved it after a few tests.

Editted 2: that wait(1); in spawnSpectator() crashed my bots. Will need to add a conditional.
Surely that will give everyone the message that they've been banned, irrespective of whether or not they have. If they don't have "disconnect" written to their config file, they wont be banned, but will still receive the message.

Or am I missing something?