ULX

Author Topic: Name Checker/Kick  (Read 8965 times)

0 Members and 1 Guest are viewing this topic.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Name Checker/Kick
« Reply #15 on: October 08, 2013, 09:10:34 AM »
Happy to help another member around these forums.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Name Checker/Kick
« Reply #16 on: October 08, 2013, 02:00:13 PM »
So I tried adding ulx.asay, but I couldn't get it to work with this. I don't really understand the "calling_ply" part of it. I know that's whoever uses the command to say something in admin chat, but I can't get it to work with the kick thing. Any help with that?
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Name Checker/Kick
« Reply #17 on: October 08, 2013, 05:12:29 PM »
You could just do this.

Code: [Select]
for _, a in pairs( player.GetAll() ) do
if a:query( "ulx seeasay" ) then
ULib.tsay( a, "Autokicked player: " .. ply:Nick() .. "  for having the string (" .. v .. ") in their name." )
end
end

This will send a message to all connected admins who can see asay messages when a player gets kicked for having a restricted string in their name.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Name Checker/Kick
« Reply #18 on: October 08, 2013, 05:46:23 PM »
Thanks, MrP.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Name Checker/Kick
« Reply #19 on: October 08, 2013, 07:34:02 PM »
I forgot (Garry?)Gmod stopped allowing name changes in game using server console.
Or was that all Source servers, and Valve tied it into Steam only?

Which makes me think .. aloud even.
What about something that would set a global server variable ply:fakename = <name input using some console command>.
Then something like
OldNick = Nick()
function Nick(ply)
   return ply:fakenick
end

I've overridden Gmod functions before, quite a bit rusty as to if it can still be done and best way though.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: Name Checker/Kick
« Reply #20 on: October 08, 2013, 09:04:04 PM »
Yeah, you could override the ply:Nick function if you wanted to. This would essentially allow a server to change a players name with enough work-arounds.

garry's reasoning for not allowing it is that he said server coders (more so for gamemodes) should write custom names into their gamemodes and stop relying on forcing a client to change their name.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Name Checker/Kick
« Reply #21 on: October 09, 2013, 04:51:52 PM »
That is probably not needed for my use. Since it's on a TTT server, one of the points is to actually keep the name so people know who to look for if you're called out after doing something (which is why the gamemode has a "name change kicker" just in general, only, we don't use that).

Thanks for the tip, I might actually use it for something else that is just for "fun".
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline laznz1

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Re: Name Checker/Kick
« Reply #22 on: November 05, 2013, 04:42:36 PM »
Hey Decicus, any chance you can re-upload the LUA file to your drop box seems to be broken.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Name Checker/Kick
« Reply #23 on: November 05, 2013, 10:38:39 PM »
Sorry about that, must've been because I moved it into a different folder, here's a new link: https://www.dropbox.com/s/ny96shfg5adnq8t/bnk.lua
Also attached it, just in case.
« Last Edit: December 16, 2013, 10:49:40 AM by Decicus »
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline Eccid

  • Full Member
  • ***
  • Posts: 115
  • Karma: 11
  • Hey, come on... We just met...
    • Terror Abound! Steam Group
Re: Name Checker/Kick
« Reply #24 on: December 09, 2013, 09:32:12 AM »
Thank you for this. I don't have a family friendly server, but we are very strict about the use of racial or sexist slurs on my server. I set this up to instantly ban people with specific words in their name. Thank you so much :)

Offline Storm

  • Full Member
  • ***
  • Posts: 220
  • Karma: 4
Re: Name Checker/Kick
« Reply #25 on: December 09, 2013, 09:41:19 AM »
I have been using this since Oct when it was done and it has been fantastic! Works perfectly everytime. Just a warning though - I get a lot of players advertising by using links as their name so I put as an exclusions www. and .com. The addon doesnt recognize non-alpha characters so I wound up kicking everyone with com or www in their name!

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Name Checker/Kick
« Reply #26 on: December 09, 2013, 10:55:43 AM »
Sorry Storm. I'm not really familiar with the string library, so I'm not sure how it really works with the non-alphanumeric characters. Although, someone else (*cough* Mr. P? *cough*) might be able to help you out.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given