05.01.2012, 15:13
(
Last edited by Shoulen; 28/04/2013 at 09:17 PM.
Reason: Added more troubleshooting
)
Hello, I have found, made some graphical changes and reuploaded ShoBan, the code is messy as I was not as experienced with PHP when I made this script, I have no intent on remaking it or trying to make it better so I'm going to release it as is. Enjoy.
SHOBan
Welcome, SHOBan is an include designed by myself, Shoulen, to change the way server owners manage their bans.SHOBan
What is SHOBan?
SHOBan is a tool, web based and in game based, which relies it's bans on a MySQL database and does not have anything to do with the native SAMP.BAN file, it allows server administrators/owners to access their bans using their web browser and to also post bans from the web which will take effect on the user straight away (and kick the banned user).
Why is SHOBan better?
The SAMP.BAN file is useful but SHOBan can do so much more, SHOBan takes in to account the specific players on your server and logs the users when they go online/offline which allows for a filter so to allow administrators to see specifically who is online and who is offline as well as their "last seen" dates.
Features
Web Panel:
- The SHOBan Web Panel is a unique easy-to-use panel (currently fairly simple looking) which allows administrators to ban users from out of games as well as look at the bans that were previously made.
- SHOBan web panel has a ranking system where standard "administrator" users can only access the banning section whereas the superadmin/owner rank can edit server settings as well as create/delete/list administrator/superadmin users.
- Your SAMP.BAN file may be full of bans, but fear not! There is a way to transfer those bans to the SHOBan database by using the converter located in the SERVER SETTINGS section of your web panel which requires nothing more than a simple copy-paste.
The include provided with your copy of SHOBan enables you to use different functions to issues bans from in game and send it to the SHOBan database, it has been made so you can simply use "CTRL+H" in your PAWNO Compiler to replace the functions, please check the "FUNCTIONS" section of this topic to read more about them.
Requirements
- MySQL With one database set up.
- A Web server (preferably Apache).
Below is a step to step guide on installing SHOBan.
STEP 1
Assuming you have downloaded SHOBan extract it using WINZIP or WINRAR (or depending on the format, Default Windows Zip).
STEP 2
Assuming you have a Web Server & SQL Server set up (with a database), extract the contents of the "WEB" folder to your website and navigate your browser to the install.php file on your web server (Other pages will give errors at this point).
STEP 3
Follow all the steps of the install.php file and once prompted to, delete install.php.
Your Web panel should now be set up, if you encounter any errors, repeat Step 2.
STEP 4
Extract the contents of the SAMP folder to your SA-MP Server directory and allow any replacing if prompted.
STEP 5
Navigate to "pawno > include" and open "SHOBan.inc" in a text editor (Notepad, Wordpad) and change the lines
#define SQL_HOST "localhost"
#define SQL_USER "root"
#define SQL_PASS "root"
#define SQL_DB "root"
To the correct host, username, password and database so to connect to your MySQL server that you used during your Web Panel installation.
Example
#define SQL_HOST "hostname"
#define SQL_USER "username"
#define SQL_PASS "password"
#define SQL_DB "database"
STEP 6
Now that you've done that you can open your gamemode or filterscript and include it in by using "#include <SHOBan>" at the top of your script.
STEP 7
In your Gamemode/Filterscript that you've included the SHOBan include you need to add a few things under some of your callbacks.
OnGameModeInit
Code:
SHOInit();
Code:
SHOExit();
Code:
SHOConnect(playerid);
Code:
SHODisconnect(playerid);
We now want to change the way bans are done, if you are looking for an easy direct replacement of the Ban(playerid); function then change all Ban(playerid); to SHOBan(playerid);. For those looking for an easy direct replacement of the BanEx(playerid, reason); function then just change all BanEx(playerid, reason); to SHOBanEx(playerid, reason);.
If you are looking to completely rewrite your Ban function so to allow for more information to be posted to the SHOBan web panel then please refer to the "Functions" list below the tutorial.
Once this has been completed, if all steps have been followed correctly, your SHOBan should be successfully set up!
TROUBLESHOOTING
P: Users are banned when they are not supposed to be.
S: Check your SAMP.BAN and make sure that it is empty.
-
P: I can't seem to update.
S: If the updater cannot reach the server and you are able to connect to the internet then there is a problem on the updater side in which case please contact me.
-
P: Your install.php and index.php has a lot of errors/warnings.
S: Open your PHP.ini file on your web server and change 'error_reporting' to "error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED" and then save & restart your web server.
Functions
Code:
SHOBan(playerid); // Simple Ban, will post the banning administrator as "In-Game Ban" and the reason as "None", ban will be permanent. SHOBanEx(playerid, reason); // Simple Ban with reason, will post the banning administrator as "In-Game Ban" and the reason as stated in reason, ban will be permanent. SHOBanWithoutReason(playerid, administrator name); // Advanced Ban, Will post banning administrator as stated in second argument. SHOBanWithAdmin(playerid, reason, administrator name); // Advanced Ban, Will post reason and banning administrator.
N/A
FAQ
Q: Will it be better looking at any stage?
A: Yes, I am actually busy looking for someone to do some graphics for me, so if you know anyone, tell me.
-
Q: Will you be adding more features?
A: Yes, there are still lots more features to come.
Currently Working on
Version 1
Credits
StrikenKid (MySQL)
The unknown author of the split function
Contact me if you have any issues an I will try get around to assisting you, PM me or reply to this post.
NOTE: This is a beta release, there WILL be bugs!
NOTE: If someone tests this with IIS please let me know how it works out.
Thank you!
- Shoulen