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

Advertisements 2.1 (Updated 2021/02/06)


Post New Thread Reply   
 
Thread Tools Display Modes
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
    FrostbyteX
    Senior Member
    Join Date: Dec 2007
    Old 03-03-2008 , 12:34   Re: Advertisements
    Reply With Quote #2

    Excellent plugin! It's short and concise and efficient. I'll be using this.

    And for chat colors, precede the text you want colored with the color code (i.e. PrintToChatAll("%cThis is green", COLOR_GREEN), where COLOR_GREEN is defined as 4).

    Steve
    FrostbyteX is offline
    GTS_SERVER
    Junior Member
    Join Date: May 2011
    Old 05-17-2011 , 11:49   Re: Advertisements
    Reply With Quote #3

    Quote:
    Originally Posted by FrostbyteX View Post
    Excellent plugin! It's short and concise and efficient. I'll be using this.

    And for chat colors, precede the text you want colored with the color code (i.e. PrintToChatAll("%cThis is green", COLOR_GREEN), where COLOR_GREEN is defined as 4).

    Steve
    what ?
    could you plz copy the text that you use for your advertisment on your server?
    because i dont get it...

    Thanks
    //GTS_SERVER
    GTS_SERVER is offline
    picknroll
    New Member
    Join Date: Nov 2015
    Old 11-14-2015 , 08:24   Re: Advertisements
    Reply With Quote #4

    Quote:
    Originally Posted by FrostbyteX View Post
    Excellent plugin! It's short and concise and efficient. I'll be using this.

    And for chat colors, precede the text you want colored with the color code (i.e. PrintToChatAll("%cThis is green", COLOR_GREEN), where COLOR_GREEN is defined as 4).

    Steve
    Could you help me with colors in chat?

    {GREEN}Example Text
    {LIGHTGREEN}Example Text

    does not work

    {TEAM}Example Text

    does work

    I would like to use as many colors as possible for chat messages.
    picknroll is offline
    franketv
    New Member
    Join Date: Nov 2015
    Old 11-17-2015 , 11:08   Re: Advertisements 0.6 (Updated 2013/03/08)
    Reply With Quote #5

    I got the same issue.. anyone know how to fix it?
    franketv is offline
    SimplyJpk
    Member
    Join Date: Oct 2013
    Location: Just Jump
    Old 11-17-2015 , 18:44   Re: Advertisements
    Reply With Quote #6

    Quote:
    Originally Posted by franketv View Post
    I got the same issue.. anyone know how to fix it?
    Quote:
    Originally Posted by picknroll View Post
    Could you help me with colors in chat?

    I would like to use as many colors as possible for chat messages.
    Try using https://forums.alliedmods.net/showthread.php?p=1994861 It's updated to have more colours, not sure if there are to many other differences.

    Also if only team is working, may have grabbed the source version, not the cs:go version? (Assuming you're using cs:go), Just grab the .sxm instead of using 'getplugin' button.

    Edit: Mysql is kinda pointless if you only run 1 server. But if your colours aren't working you much be formatting them wrong, only regular say text will be coloured. I think it also supports basic csay styled text as colour, but only 1 colour.
    __________________
    Code is Fun
    If your plugin is broken, add me. If I have some free time I don't mind taking a look and fixing. (FreeTime lately is Limited).

    Last edited by SimplyJpk; 11-17-2015 at 18:47. Reason: Shortsightederrorsinassumingnextversionisbetterversion
    SimplyJpk is offline
    franketv
    New Member
    Join Date: Nov 2015
    Old 11-18-2015 , 06:18   Re: Advertisements 0.6 (Updated 2013/03/08)
    Reply With Quote #7

    I did not just press "get plugin", the red text told me not too :i
    I will look at the link, but i only run 1 server and have never tried mysql.

    I have choosen Type = S where {green} should work but it dosent. :s I dont think i can format wrong that way? But maybe i can.. Sorry for bad English :-)
    franketv is offline
    SimplyJpk
    Member
    Join Date: Oct 2013
    Location: Just Jump
    Old 11-18-2015 , 22:07   Re: Advertisements 0.6 (Updated 2013/03/08)
    Reply With Quote #8

    Quote:
    Originally Posted by franketv View Post
    I did not just press "get plugin", the red text told me not too :i
    I will look at the link, but i only run 1 server and have never tried mysql.

    I have choosen Type = S where {green} should work but it dosent. :s I dont think i can format wrong that way? But maybe i can.. Sorry for bad English :-)
    I've taken it straight out of my config, but, yours should look similar.
    So your sourcemod/configs/advertisements.txt file looks like

    PHP Code:
    "Advertisements"
    {
        
    "1"
        
    {
            
    "type"        "S"
            "text"        "{LIMEGREEN}[SimplyTF]{SNOW} Need a hand? Try using {LIGHTGREEN}!showme{SNOW}. If we have a recording, a bot will show you how to do the jump!"
        
    }

    __________________
    Code is Fun
    If your plugin is broken, add me. If I have some free time I don't mind taking a look and fixing. (FreeTime lately is Limited).
    SimplyJpk is offline
    Extreme_One
    Veteran Member
    Join Date: Nov 2006
    Old 03-03-2008 , 12:43   Re: Advertisements
    Reply With Quote #9

    Nice work
    Thank you.

    Coloured chat messages would be a great addition

    Anyway I've dropped ^BugS^ Ads plugin now and installed this one
    __________________
    Extreme_One is offline
    MjrNuT
    SourceMod Donor
    Join Date: Feb 2008
    Location: Under the Beaming CA Sun
    Old 03-03-2008 , 16:02   Re: Advertisements
    Reply With Quote #10

    Quote:
    Originally Posted by Extreme_One View Post
    Nice work
    Thank you.

    Coloured chat messages would be a great addition

    Anyway I've dropped ^BugS^ Ads plugin now and installed this one
    true dat!!
    __________________
    Flames and Ash Gaming
    Addon: SM v1.4.0-dev MM 1.8.5-dev
    Plugins: Advertisements, Webshortcuts, spray tracer, SBans, RTD, gScramble Balance, misc
    MjrNuT is offline
    Reply


    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 14:09.


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