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.
Thats how it looks with the standard text.
You can’t just tick every rule theres a delay. (i recognized the X in the upper right hand corner and removed it)
Standardtext part 2
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
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)
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
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!