Post: Code To Ban Player?
05-16-2015, 03:38 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); im working on a trickshot menu and i want ban player on it in case kids keep trying to come back in lobby.

i thought it was


//Ban Player
banplayer(player)
{
if (!(player isHost()))
{
ban(player getentitynumber());
self iPrintln("^2****** ^1Banned");
}
}

but it doesnt work
(adsbygoogle = window.adsbygoogle || []).push({});
05-16-2015, 05:47 PM #2
Loz
Vault dweller
Originally posted by xDemonicModding View Post
im working on a trickshot menu and i want ban player on it in case kids keep trying to come back in lobby.

i thought it was


//Ban Player
banplayer(player)
{
if (!(player isHost()))
{
ban(player getentitynumber());
self iPrintln("^2****** ^1Banned");
}
}

but it doesnt work


thats the right code & it does work, you must be calling without the player arg
05-16-2015, 05:53 PM #3
hmm idk i put that and added it and it shows it saying banned at the bottom when i do it but it doesnt ban the player or kick them
05-16-2015, 05:55 PM #4
oCmKs_4_LiFe
< ^ > < ^ >
self add_option("pOpt " + i, "Ban Player", ::banplayer, player);
05-16-2015, 11:41 PM #5
you have to kick him...
    
banplayer(player)
{
if (!(player isHost()))
{
ban(player getentitynumber());
kick(player GetEntityNumber());
self iPrintln(player.name + ": ^1Banned");
//wait .5;
//enter clients menu
}
else
{
self iPrintln("^1You Cannot Kick The Host");
}
}


if you're using sharks base use this

    
banPlayer(player)
{
if(verificationToNum(self.status) >= verificationToNum(player.status))
{
if (player isHost())
self iPrintln("You Cannot Ban The Host!");
else
{
ban(player getentitynumber());
kick(player GetEntityNumber());
wait 0.50;
self submenu(self.menu.previousmenu[self.menu.currentmenu]);
}
}
else
self iprintln("He Has " + player.status + ". You Cannot Ban Him!");
}

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo