This was a huge fucking
pain in the ass.
- !rules and !frules have returned.
- Choose section to view.
- !frules menu cannot be closed until player reaches a confirmation option.
- Plugin pulls MOTD data from the website.
!rulesThis command is available to everyone. The plugin displays a menu with the different rule sections. Players can choose to view individual sections or all rules.
When a section is chosen, it will display the section name at the top, and the rules which fall under the section below, and across multiple pages if necessary.
The all rules display will highlight the next section name orange, regardless of where it appears in the menu.
The command for this functionality is described below:
sm_rules - View the server rules.
I realize that the current method of displays the rules and implementing pagination is ugly. This will be addressed in a (near) future update when I switch from using Menus to Panels (low-level Menus).
When this update is released, rules will also be numbered in the same way as they are in the MOTDs. In this update, the plugin will also not end lines in the middle of words, instead waiting for a space (" ") to occur before ending the line.
!frulesThis plugin is available to
admins with the 'b' flag (ADMFLAG_GENERIC). The plugin displays a menu with the different rule sections. The admin will choose what section they would like to force the offending player to read.
They can also choose to make the player read all rules; however, it is recommended that a player only be forced to read rules from the section corresponding to the rule they broke.
The !frules section select menu appears in the same way as the !rules menu.
Once a section is chosen, a menu will open on the offending player's screen, displaying the rules from the section selected.
The player cannot close out of this menu until they have *read* through all pages, and have reached the 'Finish' option.
Admins are notified that you forced a player to read
x section. The offending player is notified that they were forced to view
x section and they must reach the end of the menu before exiting. Other players are notified that the offending player was forced to read
x section.
The command for this functionality is described below. Multiple players cannot be targeted.
sm_frules <username/#id> - Forces a player to view the server rules.
Plugin Pulls From MOTD DataThe plugin sends a GET request to the website specified in 'motd.txt'. Because of this, the plugin relies on an extension called SteamWorks, which implements cURL functionality into SourcePawn.
After receiving the data, the plugin finds where the rules begin, separates each rule, strips away the HTML, and caches the sections and rules. This happens each time the map changes.
If you would like to see the data the plugin receives, you can
go here, right click, and select 'View Page Source.'
Every time the MOTD is updated, the rules in the server are also updated (after the map changes).
Making the plugin work in this way was an absolute cancer.
Thank you to
@Caribou and
@lulu for helping me test.
Feel free to contact me if you have any questions, suggestions, or concerns. If something in the menu doesn't look right,
take a screenshot and message me.
Edit:
@CmAnT please have your Divisional Staff make their admins aware of this new functionality.
Best Regards
Jordan - Technologies Director