Author Topic: UQuiz - Server entry quiz.  (Read 4061 times)

0 Members and 1 Guest are viewing this topic.

Offline Sparrowhawk

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
UQuiz - Server entry quiz.
« on: February 28, 2008, 11:46:49 AM »
Hello everyone.  My friend and I run a build server called Builder's League (72.5.250.178:27016) and we were trying to think of ways to filter out people who are just complete morons, won't read our MOTD, just want to stick 10 thrusters with smoke on a chimney, etc etc.  We were thinking there might be some way to come up with a ULX plugin script that would ask new players questions, anything from grammar to stuff about gmod and if they don't get a certain amount right, it would kick them/ban them for a few hours, whatever.  Obviously I don't expect anyone here to come up with the questions themselves.  Also, I think it would be beneficial if it could keep track of who has already "passed" the test by steam ID so our regular users don't have to do it every time they join.  Thanks for listening to my idea.

Offline Avien

  • Full Member
  • ***
  • Posts: 168
  • Karma: 4
Re: UQuiz - Server entry quiz.
« Reply #1 on: February 28, 2008, 12:50:53 PM »
Why not just password your server, then post that password of gaming forums you visit?

It would be nice if these forums had a place to post community members server's info, so you know a good place to good.

Offline Sparrowhawk

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Re: UQuiz - Server entry quiz.
« Reply #2 on: February 28, 2008, 12:55:50 PM »
Why not just password your server, then post that password of gaming forums you visit?

It would be nice if these forums had a place to post community members server's info, so you know a good place to good.

Yeah, we've thought of pass wording the server, and obviously that would help, but we DO want the server to be completely open to non-idiot players.  We like meeting the new people who chance upon our server and have something cool to show to us.  Most of the time it's not a problem if one of us is there, since we can just ban the problem-player, but I just thought this was an interesting idea and wanted to post it.

Offline Chironex

  • Full Member
  • ***
  • Posts: 197
  • Karma: 11
  • Formerly known as Kyzer
Re: UQuiz - Server entry quiz.
« Reply #3 on: February 28, 2008, 01:03:05 PM »
I made somethign to avoid that,long time ago:

Created a new button on the MOTD, so 2 buttons, "I agree" and "I disagreee". I made it so people who click "I agree", are kicked. And somewhere at the end of the Motd i wrote a line saying 'Click "I disagree" to enter the server'. Believe me, it worked :D

Offline Sparrowhawk

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
Re: UQuiz - Server entry quiz.
« Reply #4 on: February 28, 2008, 01:14:29 PM »
I made somethign to avoid that,long time ago:

Created a new button on the MOTD, so 2 buttons, "I agree" and "I disagreee". I made it so people who click "I agree", are kicked. And somewhere at the end of the Motd i wrote a line saying 'Click "I disagree" to enter the server'. Believe me, it worked :D

That's a great idea actually, but unfortunately I'm an LUA noob.  If there's somewhere on these forums I could go to get code for that, we'll probably change it to that.  Or if you could help me out with the code that'd be great.  I've found the block int he motd module where it's creating a button, but I don't wanna go modifying it without knowing what I'm doing.  Thanks again, Kyzer.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Re: UQuiz - Server entry quiz.
« Reply #5 on: February 28, 2008, 01:23:16 PM »
It would be nice if these forums had a place to post community members server's info, so you know a good place to good.

Your wish is my command! *poof*
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: UQuiz - Server entry quiz.
« Reply #6 on: February 28, 2008, 03:48:34 PM »
Great idea Sparrowhawk (even if you didn't know you were suggesting that forum to us individually, I liked the spark it lit. Nice execution Megiddo)

As for the code, you did better than most to find where the button code is.  ;D
Want to try to learn/tinker with lua? Let me give some hints.
Just install ULib/ULX on your client game, play singleplayer. No harm done to server that way. :)
Code: [Select]
local button = vgui.Create( "DButton", window )
button:SetText( "Close" )
button.DoClick = function() window:Close() end
button:SetSize( 100, 40 )
button:SetPos( (window:GetWide() - button:GetWide()) / 2, window:GetTall() - button:GetTall() - 10 )

You would need to duplicate that, changing the second portion of code to local variable button2 (just to keep the name easy)
Set text is obvious. Change original button variable portion "Close" to "I disagree", and button2 block code to "I accept")
button2:DoClick ... hmm, that is where I would have to tinker myself (and don't have time really right now.
try
 function() window:Close(); Msg("*** You didn't follow directions in the MOTD ***"); RunConsoleCommand("disconnect"); end
Leave size the same
button:SetPos and button2:SetPos - Figure out the math to do thirds for the buttons along bottom. I look at the math in that and remember my typing classes (yes, pre 'keyboarding' in school) and can see its similiar to centering currently. 1/3rd for button and 2/3rds for button2.

Have fun learning

"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming