Results 1 to 10 of 56

Thread: Hardware bans

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #18
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    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.
    Last edited by guiismiti; 5th January 2014 at 02:06.
    set logfile 2

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •