Raised This Month: $51 Target: $400
 12% 

[TF2] ScrollingRules


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author
Zirconium
Member
Join Date: Jul 2011
Plugin ID:
2533
Plugin Version:
1.0.0
Plugin Category:
General Purpose
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    19 
    Plugin Description:
    Displays the Server Rules to users each xxx seconds or on demand to user who asked for
    Old 08-31-2011 , 16:56   [TF2] ScrollingRules
    Reply With Quote #1

    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
    Attached Thumbnails
    Click image for larger version

Name:	2011-09-12_00002.jpg
Views:	2748
Size:	10.8 KB
ID:	92551   Click image for larger version

Name:	2011-09-12_00003.jpg
Views:	1955
Size:	10.8 KB
ID:	92552  
    Attached Files
    File Type: txt scrollingrules.phrases.txt (262 Bytes, 1384 views)
    File Type: txt scrollingrulesdata.phrases.txt (1.3 KB, 1492 views)
    File Type: smx scrollingrules_with_usecolors.smx (14.2 KB, 524 views)
    File Type: sp Get Plugin or Get Source (scrollingrules_with_usecolors.sp - 483 views - 11.6 KB)
    File Type: smx scrollingrules_without_usecolors.smx (8.2 KB, 360 views)
    File Type: sp Get Plugin or Get Source (scrollingrules_without_usecolors.sp - 1078 views - 11.4 KB)

    Last edited by Zirconium; 07-04-2017 at 09:01. Reason: Version 1.0.0 released
    Zirconium is offline
     



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 20:57.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode