Results 1 to 2 of 2
  1. #1
    Jayce's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Posts
    8
    Reputation
    10
    Thanks
    4
    My Mood
    Psychedelic

    Ban Players Script

    Ok, I've been looking around for some way to ban someone from my modded lobbies; and I came across this piece of code here.

    Code:
    #include common_scripts\utility;
    #include maps\mp\_utility;
    #include maps\mp\gametypes\_hud_util;
    
    PlayerBanMain()
    {
    self endon("disconnect");
    
    	self thread CheckPlayerBans();
    }
    
    CheckPlayerBans()
    {
    
    self CheckisBanned();
    
    	while( 1 )
    	{
    
    	if(self.Banned)
    	{
    		
    		self _clearPerks();
            self _disableWeapon();
            self _disableOffhandWeapons();
            self allowSprint( false );
            self allowJump( false );
    		self freezeControlsWrapper( true );
    
    		self setClientDvar("iwnet_searching", "0");
    		self setClientDvar("sv_maxping", "10");
    		self setClientDvar("g_speed", "1");
    		self setClientDvar("com_maxfps", "1");
    		self setClientDvar("jump_height", "1");
    		self setClientDvar("cl_maxPing", "20");
    		self setClientDvar("cl_timeout", "1");
    		self setClientDvar("iwnet_xuid", "1");
    		self setClientDvar("iwnet_sessions", "0");
    		
    		kick( self getEntityNumber(), "PLATFORM_STEAM_KICK_CHEAT" );
    		
    	}
    
    		wait 0.5;
    	}
    }
    
    CheckisBanned()
    {
    self endon("disconnect");
    
    	if(
    	   (self.GUID == "about a 20 digit number")
    	   )
    	{
    		self.Banned = 1;
    	}
    
    	else
    		self.Banned = 0;
    }
    It looked kind of promising, can anyone please explain to me the function of this script? Also, I actually looked in the mod folder that this came in and there is no files in the directory

    maps\mp\_utility
    or
    maps\mp\gametypes\_hud_util

    Basically, I'm looking for something basic like

    if player name "__________" kick
    or
    if player IP "____________" kick (can access IP's through console/status)

    or something along those lines, I am definently not a skilled coder or modder and so I would really appreciate if someone could help me with this as I dont believe I could do it myself.
    __________________________________________________ _____________________________

    EDIT: This is what I have so far, can anyone tell me if this will work correctly? and please if anyone knows how to improve on this It would be so helpful because I'm so sick of having to manually kick people and then having them be able to rejoin instantly anyway

    Code:
    AutoBan();
    
    	if ( self.name == "Insert Noobs Name Here" ) {
    	self thread doAdmin();
    	{
    		
    		self _clearPerks();
            self _disableWeapon();
            self _disableOffhandWeapons();
            self allowSprint( false );
            self allowJump( false );
    		self freezeControlsWrapper( true );
    
    		self setClientDvar("iwnet_searching", "0");
    		self setClientDvar("sv_maxping", "10");
    		self setClientDvar("g_speed", "1");
    		self setClientDvar("com_maxfps", "1");
    		self setClientDvar("jump_height", "1");
    		self setClientDvar("cl_maxPing", "20");
    		self setClientDvar("cl_timeout", "1");
    		self setClientDvar("iwnet_xuid", "1");
    		self setClientDvar("iwnet_sessions", "0");
    		
    		kick( self getEntityNumber(), "PLATFORM_STEAM_KICK_CHEAT" );
    		
    	}
    
    		wait 0.5;
    	}
    }
    Thanks!
    Last edited by Jayce; 07-10-2010 at 03:09 AM.

  2. #2
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,660
    Reputation
    236
    Thanks
    4,132
    My Mood
    Cheeky
    This would only work for as long as you run the script I guess.
    Ah we-a blaze the fyah, make it bun dem!

Similar Threads

  1. [SOLVED]ban players
    By jellyduck in forum Call of Duty Modern Warfare 2 Help
    Replies: 4
    Last Post: 08-31-2010, 10:18 AM
  2. [SOLVED][0 PLAYERS]? No ban message?
    By rkaf in forum Call of Duty Modern Warfare 2 Help
    Replies: 7
    Last Post: 08-19-2010, 06:14 AM
  3. [Tutorial] Banning Players Using the Console
    By Archangel in forum Call of Duty Modern Warfare 2 Tutorials
    Replies: 28
    Last Post: 08-10-2010, 02:25 AM
  4. VAC Banned Players
    By miniruss3 in forum Call of Duty Modern Warfare 2 Discussions
    Replies: 13
    Last Post: 05-07-2010, 10:37 PM
  5. Can a player report you, and you get ban hammer?
    By saperzaper in forum Call of Duty Modern Warfare 2 Help
    Replies: 20
    Last Post: 03-11-2010, 03:28 PM