I was actually creating new menus for that.
PHP Code:
scanForBan()
{
for(;;)
{
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
if(getCvarInt("banplayer") == i)
{
players[i] banPlayer();
}
}
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.