Garry's Mod Leaks
[LEAK] AWARN2
Submitted by tuturu1337, 03-12-2017, 07:34 PM, Thread ID: 63426
Thread Closed
SF:https://www.gmodstore.com/scripts/view/629
If you find this script useful, please leave a rating. It would help me out a lot. Thank you!
A Note about MySQL support: I have finally added MySQL support, thanks in part to the MySQL abstraction script written by FPtje(included). You will need to update your script to Version 3.0 or above and read the instructions below to set up MySQL support!
Please note: I will not provide support for setting up the MySQL modules. I am only providing compatibility for those modules. if you are having issues with the MySQL modules, please take that up with those authors.
In the spirit of full disclosure, there is a free version of AWarn2 available for download on my website. I would rather people use my script for free than to download a potentially harmful leak of it on some shady website. There are a couple minor differences between the free version and the one here, but nothing that will make it any less useful. If you can, please consider supporting me by buying the script here on ScriptFodder for $4. Thank you!
The free version does NOT have the MySQL support!
Link to Free Version: http://g4p.org/awarn2
If you are upgrading from the free version, thank you, but also note that Version 3.4 and later are NOT directly upgradable from the free version due to a change in the database structure. You must first download and install version 3.3, launch your server and let AWarn2 rebuild your database, and then download and install version 3.4 or later. Really very sorry for the inconvenience, but it's just how it is!
Description
Have you ever had players on your server that you feel are being annoying but you don't want to kick or ban them. Have you ever wished you knew if a player had been in trouble with other moderators while you were offline?
With AWarn2, all of this is as easy as opening a single VGUI panel. AWarn2 allows you to give warnings to a player.
The addon will them log that warning and any admin (or person who has access if using ULX/Evolve) will be able
to easily see every warning the player has ever received.
With a few configurations (all done inside of the VGUI Menu) the addon can also kick and/or ban players for receiving too many warnings.
Features
- Advanced script that allows administrators to warn players on their server.
- Warnings for players are stored on the server's SQLite databse.
- Administrators can easily view and track all warnings for all players connected to the server.
- NEW as of version 3.1 : Allows you to customize punishment options. This means you can have as many levels of kicking and banning as you want. Example: Kick after 3 warnings, ban for 30 minutes after 5 warnings, and ban permanently after 7 warnings. You can add as many levels as you like.
- NEW as of version 3.2.2: You can add users and groups to a blacklist. Players and groups that are blacklisted can not be warned. Period. This can be used to prevent abuse or potential abuse of AWarn2 to kick admins or to give special users or groups immunity. The blacklists are located in the awarn_settings.lua file.
- Configuration option to allow a player's active warnings to decay over time. All warnings are still logged and can be viewed.
- Stand-Alone but can be used with ULX/Evolve/Maestro to allow servers to give access of this script to non-admin groups/players (explained below)
- Hook callbacks for integration into your own scripts. Please do NOT redistribute AWarn2.
- Built in logging so you can see/monitor warnings and awarn related actions. (off by default)
- Support for language translations. See instructions in the sh_localization.lua file! Please send me any translations you do!
ULX/Evolve/Maestro/ServerGuard Compatibility
If you are using ULX/Evolve/Maestro, this addon will automatically detect that and adjust its permissions accordingly. By default admins and superadmins have access to use this addon. If you want to assign other usergroups access to this addon, just give them the following access flags.
awarn_view - This allows a player to view other players' warnings. (Defaults to Admin)
awarn_warn - This allows a player to warn other players. (Defaults to Admin)
awarn_remove - This allows a player to decrease another player's active warnings. (Defaults to Admin)
awarn_delete - This allows a player to delete all warnings for a player. (Defaults to Superadmin)
awarn_options - This allows a player to view and change the configurations for this script. (Defaults to Superadmin)
I have all of these access flags registered in XGUI so you can add the permissions right from the XGUI menu. They are under the AWarn category.
If you would rather do it manually, you can use:
ulx groupallow <group> <access flag> (example: ulx groupallow "member" "awarn_warn")
ulx userallow <group> <access flag> (example: ulx userallow "Mr.President" "awarn_warn")
If you are running Maestro you can use the following command to add the above permission flags to your groups.
ms rankflag admin awarn_view true
ms rankflag admin awarn_warn true
ms rankflag admin awarn_remove true
ms rankflag admin awarn_delete true
ms rankflag admin awarn_options true
Change out admin with the group name you are assigning the permissions to.
If you are using Evolve Admin Mod you will need to give the Privledges to whatever group or player you want to have access to AWarn functionality.
I am not familiar enough with Evolve to tell you how to give privledges using Evolve. If you need help doing that, contact the developers of Evolve or if someone would like to tell me, I will update this post.
If you are using ServerGuard, here is a handy tutorial on how to integrate AWarn2 into the ServerGuard permissions. Thanks to the author of this guide for writing it.
https://forums.gmodserverguard.com/threa...sions.127/
Chat Commands
- !warn - Opens the AWarn VGUI Menu.
- !warn <player> <reason> - Warns a player with a given reason.
Console Commands (All accessible from within the AWarn VGUI Menu)
- awarn_warn <player/steamid> <reason> - Warns a player with a given reason.
- awarn_removewarn <player/steamid> - Removes a single active warning from a player.
- awarn_deletewarnings <player/steamid> - Deletes all warnings from a player. CAUTION: This removes all history of warnings from a player.
- awarn_menu - Opens the AWarn VGUI Menu.
- awarn_options - Opens the AWarn VGUI Options menu.
Server ConVARS (Add these to your server.cfg to override settings)
- awarn_kick - Allow AWarn to kick players who reach the kick threshold. 1=Enabled 0=Disabled
- awarn_ban - Allow AWarn to ban players who reach the ban threshold. 1=Enabled 0=Disabled
- awarn_decay - If enabled, active warning acount will decay over time. 1=Enabled 0=Disabled
- awarn_reasonrequired - If enabled, admins must supply a reason when warning someone. 1=Enabled 0=Disabled
- awarn_decay_rate - Time (in minutes) a player needs to play for an active warning to decay (in enabled).
- awarn_reset_warnings_after_ban - If enabled, active warning count is cleared after a player is banned by awarn. 1=Enabled 0=Disabled
- awarn_logging - If enabled, AWarn will log actions to a data file. 1=Enabled 0=Disabled
- awarn_allow_warnadmin - Disable to disallow the warning of other admins. 1=Enabled 0=Disabled
Hook Callbacks
- AWarnPlayerWarned( Player target_ply, Player ply, String reason )
- target_ply - Player being warned
- ply - Warning Admin
- reason - Reason for warning
- target_ply - Player being warned
- AWarnPlayerIDWarned( String tarid, Player ply, String reason )
- tarid- 64bit SteamID of player being warned.
- ply - Warning Admin
- reason - Reason for warning
- tarid- 64bit SteamID of player being warned.
- AWarnLimitKick( Player target_ply )
- target_ply - Player being kicked for passing the warning kick threshold.
- target_ply - Player being kicked for passing the warning kick threshold.
- AWarnLimitBan( Player target_ply )
- target_ply - Player being banned for passing the warning ban threshold.
- target_ply - Player being banned for passing the warning ban threshold.
Installation
- Simply unzip and place the awarn2 folder into your addons folder.
- Start your server and type !warn to see the menu. Be sure to make any changes to the options menu you like.
- Open addons/awarn2/lua/awarn/modules/awarn_settings.lua and modify the warning threshold punishments to your liking.
- If installed on multiple servers sharing a single database, navigate to awarn2/lua/awarn/modules/awarn_sql.lua and edit the AWarn.ServerKey for each server (This is a unique identifier that will be stored along with the warning to allow you to tell which server the warning came from)
- Backup any settings files within AWarn2. This includes the SQL settings if using MYSQL, any custom punishment settings, localization changes, etc.
- Delete your current AWarn2 folder from addons and install the newest version. Do not just overwrite files.
- Go into and edit back in any custom changes or settings you had from before.
Doing a Factory Reset (Clear ALL warnings)
If you would like to completely remove all warnings from the database and start from scratch, I have provided an additional addon you can install (link below) that adds a console command that will do this. The reason I made it separate is to prevent any abuse or accidental deletions.
- Download the following addon: https://www.g4p.org/images/awarn2/awarn2_extensions.zip
- Extract the addon to your addons folder like you would any other addon.
- run the following command from your SERVER CONSOLE... or in game if you have the 'superadmin' rank.
awarn_cleardatabase
- You will get confirmation that the deletions were successful.
- Once you are done, please remove the addon to prevent any abuse or accidental deletions. You can always add it back later if you decide to factory reset again.
MySQL Installation (Information also in a README file inside the Addon zip folder)
- In your MySQL server, create a new database for Awarn2. In my example, I use awarn2 (You can use an existing database if you wish)
- Make sure you have an SQL user that has read and write access to that database.
- Open awarn2/lua/awarn/modules/awarn_sql.lua
- Edit the config at the top of the file with the information for your MySQL server.
- Restart your server and if configured properly, AWarn2 will create 2 tables inside the database you selected.
( awarn_playerdata and awarn_warnings )
Screenshots
Contact/Support
- You can contact me by e-mail at [email protected]
- You can also add me on Steam. www.steamcommunity.com/id/g4pmrp
- Make sure you read my policy on steam friends requests on my steam profile. Make a comment on my page as to why you're adding me or I will ignore the add. I get too many requests to accept everyone blindly. Thanks!
- Make sure you read my policy on steam friends requests on my steam profile. Make a comment on my page as to why you're adding me or I will ignore the add. I get too many requests to accept everyone blindly. Thanks!
- Notice: Email may be the best source as I'm not always at my computer.
RE: [LEAK] AWARN2
07-12-2017, 01:48 AM
#2 Thank you, I will try this addon! I had it before ..
RE: [LEAK] AWARN2
07-12-2017, 05:35 AM
#3 Ugly UI but good addon nonetheless, maybe can make some of my own improvements
RE: [LEAK] AWARN2
07-12-2017, 10:11 AM
#4 Thank for the download leak
I don't have the 15 messages on the forum :(
I don't have the 15 messages on the forum :(
Users browsing this thread: 2 Guest(s)