1. Post #1
    InfernalCookie's Avatar
    December 2010
    700 Posts
    Is it possible with a module / hook to check when a banned player joins and print things to his console? Because I don't like how it says "Disconnected: You have been banned by the server!" and just kick you or something like that...

    I want to print to the player his ban reason and such... Am I going to have to make my own ban system to do so?

  2. Post #2
    SharpCoder's Avatar
    February 2012
    59 Posts
    Well if you are using the Player:Kick() method, there is an argument that lets you specify the kick reason. The output would be something like

    You have been disconnected by the server: "[Your reason would go here]"

     for k, v in pairs( player.GetAll() ) do
      v:Kick("For being on my server!");
     end
    

  3. Post #3
    pointblankrp
    TylerB's Avatar
    October 2011
    857 Posts
    Is it possible with a module / hook to check when a banned player joins and print things to his console? Because I don't like how it says "Disconnected: You have been banned by the server!" and just kick you or something like that...

    I want to print to the player his ban reason and such... Am I going to have to make my own ban system to do so?
    It's better to write your own ban system, using gatekeeper. That way you have total control over the disconnect message.

  4. Post #4
    We Are No Idiots
    Aide's Avatar
    March 2010
    4,661 Posts
    $5 I'll give you my code. Assuimg you ban via mysql if not I'll give you code to do so.
    Reply With Quote Edit / Delete Reply Windows 7 Show Events Dumb Dumb x 2Useful Useful x 1 (list)

  5. Post #5
    InfernalCookie's Avatar
    December 2010
    700 Posts
    check when a banned player joins and print things to his console?
    I already have gatekeeper and stuff. But I decided to make my own ban system, I'm doing fine other than the fact that for some reason it can't find "Length" in my table... I'll ask later if I need the help.

    Edited:

    Okay so I ran into a problem where I don't know how to remove the previous bans... Right now I have:

    ( Using tmysql )
    "CREATE TABLE Banned ( ID varchar(255), Length int, OSTime int, Reason varchar(255), Admin varchar(255), Server varchar(255) )"

    And each time it bans a player it adds 1 to the index. Now say ban 1 is over and should be unbanned, how would I remove that index? I know "DROP TABLE Banned" will remove the ENTIRE table, but how would I remove just the index from that table?

  6. Post #6
    SharpCoder's Avatar
    February 2012
    59 Posts
    Ah yes, good old SQL Syntax =P Can get confusing until you have used it enough. This should work:

    DELETE FROM Banned WHERE ID = 'IDHere'

    Here is a good place for figuring out all of the commands
    http://www.tizag.com/sqlTutorial/index.php
    Reply With Quote Edit / Delete Reply Windows 7 Show Events Lua Helper Lua Helper x 1 (list)

  7. Post #7
    InfernalCookie's Avatar
    December 2010
    700 Posts
    Oh thanks man! You are a life saver! :P
    Reply With Quote Edit / Delete Reply Windows 7 Show Events Friendly Friendly x 1 (list)