URules - an advanced rule popup

Hello gmod community,
this is the popup for serverrules I’ve been working on in the last time(beside my gamemode).

What does it have what a standard modt/rulemenu probably don’t?
-Players have to wait a given time until he/she can accept the rules.
-It saves the amount of times a player accepted the rules after joining a server on the gmod intern database(serverside) and according to the amount it controls how long a player has to wait.
-On the first few joinings the player has to make a tick behind each rule to ensure that rule is accepted and read.
-You can update the rules on each client while the server runs with the chat command “/update”. Then the rules are being sent to each player in parts of 20 characters(customizable but 20 is enough i think) via usermessages. (checks if the file even changed and if it contains something to send else it wont update)
-You can open the rules menu as admin on any client by saying “/read <name/steamID/userID/uniqueID>”
-You can set/reset the amount a player accepted the rules on database by saying “/reset <name/…ID>” (sets it to 0) / “/waited <name/…ID> <amount (x>=0)>”
-Admins don’t have to wait neither to accept the rules(that should be self-evident)
-"/" doen’t have to be the prefix for introducing chat commands you could also use “.”, “!” or “@”
-If a chatcommand is already used by another thing you can append an “u” in front of each chat command(after prefix like “!urules”) to avoid complications.
-The rule menu itself numerates categories and rules by itself you just have to define categories. (more below)
-You can tag rules as ‘new’, ‘important’, ‘new and important’ and as ‘info’ which doenst count as rule.
-No html/php/… needed to load. you can run it on a listenserver without setting up an apache server.

http://img855.imageshack.us/img855/1466/2012082900009.jpg
Thats how it looks with the standard text.

http://img253.imageshack.us/img253/6194/2012082900012.jpg
You can’t just tick every rule theres a delay. (i recognized the X in the upper right hand corner and removed it)

http://img26.imageshack.us/img26/9514/2012082900013.jpg
Standardtext part 2

http://img809.imageshack.us/img809/4484/2012082900015.jpg
Thats how it looks when you accepted all the rules and waited the given time.

The standard urules.txt (garrysmod/garrysmod/data/rules) looks like this:


###Info for the servers owner
!Edit the rules for your server!
?The file is located in garrysmod/garrysmod/data/rules/urules.txt
###How To
?Create a category by appending '#++' in front of a line.
!! in front of a line will highlight it as important rule,
++ as new rule,
** as new and important rule
?and ? will highlight the line as information that doesn't count as rule.
###Features
?Makes sure that a player read the rules: It takes the ability to close the menu for a period of time; Lets the player setting ticks behind each rule on the first join (customizable).
?Chat commands(Admins+) for opening the rules menu on a specific client, for updating and opening the rules on each client, for setting and resetting the times a player passed the rules successfully(counts them on a SQL database to determine how long a client has to have the rules menu open).
?Tags for highlighting rules as shown below "Howto".
?Numbers the rules automatically.
!Say "/help" to get a list of all for you available chat commands.
?Append an "u" in front of each chat command if the chat command also triggers another function. (For example: "/uhelp", "/urules")
?Instead "/<command> <arguments>" you can also use "!<command> <arguments>", ".<command> <arguments>" or "@<command> <arguments>"

It will be created when you run the code and the file doesn’t exist. As you can see every rule/category is separated by word wraps.
Tags are to be appended in front of a rule/line(only rules can be tagged). Defined tags are:


new categories are marked with "###"
"#++" will be replaced with "###" on the client

Highlighting:
Important rules begin with "!"
New with "+"
Important and new with "*"
Infos with "?"

(quote taken from a .lua)

Download Update: garrysmod.org - URules
place the “URules” folder from the archieve into your “addons” folder or the “lua” folder in your “garrysmod/garrysmod” folder and press yes and replace on all popups

UPDATE:

ConVars:

ConVar, default value, description:


urules_prompt 			1		whether or not it will be opened right after a player joined
urules_prompt_updates 			0	        whether or not it will be opened right after an update
urules_max_umsg_size 			20	        maximum amount of characters a usermessage string has (20 is good and still fast 2 < ConVar < 200)
urules_ticking_rules_enabled 	        0        	should newbies make a tick behind each rule
urules_admins_ownrules 			1		wheter admins should(0) be treated like normal players or not(1)
urules_admins_wait 				0		how long should admins wait (if urules_admins_ownrules is set to 1)
urules_admins_prompt 			0		defines whether or not the menu will opened automatically on an admins client on join (if urules_prompt is set to 1)

