This is the Sourcemod version of M.A.D (Mani Admin Donations).
It reads the Steam ID's from where you direct it to in settings.cfg (created when script is loaded!) when a player joins the server and adds them to the admin list if they are found on the webpage.
To use this you need:
2 MySQL databases and Users (or just 1 user tied to both databases)
Sourcemod 1.2.1+ (it says 2.0 in the script, Ignore that, it was a typo)
Eventscripts 2.0+
Webserver that allows at least 2 databases and users
Webserver that enables PHP
Visit Forum Thread for easier instructions!
Installation
Shut Down your server for the following.
Gameserver:
1) Place sad.py in "addons/eventscripts/sad"
Webserver:
1) Create a MySQL database (call it sad for this tutorial to make more sense)
2) Create a User for this database with FULL privelidges!
3) Upload the contents of the "webserver" folder to public_html/sad or whatever folder you want. (public_html has to be the folder where websites are public)
4) Now you need to edit admin/config.php
[code]
<?PHP
//host loaction
define("_HOST", "localhost", TRUE);
//database username
define("_USER", "DATABASE USERNAME HERE", TRUE);
//database username`s password
define("_PASS", "DATABASE PASSWORD HERE", TRUE);
//database name
define("_DB", "DATABASE NAME HERE", TRUE);
//database table name change this to install multiple version on same database
define("_TBL", "mad", TRUE);
//This is the email that you will recieve emails when someone signs up.
define("_EMAIL", "emailaddress@fakesite.com", TRUE);
?>
[/code]
Edit that replacing the required fields.
5) Edit admin/tosconfig.php
[code]
<?PHP
//host loaction
define("_HOST", "localhost", TRUE);
//database username
define("_USER", "DATABASE USERNAME HERE", TRUE);
//database username`s password
define("_PASS", "DATABASE PASSWORD HERE", TRUE);
//database name
define("_DB", "DATABASE NAME HERE", TRUE);
//database table name change this to install multiple version on same database
define("_TBL", "mad", TRUE);
//This is the email that you will recieve emails when someone signs up.
define("_EMAIL", "emailaddress@fakesite.com", TRUE);
?>
[/code]
And give it the same information APART FROM:
[code]
define("_TBL", "mad", TRUE);
[/code]
change that to "mad1" or "mad2" or anything different! THIS IS A MUST!
6) With that done begin to edit admin/validate.php
[code]
$usernames = array("admin");
$passwords = array("password");
[/code]
Change the things in quotes to whatever you want the username and password to be. Top line is Usernames and Second Line is Passwords if it wasn't fairly obvious!
To add multiple usernames:
[code]
$usernames = array("admin","admin2");
$passwords = array("password","password2");
[/code]
Do that.
7) Now time to run the installation php files.
7.1) Go to http://www.yourdomain.com/sad/admin/install.php
(replace that with the site your donation page is set up at)
It should be successful. If not, Check your Details and Try again.
7.2) Go to http://www.yourdomain.com/sad/admin/tosinstall.php
(replace that with the site your donation page is set up at)
It should be successful. If not, Check your Details and Try again.
7.3) Delete tosinstall.php and install.php
You should now be able to add Terms Of Service and Steam ID's to the database.
8) Ok, create another database (called admins)
9) Create a user for the admins database WITH FULL PRIVELIDGES!
10) Go back to the folder containing the webpages. Open up index.php (not the one in the Admin folder) and edit:
[code]
<p><h3><strong>Basic Admin</strong></h3></p>
<form name="_xclick" action="https://www.paypal.com/us/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="amount" value="5.00">
<input type="hidden" name="business" value="youremail@yourdomain.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="basic admin">
<input type="hidden" name="notify_url" value="http://www.yourdomain.com/CSS/addsteam.php">
<input type="hidden" name="return" value="http://www.yourdomain.com/CSS/index.php?paypal=success">
<input type="hidden" name="cancel_return" value="http://www.yourdomain.com/CSS/index.php?paypal=fail">
<input type="hidden" name="rm" value="1">
<table>
<tr>
<td>Amount</td>
<td>
<select name="quantity">
<option value="1">1 Month($5.00)
<option value="3">3 Months ($15.00)
<option value="6">6 Months ($30.00)
<option value="12">1 Year ($60.00)
[/code]
Edit the Lines that look like that (should be 2 sets) and replace "http://www.yourdomain.com/css/" with your site location.
[code]
<input type="hidden" name="amount" value="5.00">
[/code]
This is the Value for 1 month
[code]
<input type="hidden" name="business" value="youremail@yourdomain.com">[/code]
This is the email address of the account that gets the donations.
[code]
<input type="hidden" name="currency_code" value="USD">
[/code]
This is the Currency. (Can be "GBP" for example)
Do this for the Advanced Admin too!
11) Now back to the gameserver :)
Gameserver:
2) Go to addons/sourcemod/configs
Now open up databases.cfg
Edit the one with "default" as its name.
For Example Client Prefs has:
[code]
"clientprefs"
{
"driver" "sqlite"
"host" "localhost"
"database" "clientprefs-sqlite"
"user" "root"
"pass" ""
//"timeout" "0"
//"port" "0"
}
[/code]
Look for the one that says "default" instead of "clientprefs"
Edit that to your needs. Host should be the web address of where your MySQL admin database is.
3) With that Edited and Saved go to addons/sourcemod/plugins and take "sql-admin-manager.smx" out of the disabled folder. Put it into the normal folder with all the enabled plugins.
4) Now it's time to start up your server again!
5) In RCON (or console) type "sm_create_adm_tables" without the quotes.
If you get an error saying it can't find the database, check the address is correct (or host)
If you get an Error saying that you are Denied access, Check the Password and Username FIRST and if you are sure that is correct, you need to add the IP in the error logs to the Allowed IP's for Remote MySQL. This should solve it.
6) Now, in RCON (or console) type "sm_sql_addgroup "basic admin" "a b c d e f g h" "50"" without the first and last quote.
Replace where it says "a b c d e f g h" with the flags you want the Basic Admins to have. Flags can be found in addons/sourcemod/configs/admin_levels.cfg
7) Now, in RCON (or console) type "sm_sql_addgroup "advanced admin" "a b c d e f g h" "99"" without the first and last quote.
Replace where it says "a b c d e f g h" with the flags you want the Advanced Admins to have. Flags can be found in addons/sourcemod/configs/admin_levels.cfg
*Note the Group names can be changed, but you have to change them in the settings.cfg too!*
8) Now the groups should have been added. Now load and unload sad.py
9) The config should now be created!
Edit the config to your needs.
* PLEASE NOTE THAT I DID NOT ADD ADVERTISEMENTS TO THIS DONATION SCRIPT! SOURCEMOD HAS A VERY GOOD PLUGIN FOR ADVERTS THAT YOU CAN USE! SO DON'T EXPECT ADVERTS TO DO ANYTHING *
10) Load the script once more and you should be all set! When a player donates and they join the server, they should be added.
Please report any bugs/issues on the forum thread. And remember to +w00t if you like!
Sorry for any errors, This is the first time I've dabbled with Sourcemod Admin Addition.
Version Notes For 1.0
Updated on: 2009-08-19 12:49:40 EST by Owned|Myself (View Zip Contents)
First Version. All details above.