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

Advertisements 2.1 (Updated 2021/02/06)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Plugin ID:
306
Plugin Version:
2.1
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    Plugin Description:
    Display advertisements.
    Old 03-03-2008 , 12:08   Advertisements 2.1 (Updated 2021/02/06)
    Reply With Quote #1

    This is a simple advertisements plugin. It supports center, chat, hint, menu and top messages.

    sm_advertisements_enabled (0/1, def 1)
    Enable/disable displaying advertisements.

    sm_advertisements_file (def "advertisements.txt")
    File to read the advertisements from. Useful if you're running multiple servers from one installation, and want to use different advertisements per server.

    sm_advertisements_interval (def 30)
    Number of seconds between advertisements.

    sm_advertisements_random (0/1, def 0)
    Enable/disable random advertisements. When enabled, advertisements are randomized on every map change and reload.

    sm_advertisements_reload
    Server command to reload the advertisements.


    By default the plugin reads from addons/sourcemod/configs/advertisements.txt, which has this format:

    Code:
    "Advertisements"
    {
        "1"
        {
            "chat"        "{green}[email protected]"
        }
        "2"
        {
            "top"         "www.domain.com"
            "flags"       "a"
        }
    }
    Make sure to save this file as UTF-8 (without BOM), otherwise special characters will not work!

    Types

    The following types are supported:

    center: A center message, like sm_csay.
    chat: A chat message, like sm_say. A list of supported colors can be found on https://github.com/PremyslTalich/ColorVariables.
    hint: A hint message, like sm_hsay.
    menu: A menu message, like sm_msay, but without the title or the Exit-option. Pressing 0 will still hide the message, but it will block 1-9 from switching weapons while it's showing.
    top: A top-left message, like sm_tsay. It supports any of the colors listed on https://www.doctormckay.com/morecolors.php, or custom colors with {#abcdef}.

    Multiple types per advertisement are allowed, so you can show a different message in multiple places at the same time.

    Message

    The message supports the following variables: {currentmap}, {nextmap}, {date}, {time}, {time24} and {timeleft}. Next to that you can print the value of any cvar by enclosing the name with {}, for example {mp_friendlyfire}. Use \n for newlines, which works with center, chat, hint and menu messages.

    A couple of examples are given in the supplied advertisements.txt.

    Flags

    This field is optional. It accepts a list of flags of players who will not see the advertisement if they have any of those flags. If left empty, only admins will see the advertisement. If omitted everyone will see the advertisement.


    Download | Source Code

    Changelog

    __________________
    Advertisements | REST in Pawn - HTTP client for JSON REST APIs
    Please do not PM me with questions. Post in the plugin thread.

    Last edited by DJ Tsunami; 10-31-2021 at 08:23.
    DJ Tsunami is offline
     


    Thread Tools
    Display Modes

    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 03:30.


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