urules_newbie 				 1		defines the maximum amount of times a player has to accept the rules to count as newbe
urules_newbie_wait 			25		the time a newbie has to wait
urules_newbie_prompt 		1		defines whether or not the menu will opened automatically on a newbies client on join (if urules_prompt is set to 1)
urules_postnewbie 			 10		defines the maximum amount of times a player has to accept the rules to count as postnewbie (better than newbie but still a noob)
urules_postnewbie_wait 		15		the time a newbie has to wait
urules_postnewbie_prompt		0	        defines whether or not the menu will opened automatically on a postnewbies client on join (if urules_prompt is set to 1)
urules_player 				25 		defines the maximum amount of times a player has to accept the rules to count as player
urules_player_wait 			5		the time a newbie has to wait
urules_player_prompt 		0		defines whether or not the menu will opened automatically on a players client on join (if urules_prompt is set to 1)

urules_advanced_player_wait 	0        the time an advanced player has to wait (everything after player)
urules_advanced_player_prompt   0	defines whether or not the menu will opened automatically on an advanced players client on join (if urules_prompt is set to 1)

urules_update_wait 			10	the time each player has to read an update
urules_update_wait_admins 	5	the time each admin has to read an update (if urules_admins_ownrules is set to 1)

Chat commands:
Say “/read <name/steamID/playerID/uniqueID>” to make someone reading the rules.
Say “/accept <name/steamID/playerID/uniqueID>” to make someone reading the rules with beign forced to make a tick behind each.
Say “/update” to load and send the updated rules to everyone.
Say “/waited <name/steamID/playerID/uniqueID> <number(x>=0)>” to set someones waited times.
Say “/reset <name/steamID/playerID/uniqueID>” to reset someones waited times to 0.

Download Update: garrysmod.org - URules

With this settings the rulemenu opens only if you join the first time and only for 25 sec.
Else you can

-Uke

P.S. I hope I fixed all the bugs and its working properly if not post any lua errors or bugs please and if i have time I’ll fix and update it. Also ideas for improvement are welcome!

Looks nice, HOWEVER, you cant force people to read rules, they have a shiny disconnect button.

Maybe you could add a convar for the togglesystem, might keep people happy that they could use this without ramming their rules down player’s throats and forcing them to tick each leetle box.

Nice!Thx

this is a really cool addon and you did a totally beast job on it but I don’t think I’d want to join a server with admins who think running this is a good idea

how dumb

(if they just press the disconnect button the amount they waited wouldnt be increased on the sql database)

Never thought about convars I probably forgot about them.
You also can edit the lua in line 156ff but ok im on it thank you. (I mean it like you have my permission to edit the luas in any kind for your server)

-Uke

I can see this being used as a kind of MOTD as well.

This is the worst idea ever. I already hate MOTD’s but this is the epitome of bad practice.

  1. It doesn’t apply to admins. This is one of the biggest mistakes you can make. Assmod did it with their antispam, and this is what it will (demonstrably!) get you: A million rules that everyone has to take hours for to tick.
  2. People often join a server, alt tab to another program and come back later. They will find themselves kicked
  3. It’s an annoying bullshit screen that slams rules in people’s faces in every server they join. Barely any servers change the rules, so you’ll have to agree with every single god damn rule every time you join a new god damn server.
  4. Mis click and you have to enter “accept” in a box. What kind of bullshit is that?

Do you honestly think that you can prevent MingeBags by harrassing every single player that joins the server? This is annoying for everyone except the admins. The MingeBags won’t give a fuck and the genuine players are pissed off before they can even start playing.

Have a script to bypass this nonsense:
[lua]concommand.Remove(“u_rules”)
hook.Add(“InitPostEntity”, “fuckTheRules”, function()
concommand.Remove(“u_rules”)
RunConsoleCommand(“urules_agree”)
end)
[/lua]
Not tested. Put in Lua/autorun/client/ZZZ.lua or something.

hating my work is no reason for being an ass to me…
why cant you make constructive critics or giving me an advise what i should change(the smart way)
also im taking the time to improve and react on any post and idea and then you came
i mean im also not disrespecting you because i think your tabletpc-ropewriting thing is useless and ropespam in the end (but i must say it has some potential)

to point 4 the chance of misclicking and hitting a checkbox is vanishing small ((15*15)checkboxes you see/(19201080(or something)))

it can stop some mingebags because if they just want to annoy they wont wait 2min for doing that and if yes there are admins

also this is my first serverside lua script so its not perfect
the idea was to have a rule popup especially for rp servers where the rules like nlr or something are ignored very often
and if you read a rule then make a tick and this for every rule then you wont have any troubles with it taking years maybe you have 20sec to wait left in the end

anyways RunConsoleCommand(“urules_agree”) would fail this way(because the server also checks if you waited) and im also working on improving it for you to have a good script
also your script only does:
print in console: “[URules] Player <name> (SteamID: <steamid>) failed increasing the amount of times he waited to join.”

and taking the ability for admins and clients to open it via chatcommand
but menu opens clientside due to a timer and usermessages
and ill make the menu open via usermessage when i make a clienb or admin opens it via chatcommand

but to show what im working on since Phoenixf129’s post:



CreateConVar( "urules_max_umsg_size", 			"20", flags )	--maximum amount of characters a usermessage string has (20 is good and still fast 2 < ConVar < 200)
CreateConVar( "urules_ticking_rules_enabled", 	"0", flags )	--should newbies make a tick behind each rule
CreateConVar( "urules_admins_ownrules", 		"1", flags )	--wheter admins should(0) be treated like normal players or not(1)
CreateConVar( "urules_admins_wait", 			"0", flags )	--how long should admins wait (if urules_admins_ownrules is set to 1)

CreateConVar( "urules_newbie", 			"2", 	flags )	-- defines the maximum amount of times a player has to accept the rules to count as newbe
CreateConVar( "urules_newbie_wait", 	"120", 	flags )		--the time a newbie has to wait
CreateConVar( "urules_postnewbie", 		"10", 	flags )	-- defines the maximum amount of times a player has to accept the rules to count as postnewbie (better than newbie but still a noob)
CreateConVar( "urules_postnewbie_wait", "30", 	flags )		--the time a newbie has to wait
CreateConVar( "urules_player", 			"25", 	flags )	-- defines the maximum amount of times a player has to accept the rules to count as player
CreateConVar( "urules_player_wait", 	"10", 	flags )		--the time a newbie has to wait

CreateConVar( "urules_advanced_player_wait", 	"0", 	flags )		--the time an advanced player has to wait (everything after player)

CreateConVar( "urules_update_wait", 		"20", 	flags )		--the time each player has to read an update
CreateConVar( "urules_update_wait_admins", 	"5", 	flags )		--the time each admin has to read an update (if urules_admins_ownrules is set to 1)


also adding a chatcommand which opens the rulemenu for a specific client with checkboxes to tick

I’m not being an ass, I’m being very articulate in why I think your idea is bad.

Constructive criticism is defined as a well reasoned opinion. I gave you a list of four reasons as to why I dislike the premise of this mod. By addressing these four points you can improve your script. My criticism is therefore constructive.

You could mention how the spamming sound of the toolgun in my mod is annoying for everyone in the server just like how I said ticking every box in your rules list is. It would still be valid criticism.

Sure, but the amount of times you have to click is linearly dependant on the amount of rules there are. And especially since admins don’t have to be bothered by enabling the rules, this rule list can get quite big. More rules = more clicks, more click = more annoying.

Your code is great for a beginner.

People will forget the rules as soon as this menu is closed. This mod can only have a negative impact because it annoys people who join the server. People who are annoyed are more likely to minge than people who aren’t. And the people who join a server with the intent to minge, really aren’t deterred by a rules screen.

Sorry for coming about harshly, but I have huge objections against this mod. I already have objections against MOTD’s that pop up on initial spawn. This mod is like such MOTD, except way worse.

Let me emphasize: The execution of this mod is great (coding wise, layout, colour scheme), especially for a beginner. the idea behind it is not.

I agree with FPtje. I love the look of the menu. Truly amazing graphics. But the idea of the mod would make me disconnect from the server rather than staying and clicking.

Ok you have something against spawn popups in general, thats your opinion but its made for serverowners who don’t and when you join a server you’re guest and should behave like one that means if the serverowner means its neccessary for his server to have such a thing then you as player have to accept it. It only takes a few seconds.

For me its like a small barrier when you join and think i’ll do some bullshit and then the popup opens and stops you in your action and lets you think again.

But i should make a convar if the menu opens on spawn because I’m anxious to make things which everyone finds useful.
Also I think the rules are applying for admins because they make them and know them better as any player who reads them.
Another topic would be admins who doesnt follow their own rules in a bad way I mean like breaking the important rules which are neccessary for a good game then the admins are… to be replaced.

With constructive criticism i also mean to express oneself in a rhetorical way where the receiver doesn’t feel attacked more like theres work to do. I mean you can express yourself very articulate but without attacking someone like posting a script and say bypass this nonsense. You could have also postet the same script but say that this could break your system.

The example with your tabletpc-ropewriting was not very good should only clarify what I mean excepting the fact that I like it somehow.

And if people forget the rules and annoy other people majorly then you could just ban them.

