Monthly Target: $400 Donations: $38
 9% 

Modular Advertisements


Post New Thread Reply   
 
Thread Tools Display Modes
Author
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Location: United States
Plugin ID:
4336
Plugin Version:
1.0
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Display advertisements in your server
    Old 09-03-2014 , 19:21   Modular Advertisements
    Reply With Quote #1

    Modular Advertisements

    Description:
    Yes, another advertisements plugin, yippy. It is pretty much a copy pasterino witth some changes that offer some interesting oppurtunities for plugin developers. Several server have issues where their chat is spammed with different advertisements from different plugins. This update fixes that issue.
    Control Variables:
    • sm_advertisements_enabled (default: 1) Enable/Disable the plugin
    • sm_advertisements_file (default: advertisements.txt) Advertisements configuration file
    • sm_advertisements_interval (default: 30) Advertisements interval
    Natives:
    Code:
    /**
     * Register an advertisement
     * 
     * @param strType		Type of advertisement
     * @param strText		Text to display
     * @param strFlags		Required admin flag(s) to view the advertisement
     * @noreturn
     */
    native RegisterAdvertisement(String:strType[], String:strText[], String:strFlags[] = "none");
    
    // Example
    RegisterAdvertisement("S", "{olive}Type !forum to visit our website!");
    Forwards:
    Code:
    /**
     * Called when the advertisement configuration file is loaded
     * 
     * @noreturn
     */
    forward OnAdvertisementsLoaded(client);
    Configuration: (default: advertisements.txt)
    Code:
    "Advertisements"
    {
        "1"
        {
            "type"        "S"
            "text"        "{GREEN}[email protected]"
        }
        "2"
        {
            "type"        "T"
            "text"        "www.domain.com"
            "flags"       "a"
        }
    }
    Version Log:
    • Version 1.0
      • Initial Release
    Installation:
    1) Add the files included in this post to their folders relative to sourcemod/addons
    • advertisements.smx to plugins
    • advertisements.txt to configs
    My Plugins
    intox Gaming
    Attached Files
    File Type: smx advertisements.smx (18.0 KB, 197 views)
    File Type: inc advertisements.inc (854 Bytes, 137 views)
    File Type: sp Get Plugin or Get Source (advertisements.sp - 140 views - 10.3 KB)
    File Type: txt advertisements.txt (971 Bytes, 238 views)
    __________________

    Last edited by ReFlexPoison; 09-03-2014 at 19:53.
    ReFlexPoison is offline
    Donnosso
    New Member
    Join Date: Jul 2014
    Old 09-05-2014 , 17:48   Re: Modular Advertisements
    Reply With Quote #2

    Hi, I just downloaded your plugin.
    I have an Insurgency Server and the messages show the first word only. Any ideas?
    Donnosso is offline
    nelioneil
    SourceMod Donor
    Join Date: Sep 2005
    Old 09-06-2014 , 06:59   Re: Modular Advertisements
    Reply With Quote #3

    Pleaes change your FCVAR as it is the same as DJ Tsunamis advertismements mod:

    sm_advertisements_version
    nelioneil is offline
    Amroth
    Senior Member
    Join Date: Apr 2013
    Location: /root
    Old 09-06-2014 , 08:56   Re: Modular Advertisements
    Reply With Quote #4

    CS:GO support? in colors.

    Last edited by Amroth; 09-06-2014 at 08:57.
    Amroth is offline
    WildCard65
    Veteran Member
    Join Date: Aug 2013
    Old 09-06-2014 , 09:54   Re: Modular Advertisements
    Reply With Quote #5

    Some nitpicks I find, I'll let an expert decide more, for the advert type, why not turn it into an enum, will allow you to use a switch statement.
    For admin flags, instead of strings, use bitstrings input
    __________________
    My servers:
    <Need to set them back up>

    Last edited by WildCard65; 09-06-2014 at 09:56.
    WildCard65 is offline
    robotortoise
    Senior Member
    Join Date: Nov 2013
    Location: Somewhere in the US
    Old 09-12-2014 , 00:24   Re: Modular Advertisements
    Reply With Quote #6

    This looks interesting.

    I'd like to make a request, please: random advertisements, so you can set the percentage chance an ad will appear, and which ads and how often.

    You could do something like pop up helpful tips.
    __________________
    -Robotortoise [Palutena's Bro]

    If you ever need help with Wii/Gamecube/DS sounds/music/ect., I'm your man!

    Contact me via Steam

    I don't bite.


    How to loop and compress .wav files

    Me and my friends' server
    robotortoise is offline
    abrandnewday
    ( ͡° ͜ʖ ͡°)
    Join Date: Dec 2011
    Location: Canada
    Old 09-14-2014 , 22:53   Re: Modular Advertisements
    Reply With Quote #7

    Quote:
    Originally Posted by ReFlexPoison View Post
    Several server have issues where their chat is spammed with different advertisements from different plugins.
    This is why I always download the plugin source instead of the compiled plugin, so I can edit the plugin, remove any unnecessary stuff such as advertisements and then recompile.
    __________________
    Yes, I'm 404 (explanation on "My Plugins" link). Not only do I host my own servers,
    I host servers for other people too!

    Donate! | My Plugins | My TF2 Beta/Cut Content Archives

    Plugins you should check out:
    Custom Weapons 2 (Beta 4, August 21 2015) | [TF2] Demoman's Dynamite Pack
    abrandnewday is offline
    Send a message via Skype™ to abrandnewday
    eraserhead
    Veteran Member
    Join Date: Nov 2009
    Old 07-16-2015 , 13:04   Re: Modular Advertisements
    Reply With Quote #8

    Quote:
    Several server have issues where their chat is spammed with different advertisements from different plugins. This update fixes that issue.
    So how do i manage advertisements from other plugins with this plugin? Or did i misunderstood this and is this only for when developers of other plugins use your plugin?
    __________________
    eraserhead is offline
    Send a message via Skype™ to eraserhead
    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 23:47.


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