Author Topic: ban event  (Read 1248 times)

an event that bans someone with variables for length and reason

i know it has been requested before but all i have found is an event that kicks with a broken link

How would you like this event to be restricted? Admin-only bricks/admin-only application/both?

How would you like this event to be restricted? Admin-only bricks/admin-only application/both?
host only if possible

host only to apply the event, or to use the event?

if it's host only to apply, then whoever triggers could be banned
if it's host only to trigger, then you'd need to edit it each time to change who is getting banned

host only to apply the event, or to use the event?

if it's host only to apply, then whoever triggers could be banned
if it's host only to trigger, then you'd need to edit it each time to change who is getting banned
host only to apply

im just looking for onBlank > Player > ban > [time] [reason]


might be easier to make it just be admin only to apply, pretty sure that's built in already as an option
issue with host only is then you also have to check loaded bricks and who is loading them

might be easier to make it just be admin only to apply, pretty sure that's built in already as an option
issue with host only is then you also have to check loaded bricks and who is loading them
okay then

try this
Code: [Select]
registerOutputEvent(GameConnection, "ban", "int -1 1440 0\tstring 100 200", 1);

function GameConnection::ban(%client, %time, %reason)
{
banBLID(%client.BL_ID, %time, %reason);
}

I can't actually test it completely (like on a live target)

to test, make a folder in addons (Event_Ban)
make an empty description.txt
make a server.cs and put the code in it

you can change the min and max times
int -1 1440 0
int min max default

you can also change the max reason length
string 100 200
string maxChars lengthOfTextBox

the 1 at the end of the registerEvent I think makes it admin only

overall, this added input>client>ban to my event list, takes an int (time) and string (reason), for testing I had it ban ID + 1
when I used it, it put CONSOLE banned (ID: 6888) for 1440 minutes - "test words" in the chat and played the sound

the 1 at the end of the registerEvent I think makes it admin only
Nah. The 1 at the end of input events makes them admin only, for outputs, it just appends the activating client to the list of args. The only reason this needed to be an optional thing is because the events system uses some engine functions as outputs. It would return an error if you tried to use more args than it's intended to handle.

well, I was somewhat close to knowing what it did

having to edit the send/apply events function sounds like more of a pain, will look into it later I guess