Description : Displays the Server's Rules to all players each XX seconds, or on demand for the current player when asking for them using
!rules or
/rules in chat command.
CVARs :
scrollingrules_version
The version of this plugin, don't forget to change it in your existing cfg file when you update the plugin.
scrollingrules_enabled
Enables/Disable displaying the scrolling rules. (0 = disabled, 1 = enabled)
Default 1 = enabled
scrollingrules_howto
Enable/Disable the display of "How To" message like "
type !rules in chat to view our rules". (0 = disabled, 1 = enabled)
Default 1 = enabled
scrollingrules_howto_delay
Amount of seconds before the "How To" message is shown after map has started.
Default 20 seconds
scrollingrules_interval
Amount of seconds between each "group" of rules scrolling automaticaly in chat.
Default 300 seconds
scrollingrules_delay
Amount of seconds between each rule line scrolling when "on demand".
Default 0.2 seconds
scrollingrules_autodelay
Amount of seconds between each rule line scrolling when "auto scrolling".
Default 0.5 seconds
scrollingrules_file File to read the scrolling rules from, located in /translations dir.
Default: scrollingrulesdata.phrases.txt
The plugin, by default, reads the 'rules' from
translations/scrollingrulesdata.phrases.txt, which has this format:
Code:
"Phrases"
{
"Rule01"
{
"en" "{red}This are our Server Rules !"
}
"Rule02"
{
"en" "{red}Follow them {default}or you'll be {red}kicked {default}from Server"
}
....
"Rule10"
{
"en" "'=================================================="
...
}
Other language files in translations/de/scrollingrulesdata.phrases.txt, for german :
Code:
"Phrases"
{
"Rule01"
{
"de" "{red}Dass sind unsere Regeln !"
}
"Rule02"
{
"de" "{red}Beobachtet Sie {default}oder sie werden vom Server {red}gekickt"'
}
....
"Rule10"
{
"de" "=================================================="
...
}
or translations/fr/scrollingrulesdata.phrases.txt for french:
Code:
"Phrases"
{
"Rule01"
{
"fr" "{red}Voici nos Règles !"
}
"Rule02"
{
"fr" "{red}Respectez les ou vous serez Kické"
}
....
"Rule10"
{
"fr" "=================================================="
...
}
or in
translations/$lang/scrollingrulesdata.phrases.txt for $lang language where $lang is a language code existing in sourcemod/configs/language.cfg on your server!!!
For more info about languages and translations look
HERE
Each language file must have the same Sections names inside.
Keep this file structure or the plugin won't work (sections names HAVE TO CONTAIN THE WORD 'Rule', like 'Rule01' or 'Rule Line 2' etc...) .
If you have [INC]Colors installed you can use color codes in your rules file by uncommenting the //#define USECOLORS and recompile the plugin at your own. If it's NOT installed DON'T USE COLOR TAGS or it won't give you colored text.
WARNING
=======
With version 0.1.0 [INC]Colors has been be replaced by [INC]Morecolors when enabling USECOLORS you'll need to use sourcemod >= version1.5 to compile it if you start from source.
Two versions are now included, one with USECOLORS activated and the other without it, so you don't need to compile, just choose your version and rename it to scrollingrules.smx after download.
Installation :
Put the
scrollingrules.phrases.txt file in your
%GAMEDIR%/addons/sourcemod/translations directory, this is used to have translation on "How To" message.
Put the
scrollingrulesdata.phrases.txt file in your
%GAMEDIR%/addons/sourcemod/translations directory, this is used as rules KV file and for rules translation.
Put the
scrollingrules.smx file in your
%GAMEDIR%/addons/sourcemod/plugins directory.
The
scrollingrules.cfg file in your
%GAMEDIR%/cfg/sourcemod directory will be auto-generated because
AutoExecConfig(true, "scrollingrules"); is set on plugin start, just edit this file if you want to modifiy default values to yours.
Changelog :
- 0.0.1
- Initial version (be indulgent it's my first plugin )
- 0.0.2
- Changed to KV file no more rules number limit
- 0.0.3
- Fixed some warning coding errors
- #define USECOLORS is not set as default in .smx version
- scrollingrules.cfg file is 'auto-generated' if not existing at plugin start
- 0.0.4
- Using a translation file for getting rules translated in chat.
- 0.0.5
- Fixed index problem in SendToAllMsg when server is empty
- 0.0.6
- Fixed warning error "KillTimer" on OnMapStart
- 0.0.7
- Using PrintToChat and CPrintToChat translation capabilities
- Added a scrolllingrules_howto_delay var
- Added a "Start message" in console when plugin starts
- 0.0.8
- Fixed global warnings with "KillTimer"
- translations files examples are provided without color tags inside
- 0.0.9
- Fixed KillTimer warning message on map change.
- 0.1.0
- Changed from colors.inc to morecolors.inc and updating for sourcemod 1.5.0. Two versions are now included, one with USECOLORS activated and the other without it, so you don't need to compile, just choose your version and rename it after download.
- 0.1.1
- updated for sourcemod 1.8.0. and fixed warning messages concerning FCVAR_PLUGIN.
- 1.0.0
- solved {teamcolor} issue in welcome message. Version is now fully functional.
Screenshots