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!