AWarn2 - New and Improved!
This addon allows admins to warn users and will display to them the reason they were warned.
The addon will keep track of all historic warnings for review by admins.
The addon now has a nice GUI that lets you do everything including viewing a player's warnings.
If enabled, once a user reaches a pre-configurable number of warnings, they are kicked from the server.
By default only admins/superadmins have access to this addon. If you are running ULX/ULib and you want to add more groups or users just assign them the following access flags.
awarn_view - This allows a player to view all players' warnings.
awarn_warn - This allows a player to warn players.
awarn_remove - This allows a player to reduce a player's active warnings.
awarn_delete - This allows a player to completely remove all warnings from a player.
awarn_options - This allows a player to view/edit the scripts configurations.
The access flags are registered in XGUI so adding them is as easy as using your in-game XGUI menu. You can also do it manually with the following ULX commands:
ulx userallow <player> "access_flag"
ulx groupallow <group> "access_flag"
ulx userallow "Mr.President" "awarn_warn"
ulx groupallow "moderator" "awarn_options"Commands:awarn_warn <player/steamid> <reason>
- Warn a player for a specified reason!warn <player> <reason>
- Warn a player for a specified reasonawarn_menu
- Opens the AWarn GUI screen.!warn (With no arguements)
- Opens the AWarn GUI screen.Hook CallbacksAWarnPlayerWarned
( Player target_ply, Player ply, String reason )
target_ply - Player being warned
ply - Warning Admin
reason - Reason for warningAWarnPlayerIDWarned
( String tarid, Player ply, String reason )
tarid - 64bit SteamID of player being warned.
ply - Warning Admin
reason - Reason for warningAWarnLimitKick
( Player target_ply )
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.
Click the image thumbs to view larger versions.Configurations (Note: these are server console variables. Run these from the server console)All configurations are done in the built-in configurations menu.Installation Instructions:
-Extract the awarn folder into your addons folder.
-Restart your server
-Enjoy!Modules: (THESE ONLY WORK WITH VERSION 2.0 AND ABOVE!)
- extract the single lua files into: garrysmod/addons/awarn2/lua/awarn/modules/
Module: Auto warn players for killing while noclipped.
Module: Auto warn players for killing while in god mode.
(Note: This only works with ULX)
Module: Auto warn players for team killing in TTT.
Module: More advanced TTT Module by Krogas.
- Description in the post linked.ChangeLog:v2.11
+ Rewrote the settings system. Back when I wrote AWarn2 clientside replicated convars weren't working so I wrote my own system but it was buggy for some people. I rewrote it to use convars. This doesn't affect how you use the script, but should make it MUCH less buggy for people who would lose or have their settings revert randomly!
+ Fixed some permission issues with the ULX compatibility.
+ Changed how net messages are initialized to hopefully address some loading issues people have been having.
+ Changed the Decay Rate slider to accept values up to 43,200 minutes (1 Month) The max value used to be 100. This should allow server owners to set warning decay rates greater than 100 minutes using the options menu.
+ Fixed a potential display bug with kick/warning thresholds.
+ Not relevant to ULX users.
+ awarn_deletewarnings and awarn_deletewarningsid can now be called from a dedicated server console (from server with lua too). This enables third party addons to access these functions for whatever reason.
+ Added some hook callbacks for integration into other scripts.
+ updated how the chat warn function works. Hopefully fixing some issues people are reporting.
+ Fixed an issue where reducing a player's active warnings wasn't working.
+ This is just a behind the scenes update. I moved a bunch of clientside console commands that were being used to send data to the server to Net Messages. This should fix some issues Listen Server admins were seeing when using AWarn2.
+ Long asked for feature. Admins with the delete permission can now right click on individual warnings and remove them from players.
+ Now fully modular.
+ Fixed some issues with printer a player's name as NULL if they were kicked or banned from the server as a result of being warned.
+ As of this version, you can now use the modules (listed above)
+ Now has support for 5 different permission levels if using ULX (which you all should be!!)
+ Server owners can now set up their AWarn so some users can view warnings but not warn players, or some can warn but not delete.
+ All 5 permission levels are registered in XGUI so you can add them to groups with ease! I will also explain them in the body of this post.
+ Shows a message to players who receive a warning showing them how many warnings they have and how many before they are kicked/banned (if enabled)
+ Shows a message to all connected admins when a player with active warnings joins the server.
+ You can now use any of the warning commands (awarnwarn, awarndeletewarnings, awarn_removewarn) from the server's console. This includes RCON such as HLSW.
+ You can now warn and manage warnings by SteamID. Just use a steamID instead of a player's name. This feature is only available through the console commands currently.
+ There was an oversight in the code that sometimes caused the addon to warn the wrong person. Fixed that.
+ The addon didn't correctly handle players with spaces in their name if you typed their whole name or used the GUI to clear or reduce their warnings. Fixed that.
+ Completely overhauled the way the addon stores configurations. They are no longer convars but instead synced globals that are stored in your server's database. (Eccid, this will fix your problem, but you no longer need to store the values in your server.cfg)
+ Added a client menu for non-admins to see their own warnings. Accessable to non-admins with !warn or awarn_menu
+ Added messages showing a player who is warned how many active warnings they have as well as how many until they are kicked/banned.
+ Added a message to any player who joins that has active warnings showing them how many they have as well as how many until they are kicked/banned.
+ Shows which version you are running in the menu.
+ Other minor bug fixes.
+ You no longer are required to include "quotes" around your reason when using the console or chat.
+ Didn't release here as it was just to add support for another Admin mod other than ULX.
+Fixed an error with the script not working on dedicated servers.
Questions/Comments: Feel free to ask them in this thread.