The next step would be writing a script which analyses peoples behavoir or something to enforce the rules even when no admin is online.
For example the NLR rule which says something like you cant come back to the place you died for 3min then the script looks how much time is left and the closer you get to that point the more your screen will fade to black, flicker, blur,…
And if you do this repeatedly then you will get punished like strip weapon,slay, kick, ban.

Edit:
I mean you can edit the settings in a way where you only have to click accept which would take ~3 sec (2 for detecting the button and one for reacting and clicking)

So you mean its annoying to have it open right after spawn. That means for me adding a ConVar which disables it so you can decide to read the rules or not.
But if you dislike the opportunity to have a rules menu then I can’t do anything.

-Uke

No, what they are against, is the idea of kicking/disconnecting if they didn’t read. OR having the rules have to be clicked on.

Having the option to turn on and off the loading on InitialPlayerSpawn, and PlayerSay - would be a good feature, as people who don’t like these settings, can turn them off. And people that do, can keep them on.

Generally, forcing people to read rules has bad outcomes - can destroy your player-base. (Trust me, i’ve been there.)

rules should be seen in the loading screen and then later on can be easily seen through an F1 menu or some common global method

loading screen is a good idea but not lua its not possible with lua afaik because the datas are being send while seeing the loading screen

and i added a whole bunch of convars to customise it how you like and the settings are now that ticking each rule is disabled by default and the menu opens only if you are joining the server for the first time

you can custominse for which player the menu will be opened and if it will be opened after an update(else you would just get informed via chat that the new rules has been downloaded)

only the server can access them or admins with rcon

if admins are treated like normal players or not and more (20 convars)

and lowered the time you have to wait by default to max 25sec

Edit:

UPDATE:

ConVars:

ConVar, default value, description:


urules_prompt 			1		whether or not it will be opened right after a player joined
urules_prompt_updates 			0	        whether or not it will be opened right after an update
urules_max_umsg_size 			20	        maximum amount of characters a usermessage string has (20 is good and still fast 2 < ConVar < 200)
urules_ticking_rules_enabled 	        0        	should newbies make a tick behind each rule
urules_admins_ownrules 			1		wheter admins should(0) be treated like normal players or not(1)
urules_admins_wait 				0		how long should admins wait (if urules_admins_ownrules is set to 1)
urules_admins_prompt 			0		defines whether or not the menu will opened automatically on an admins client on join (if urules_prompt is set to 1)

urules_newbie 				 1		defines the maximum amount of times a player has to accept the rules to count as newbe
urules_newbie_wait 			25		the time a newbie has to wait
urules_newbie_prompt 		1		defines whether or not the menu will opened automatically on a newbies client on join (if urules_prompt is set to 1)
urules_postnewbie 			 10		defines the maximum amount of times a player has to accept the rules to count as postnewbie (better than newbie but still a noob)
urules_postnewbie_wait 		15		the time a newbie has to wait
urules_postnewbie_prompt		0	        defines whether or not the menu will opened automatically on a postnewbies client on join (if urules_prompt is set to 1)
urules_player 				25 		defines the maximum amount of times a player has to accept the rules to count as player
urules_player_wait 			5		the time a newbie has to wait
urules_player_prompt 		0		defines whether or not the menu will opened automatically on a players client on join (if urules_prompt is set to 1)

urules_advanced_player_wait 	0        the time an advanced player has to wait (everything after player)
urules_advanced_player_prompt   0	defines whether or not the menu will opened automatically on an advanced players client on join (if urules_prompt is set to 1)

urules_update_wait 			10	the time each player has to read an update
urules_update_wait_admins 	5	the time each admin has to read an update (if urules_admins_ownrules is set to 1)

Chat commands:
Say “/read <name/steamID/playerID/uniqueID>” to make someone reading the rules.
Say “/accept <name/steamID/playerID/uniqueID>” to make someone reading the rules with beign forced to make a tick behind each.
Say “/update” to load and send the updated rules to everyone.
Say “/waited <name/steamID/playerID/uniqueID> <number(x>=0)>” to set someones waited times.
Say “/reset <name/steamID/playerID/uniqueID>” to reset someones waited times to 0.

Download Update: garrysmod.org - URules

Now you can have the menu you want and its also useable for motds.
Won’t delete the kick function you can just set the waiting time to 0 now :wink:
And the bypass is now fixed.

-Uke

you can have HTML panels for the loading screen…

But this wouldn’t be lua scripting :wink: but probably some of the best solutions if the loadingscreen is open long enough.

-Uke

Since when did hentie say that it’d be in lua?

Nice update.

Never but its the lua scripting forum, so I expected it. :confused:

Thanks.

-Uke

Hmm, that thing where you had to tick each rule, did that get fixed? It’s my only real qualm with this script.