Post: Glitchy Ban Player Code
02-24-2016, 05:54 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Hello, I need help fixing this code, Idk what is wrong with it


    banPlayer(player)
{

ban(player GetEntityNumber());
wait 0.50;
self submenu(self.Menu.System["MenuPrevious"][Menu][self.Menu["Current"]]);
}



This is all correct right?

When I get into a game online hosting it and i hover on someone in my clients menu and click their name then click ban player it does one of 2 things randomly Even when my code had a host check in it, so i removed it to the code above and it does the same exact thing.

1.It will try to kick me and it says "Cannot kick the Host Player".
2.Bans/Kicks a Random person in the game that I wasn't even on in my clients menu.


What's the cause of this?
(adsbygoogle = window.adsbygoogle || []).push({});
02-24-2016, 10:50 PM #2
BullyWiiPlaza
Climbing up the ladder
You shouldn't use the
    ban()
function since it doesn't work but instead I have the following:
    banPlayer(bannedPlayer)
{
bannedPlayerName = bannedPlayer.name;
self iPrintln("^1" + bannedPlayerName + " has been banned");
kickOut(bannedPlayer);

while(true)
{
level waittill("connecting", player);

if(player.name == bannedPlayerName)
{
kickOut(player);
}
}
}

kickOut(player)
{
kick(player getEntityNumber());
playKickedLeaderDialog();
}

playKickedLeaderDialog()
{
level thread maps\mp\gametypes\_globallogic_audio::leaderDialog("kicked");
}

This bans the player from re-joining as long as the match lasts. If you start another round or map it will be disabled again.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo