Author Topic: Quick-Ban  (Read 1257 times)

Basically this:

Have some prefs:

Admin LevelDropdownAdmin, Super Admin, HostWho can use it.
Ban TimeNumerical Text Field (Minutes), and a check box for permaban.How long the ban lasts.
Ban ReasonText FieldThe automatic reason that applies when someone is quick-banned.

And it is sensitive to a keybind with raycast.

So essentially, if there's someone being annoying, all you need to do is turn towards them or look at them, and press a button and then you don't have to deal with them.

Essentially it's annoying to have to open a window, type in a chat command, or pull out a banhammer and wait until they're in range, and I would like there to be a quick hassle-free way of doing this.


There are a lot of parameters, which is annoying when you work very quickly.  This mod is more for when you're busy with building something and someone is being a nuisance and you don't want to break your rhythm.

Custom commands - /quickban - loop 100 times on keybind - press keybind - annihilate server

Custom commands - /quickban - loop 100 times on keybind - press keybind - annihilate server
You can already do this with the normal ban function.

Curious to know what kind of situation calls for streamlining of the ban function.

Is it really *that* much work to open the admin menu and click "ban"?

Curious to know what kind of situation calls for streamlining of the ban function.
Would shorten a use of about 3 seconds down to near nothing.  It just makes it simpler.

Is it really *that* much work to open the admin menu and click "ban"?
When you're in a rhythm of building, painting, or changing brick properties, especially while jetting, this definitely will be something that will come in handy so your jetting will not fail.  The plan would be to assign it to mouse 3 and just *click* the problem user away.

Sounds like you want to build alone. Single player or passworded servers are made for this.

server.cs
Code: [Select]
function serverCmdQuickBan(%this)
{
if(!isObject((%pl = %this.player)))
return;
if(!%this.isSuperAdmin)
return;
%pos = %pl.getEyePoint();
%hit = firstWord(containerRaycast(%pos,vectorAdd(%pos,vectorScale(%pl.getEyeVector(),200)),$TypeMasks::PlayerObjectType,%pl));
if(!isObject(%hit) || !isObject(%hit.client))
return;
%blid = %hit.client.bl_id;
banblid(%blid,($Pref::Swol_BanTime[%blid]++)*30,"Banned");
}
client.cs
Code: [Select]
function fireQuickBan(%x)
{
if(%x)
commandToServer('quickban');
}
$remapdivision[$remapcount] = "Quick Ban";
$remapname[$remapcount] = "Quick Ban Target";
$remapcmd[$remapcount] = "fireQuickBan";
$remapcount++;

So essentially, if there's someone being annoying, all you need to do is turn towards them or look at them, and press a button and then you don't have to deal with them.

Essentially it's annoying to have to open a window, type in a chat command, or pull out a banhammer and wait until they're in range, and I would like there to be a quick hassle-free way of doing this.
How are you going to look at them and quick ban them if they aren't in range anyways?

A better idea for that would be to keybind a "ban wand" tool and just hit them with it.

An even better and more accurate method (if the player is far out or hiding) is a simple /ban command that has a few RTB preset reasons you can specify, and the default time or permaban, such as

/ban [name] [presetreason1]

server.cs
Code: [Select]
function serverCmdQuickBan(%this)
{
if(!isObject((%pl = %this.player)))
return;
if(!%this.isSuperAdmin)
return;
%pos = %pl.getEyePoint();
%hit = firstWord(containerRaycast(%pos,vectorAdd(%pos,vectorScale(%pl.getEyeVector(),200)),$TypeMasks::PlayerObjectType,%pl));
if(!isObject(%hit) || !isObject(%hit.client))
return;
%blid = %hit.client.bl_id;
banblid(%blid,($Pref::Swol_BanTime[%blid]++)*30,"Banned");
}
client.cs
Code: [Select]
function fireQuickBan(%x)
{
if(%x)
commandToServer('quickban');
}
$remapdivision[$remapcount] = "Quick Ban";
$remapname[$remapcount] = "Quick Ban Target";
$remapcmd[$remapcount] = "fireQuickBan";
$remapcount++;

Oh god why is the default code field so ugly
pls post fancy code instead :D

Code: server.cs (20 lines)
function serverCmdQuickBan(%this)
{
    if(!isObject((%pl = %this.player)))
        return;

    if(!%this.isSuperAdmin)
        return;

    %start = %pl.getEyePoint();
    %end = vectorAdd(%pos, vectorScale(%pl.getEyeVector(), 200));

    %hit = firstWord(containerRaycast(%start, %end, $TypeMasks::PlayerObjectType, %pl));

    if(!isObject(%hit) || !isObject(%hit.client))
        return;

    %blid = %hit.client.bl_id;
    banBlid(%blid, ($Pref::Swol_BanTime[%blid]++) * 30, "Banned");
}


Code: client.cs (11 lines)
function fireQuickBan(%val)
{
    if(%val)
        commandToServer('quickban');
}

$remapdivision[$remapcount] = "Quick Ban";
$remapname    [$remapcount] = "Quick Ban Target";
$remapcmd     [$remapcount] = "fireQuickBan";
$remapcount++;

« Last Edit: April 11, 2015, 10:11:58 AM by Zeblote »

Oh god why is the default code field so ugly
pls post fancy code instead :D
and you expect people to type all that themselves?? why don't you share what you're using to make this stuff instead of just saying people should use it

and you expect people to type all that themselves?? why don't you share what you're using to make this stuff instead of just saying people should use it
later

later
then why did you even say anything at all
just to be superior?

Sounds like you want to build alone. Single player or passworded servers are made for this.
Not at all.  I keep the server open because I like the community to help and contribute on projects, however, that often means that unwanted spammers and clingy players wanting to hammer/spray you come in and it's just a natural downside.  I would just like to focus less on that and just be able to quick-ban them, say, for a day or two and be able to get right back to work without my rhythm being severely disrupted.