Introduction
This is a wrapper for Tsunami's Advertisements plugin.
It is essentially additional code that queries a database at the beginning of every map, and then runs the ads, as per Tsunami's plugin.
Included is a Web interface, allowing Admins to create their ads in a single place, but having them received by all the servers.
If you have a single server, then you do not need this plugin, and I suggest you install the original Advertisements plugin.
A brief history
I wrote this in December because I was getting so fed up changing ads on all 18 of our our servers. One little mistake and the whole thing had to be fixed. In addition, our admins were asking for the opportunity to add their own ads.
Of all the Advertisements plugins out there, Tsunami's was easily the best and so rather than reinventing the wheel, I adapted his plugin, in true SourceMod fashion.
I never had any plans to release it, but when many, many people began asking for it, I had to ask Tsunami if it would be OK to release it.
So a big thanks to him.
If you have bugs with THIS plugin, then report them here and not in the original Ads plugin.
Additional Requirements
Web Server
MYSQL 5.0+
PHP 5.0+
Some knowledge of setting up MySQL databases, phpMyAdmin and installing PHP scripts is required.
Source Dedicated Server
MetaMod
SourceMod 1.1+
Installation
Web Interface- Create a new SQL database, and make note of the database name, the database username, the database password and the database hostname.
- Unzip adsmysql from the zipped file onto your desktop and edit:
- include/config.php
adding all the database data, any email data and the name of your community
- Upload all the contents of adsmysql from the zip file to your web server where you want AdsMySQL installed.
- Using adsmysql.sql, import the MYSQL data into your new database (using phpMyAdmin)
- Check it is all working by going to http://www.yourdomain.com/adsmysql and log in as Administrator, password Administrator.
Go to the Admin center and create a new user, then give them level 9 Admin. Usernames and passwords must be longer than six characters. Then delete the Administrator user.
- Log in as the new Admin and add a couple of advertisements to test run the web interface.
Game Server- Edit your addons/sourcemod/configs/databases.cfg file and add a new section:
Code:
"admintools"
{
"driver" "mysql"
"host" ""
"database" ""
"user" ""
"pass" ""
//"timeout" "0"
"port" "3306"
}
filling in the information with all the database data.
- Upload adsmysql.smx to addons/sourcemod/plugins folder
- Restart the game server and check for any errors in the logs
CVARS
Change time between ads (default 45 seconds)
sm_adsmysql_interval "30"
Web Interface
The web interface has nine levels of admin. Level 9 admins have full access. Level 3 can add and edit database entries but cannot delete them.
You can change the sequence of ads up and down by using the arrow buttons on the right.
The banner is located in the
adsmysql/images and is called logo02.jpg. It is an 800x100 image.
Site in use:
http://www.theville.org/admintools/ads.php
Game Server Interface
Ads only get reloaded from the database at the beginning of each map.
Admins get a menu command under Server Commands which will allow them to manually reload the ads in the middle of a game.
- sm_reloadads - Reloads the ads from within the game
Writing Ads
The Interface is simple to use:
Advert Type: Only Hint text, Says and Csays are supported in this current version.
Say text supports the following colors: {DEFAULT}, {TEAM}, {GREEN} and {LIGHTGREEN}
For a full explanation on how to type in all tags, check out Tsunami's original plugin notes, under Text:
http://forums.alliedmods.net/showthread.php?t=67885
Ad Visibility: For simplicity, there are three levels:
- Admins only
- Not visible by Admins
- All players
Admins are defined as those with
Reserved Slot status.
Game Type: Ads can be sent to all servers
, or only certain servers running that particular game
.
Currently supported
- CSS
- DoDS
- TF2
- Insurgency
- Pirates, Knights and Vikings.
If you need other games added to the interface, then ask for them in this thread.
Notes
This has been thoroughly tested over the past few months on TF2, DoDS, CSS, Zombie Panic Source, Age of Chivalry, Pirates, Vikings and Knights 2 and Insurgency.
Tsays have been omitted from this version. We never use them in our community because they are short, and easily missed. If there is sufficient interest, I will add them back in.
Has been installed by other communities (as test run guinea pigs!) without issues.
Bear with me on this one! I had to rip it out of an 'Admin Center' plugin that I have written, that incorporates:
- CommsTools - Permanent Muting/Gagging/Silencing across servers
- Advertisements via MySQL - this plugin
- Admin Tracker - tracks all your admins and the amount of time they spend on servers
It makes it easier to install and manage.
Credits
Thanks to Tsunami for allowing me to adapt a good chunk of his code in this plugin.
Thanks also to msleeper and mauirixxx for helping me test the install.
Changelog
Server Plugin
v1.2.100
Released to community
Web Server Interface
v1.3
Released
v1.4
+ Added top say
+ Automatically adds a space after a brace to ensure tsay works
+ Added Age of Chivalry, HL2DM, ZPS
+ Fixed minor security bug
+ Added definition so Server Ops can choose what to call Admins (include/config.php)
+ Added Left4Dead to 'edit ads' page
+ Fixed up HTML layout
+ Fixed bug where ads could not be added due to duplicate ids
+ Added ID column to help in sequencing
+ Changed icon for All games
v1.5
+ Fixed sequence arrows in IE
+ Fixed for some PHP interpreters where <? can't be used for PHP scripts.