Raised This Month: $32 Target: $400
 8% 

[ANY|Source 2009] Advanced Advertisements


Post New Thread Reply   
 
Thread Tools Display Modes
Author
minimoney1
SourceMod Donor
Join Date: Dec 2010
Plugin ID:
2976
Plugin Version:
1.2.8
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    355 
    Plugin Description:
    An advanced advertisement system taking advantage of Source 2009 games' new color system
    Old 05-28-2012 , 21:26   [ANY|Source 2009] Advanced Advertisements
    Reply With Quote #1

    Advanced Advertisements

    What is it?
    This is an advanced advertisement system that takes advantage of TF2's new color system abilities and also has added many new features and bug fixes.
    What do I need to run this plugin?
    As a server manager, you are not forced to run any other plugins or extensions but,
    • To receive automatic updates for bug fixes, you can install Updater.
    • To get the exact true IP of your server even when you're behind a firewall when using the {IP} or {FULL_IP} tags you need SteamTools installed on your server.
    To compile this plugin, however, you need the following:
    How is this different from the original plugin?
    To name a few changes:
    • This plugin has added support for TF2 color system
    • This plugin has added support for "Client Tags", these are tags that get replaced dynamically for each client, examples will be shown below
    • The addition of the ability to get the correct IP of servers even if they are under a firewall; this function requires SteamTools, however.
    • If not using the tf2 version, support for the colors library has been added.
    • Added auto-updater
    • Plugin will be actively maintained.
    How do I install this?
    1. Make sure you have installed SteamTools and Updater to take full advantage of this plugin.
    2. Download the plugin zip file from here.
    3. Open the zip file and double click on the minimoney1-SM-TF2-Advanced-Ads-xxxxxxx folder, you should see a couple more folders such as plugins and translations.
    4. Get the correct version of the adv_adverts smx file (Whether tf2 or non-tf2), upload it to your addons/sourcemod directory, and drag and drop the translations, and configs folders into your addons/sourcemod directory.

    How can I change some of the configurations?
    On default, this plugins creates an automatic config in cfg/sourcemod/plugin.adv_adverts_xxx, open that file and you will see these ConVars:
    • sm_extended_advertisements_enabled - Is plugin enabled?
    • sm_extended_advertisements_delay - The delay time between each advertisement
    • sm_extended_advertisements_file - What is the file directory of the advertisements file
    • (Source 2009 Only) sm_extended_advertisements_extracolors_file - What is the directory of the "Extra Colors" config?
    • sm_extended_advertisements_exitmenu - In "M" type menus, can clients close the menu with the press of any button?
    • sm_extended_advertisement_extratopcolors_file - What is the directory of the "Extra Top Colors" config?
    What commands can admins use?
    (Root) Admins have access to these commands:
    • sm_reloadads - Reloads all advertisement config files (Including extra color files).
    • sm_showad - Shows the next advertisement immediately.
    Additional Stuff
    Credits also go to:
    • GoD-Tony for the Updater plugin.
    • Asherkin for the SteamTools extension
    • Exvel for the Colors Library
    • Dr. McKay for the "More Colors" Library
    • Berni and Chanz for SMLIB
    • The Sourcemod dev team
    • KyleS
    • FlaminSarge
    • Asherkin
    • Psychonic
    • Swatty
    • 11530 for all his help and also for the "\n" bugfix
    • ReFlexPoison
    • Bacardi
    • Everyone else in IRC
    Links
    Download the plugin from here.
    This project's GitHub (Source) is located here.
    Note: Some of the versions get released without testing, and it would be really nice if some server owners could test the plugins and let us know how it ends out being.

    Last edited by minimoney1; 08-31-2012 at 17:38.
    minimoney1 is offline
    minimoney1
    SourceMod Donor
    Join Date: Dec 2010
    Old 05-28-2012 , 21:27   Re: [ANY|TF2] Advanced Advertisements
    Reply With Quote #2

    How do I add my own advertisements?
    Pretty simple, actually. Open the extended_advertisements.txt file located in your configs directory. It should look something like this:
    Code:
    "Advertisements"
    {
    	"1"
    	{
    		"type"		"C"
    		"text"		"www.domain.com"
    	}
    	"2"
    	{
    		"type"		"CH"
    		"text"		"[email protected]"
    	}
    	"3"
    	{
    		"type"		"M"
    		"text"		"Next map is {NEXTMAP} in {TIMELEFT} minutes."
    		"flags"		"cft"
    	}
    	"4"
    	{
    		"type"		"S"
    		"text"		"{GREEN}Current {LIGHTGREEN}Map: {DEFAULT}{CURRENTMAP}"
    	}
    	"5"
    	{
    		"type"		"T"
    		"text"		"{ORANGE}friendly fire is {CONVAR_BOOL:mp_friendlyfire}."
    	}
    	"6"
    	{
    		"type"		"S"
    		"text"		"{GREEN}Admins: Sourcemod version is {CONVAR:sourcemod_version} and advertisement plugin version is {CONVAR:sm_extended_advertisements_version}"
    		"flags"		"z"
    	}
    }
    You could probably get how this works by taking a look at that template. Let's say we wanted to add a new advertisement. We increment the advertisement number by 1, so we start out like this:
    Code:
    	"7"
    	{
    	
    	}
    We first have to tell the plugin where we wanted to show this text, let's say we want to show it in the "say" text-box only, we add the "S" type to our code so now it looks like this:
    Code:
    	"7"
    	{
    		"type"		"S"
    	}
    We can now add the "text" to our advertisement. Valid tags in the "text" area are color tags and the ones listed below.
    Lets say we wanted to add one that tells the people what their name is and has the color green, let's do so! As you can see, we have a {CLIENT_NAME} tag in our tag list. So if we were to add it, it would look something like this:
    Code:
    	"7"
    	{
    		"type"		"S"
    		"text"		"Your name is {CLIENT_NAME}!"
    	}
    Now let's add the color green. The color tag for green is {GREEN}, so it ends out looking like this:
    Code:
    	"7"
    	{
    		"type"		"S"
    		"text"		"{GREEN}Your name is {CLIENT_NAME}!"
    	}
    And it's that easy, but let's say we wanted to only show this to the people with the reservation flag (a), we would add a "flags" parameter and add the "a" flag as its value, so it looks like this:
    Code:
    	"7"
    	{
    		"type"		"S"
    		"text"		"{GREEN}Your name is {CLIENT_NAME}!"
    		"flags"		"a"
    	}
    What are the valid tags inside of "text"?
    Here's a list for you:
    • {IP} - The IP of the server
    • {FULL_IP} - The full ip (including the port) of the server.
    • {PORT} - The connect port of the server.
    • {CURRENTMAP} - The current map that the server is on.
    • {NEXTMAP} - The next map that the server will go to.
    • {TICKRATE} - The tickrate of the server.
    • {SERVER_TIME} - The server time.
    • {SERVER_TIME24} - The server time in 24-hour format
    • {SERVER_DATE} - The server date.
    • {TIMELEFT} - The time that is left until the next level change.
    • {CLIENT_NAME} - The name of the client that is viewing the advertisement.
    • {CLIENT_STEAMID} - The Steam ID of the client that is viewing the advertisement.
    • {CLIENT_IP} - The IP of the client that is viewing the advertisement.
    What are the valid color tags inside of "text"?
    This all depends on the type of text. For example, in a "T" type text, you can use these tags:
    {white}, {red}, {green}, {blue}, {yellow}, {purple}, {cyan}, {orange}, {pink}, {olive}, {lime}, {violet}, {lightblue}

    Last edited by minimoney1; 06-30-2012 at 19:58.
    minimoney1 is offline
    minimoney1
    SourceMod Donor
    Join Date: Dec 2010
    Old 05-28-2012 , 21:28   Re: [ANY|TF2] Advanced Advertisements
    Reply With Quote #3

    Reserved
    minimoney1 is offline
    11530
    Veteran Member
    Join Date: Sep 2011
    Location: Underworld
    Old 05-28-2012 , 22:24   Re: [ANY|TF2] Advanced Advertisements
    Reply With Quote #4

    Looking good, I'll update tonight. Thanks for the redux!

    Instead of defining TF2COLORS, maybe you could just check the game in OnPluginStart and set a bool? That way, people don't need to manually set/compile it themselves.

    Also, would it be better to use #tryinclude for things like SteamTools/Updater instead of using more defines there too?

    Do we need to do anything with the .gitattributes and .gitignore files in the zip file?
    __________________

    Last edited by 11530; 05-28-2012 at 22:38.
    11530 is offline
    minimoney1
    SourceMod Donor
    Join Date: Dec 2010
    Old 05-28-2012 , 23:04   Re: [ANY|TF2] Advanced Advertisements
    Reply With Quote #5

    Quote:
    Originally Posted by 11530 View Post
    Looking good, I'll update tonight. Thanks for the redux!

    Instead of defining TF2COLORS, maybe you could just check the game in OnPluginStart and set a bool? That way, people don't need to manually set/compile it themselves.

    Also, would it be better to use #tryinclude for things like SteamTools/Updater instead of using more defines there too?

    Do we need to do anything with the .gitattributes and .gitignore files in the zip file?
    The problem here is that we're including 2 libraries that have stocks with similar, or completely alike names, therefore I have to use the define and #if defined to let the compiler know not to include if it is not compiling the TF2 version.

    I don't know how #tryinclude works, but from what I know, using #undef REQUIRE_PLUGINS and #unded REQUIRE_EXTENSIONS makes sure the files are included but when it comes to running the plugin, it doesn't require the extensions, whereas if I didn't have that line it would stop the plugin saying a requirement has not been matched, and also speaking of requirements, I forgot to #undef REQUIRE_PLUGIN on #include <updater>, so I would recommend updating your plugin to the newest version as I have done this in the newest commit. This will not be necessary if you're already running Updater. (Commit Info) I didn't increment the version just because of this change as there probably will be some major bugs that I'll need to fix which I will in the next versions.

    The .gitattributes and .gitignore files are just for GitHub (The SVN), it doesn't make a difference as they don't do anything for the plugin; they're just the git's config, meaning no, you won't need them and it's recommended that you don't upload them at all.

    Also, make sure you only upload 1 version of the plugin smx file.

    Last edited by minimoney1; 05-28-2012 at 23:09.
    minimoney1 is offline
    ReFlexPoison
    ☠☠☠
    Join Date: Jul 2011
    Location: ☠☠☠
    Old 05-28-2012 , 23:23   Re: [ANY|TF2] Advanced Advertisements
    Reply With Quote #6

    Will try it out l8r.
    ReFlexPoison is offline
    minimoney1
    SourceMod Donor
    Join Date: Dec 2010
    Old 05-28-2012 , 23:31   Re: [ANY|TF2] Advanced Advertisements
    Reply With Quote #7

    Anyone that wants to contribute to this project, either on GitHub as a collaborator (or whatever they call it on GitHub) or through suggestions, please don't hesitate to let me know.
    I already have a couple of ideas in mind such as using HUD messages (Not in CSS) as adverts and many more.
    minimoney1 is offline
    Grognak
    SourceMod Donor
    Join Date: Jan 2012
    Old 05-28-2012 , 23:34   Re: [ANY|TF2] Advanced Advertisements
    Reply With Quote #8

    This has been a long time coming. Great job!

    (Your more colors link should probably lead here.)
    Grognak is offline
    minimoney1
    SourceMod Donor
    Join Date: Dec 2010
    Old 05-28-2012 , 23:35   Re: [ANY|TF2] Advanced Advertisements
    Reply With Quote #9

    Quote:
    Originally Posted by Grognak View Post
    This has been a long time coming. Great job!

    (Your more colors link should probably lead here.)
    Oops, thanks, fixed now.
    minimoney1 is offline
    11530
    Veteran Member
    Join Date: Sep 2011
    Location: Underworld
    Old 05-28-2012 , 23:57   Re: [ANY|TF2] Advanced Advertisements
    Reply With Quote #10

    Awesome, thanks for the info minimoney1, and for taking the time to do this plugin.

    Quick question: would completely custom RGB(A) values be worth it, or do you reckon the More Colors library suffices? It is certainly useful to know the names for colors, however if you wanted complete custom support, I wrote a function here you can use should you ever want to implement it.
    __________________
    11530 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 09:14.


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