Author Topic: AWarn2 - Advanced Warning Module  (Read 170247 times)

0 Members and 2 Guests are viewing this topic.

Online MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2450
  • Karma: 376
    • View Profile
    • |G4P| Gman4President
AWarn2 - Advanced Warning Module
« on: March 06, 2014, 02:31:36 AM »
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"

examples:

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 reason

awarn_menu - Opens the AWarn GUI screen.
!warn (With no arguements) - Opens the AWarn GUI screen.

Hook Callbacks
AWarnPlayerWarned( Player target_ply, Player ply, String reason )
   target_ply - Player being warned
   ply - Warning Admin
   reason - Reason for warning
AWarnPlayerIDWarned( String tarid, Player ply, String reason )
   tarid - 64bit SteamID of player being warned.
   ply - Warning Admin
   reason - Reason for warning
AWarnLimitKick( 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!

v2.10
+ Fixed some permission issues with the ULX compatibility.
+ Changed how net messages are initialized to hopefully address some loading issues people have been having.

v2.9
+ 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.

v2.8
+ Fixed a potential display bug with kick/warning thresholds.

v2.7
+ Not relevant to ULX users. :)

v2.6
+ 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.

v2.5
+ Added some hook callbacks for integration into other scripts.

v2.4
+ updated how the chat warn function works. Hopefully fixing some issues people are reporting.

v2.3
+ Fixed an issue where reducing a player's active warnings wasn't working.

v2.2
+ 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.

v2.1
+ Long asked for feature. Admins with the delete permission can now right click on individual warnings and remove them from players.

v2.0
+ 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)

v1.7
+ 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.

v1.6
+ 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.

v1.5
+ 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.

v1.4
+ 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.

v1.3
+ You no longer are required to include "quotes" around your reason when using the console or chat.

v1.2
+ Didn't release here as it was just to add support for another Admin mod other than ULX.

v1.1
+Fixed an error with the script not working on dedicated servers.

v1.0
+Release

Questions/Comments: Feel free to ask them in this thread.

DOWNLOAD

DOWNLOAD
« Last Edit: February 19, 2016, 03:55:00 PM by MrPresident »

Neecoe

  • Guest
Re: AWarn2 - Advanced Warning Module
« Reply #1 on: March 06, 2014, 04:41:45 AM »
Warn menu not showing when i type !warn in chat. my group is "owner" Getting error : [ERROR] addons/awarn2/lua/autorun/sh_awarn.lua:109: attempt to call method 'AWCheckAdmin' (a nil value)

1. unknown - addons/awarn2/lua/autorun/sh_awarn.lua:109
 2. unknown - lua/includes/modules/concommand.lua:69
« Last Edit: March 06, 2014, 05:00:23 AM by Neecoe »

Online MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2450
  • Karma: 376
    • View Profile
    • |G4P| Gman4President
Re: AWarn2 - Advanced Warning Module
« Reply #2 on: March 06, 2014, 04:42:59 AM »
type in console:


ulx groupallow owner "awarn_admin"

Let me know if it works.

Online MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2450
  • Karma: 376
    • View Profile
    • |G4P| Gman4President
Re: AWarn2 - Advanced Warning Module
« Reply #3 on: March 06, 2014, 05:09:55 AM »
Are you getting any other errors in your console when you start your server?

Offline ojbristow

  • Newbie
  • *
  • Posts: 48
  • Karma: 0
    • View Profile
    • Superclocked
Re: AWarn2 - Advanced Warning Module
« Reply #4 on: March 06, 2014, 09:11:13 AM »
Looks like a major improvement - purchased through coder hire :)

Owen


Online MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2450
  • Karma: 376
    • View Profile
    • |G4P| Gman4President
Re: AWarn2 - Advanced Warning Module
« Reply #5 on: March 06, 2014, 09:55:11 AM »
There is a bug affecting dedicated servers. Im fixing it now. I'll upload here and to CH as soon as it's done.

Offline ojbristow

  • Newbie
  • *
  • Posts: 48
  • Karma: 0
    • View Profile
    • Superclocked
Re: AWarn2 - Advanced Warning Module
« Reply #6 on: March 06, 2014, 10:01:16 AM »
There is a bug affecting dedicated servers. Im fixing it now. I'll upload here and to CH as soon as it's done.
Better make it a good post, going to be your 1,500 :)

Owen


Offline Eccid

  • Full Member
  • ***
  • Posts: 115
  • Karma: 11
  • Hey, come on... We just met...
    • View Profile
    • Terror Abound! Steam Group
Re: AWarn2 - Advanced Warning Module
« Reply #7 on: March 06, 2014, 10:53:38 AM »
Just bought it. Well worth $4, probably more :P

Online MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2450
  • Karma: 376
    • View Profile
    • |G4P| Gman4President
Re: AWarn2 - Advanced Warning Module
« Reply #8 on: March 06, 2014, 11:06:19 AM »
Just updated to 1.1. Make sure you get it. Otherwise it will not work on dedicated servers. :\

Offline Eccid

  • Full Member
  • ***
  • Posts: 115
  • Karma: 11
  • Hey, come on... We just met...
    • View Profile
    • Terror Abound! Steam Group
Re: AWarn2 - Advanced Warning Module
« Reply #9 on: March 06, 2014, 11:27:10 AM »
I was about to make a post about that :P Looks awesome.

Also, the options don't seem to sync up with the setting I put. I have my settings set in the server.cfg, but the options window doesn't reflect what I set.
« Last Edit: March 06, 2014, 11:39:07 AM by Eccid »

Online MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2450
  • Karma: 376
    • View Profile
    • |G4P| Gman4President
Re: AWarn2 - Advanced Warning Module
« Reply #10 on: March 06, 2014, 11:44:41 AM »
Did you put them there manually? It should replicate the convars automatically. I'll look into it.

I just tested it on a dedicated server:

Set kick threshold to 38.
Shut down the server
Restarted the server and when I opened the menu, the slider was set to 38.
« Last Edit: March 06, 2014, 11:47:12 AM by MrPresident »

Neecoe

  • Guest
Re: AWarn2 - Advanced Warning Module
« Reply #11 on: March 06, 2014, 12:19:53 PM »
type in console:


ulx groupallow owner "awarn_admin"

Let me know if it works.

Thank you so much! This fixed it.  :D 

Online MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2450
  • Karma: 376
    • View Profile
    • |G4P| Gman4President
Re: AWarn2 - Advanced Warning Module
« Reply #12 on: March 06, 2014, 12:22:28 PM »
Also, make sure you are running the latest version too. There were a few other snafus I made.

Neecoe

  • Guest
Re: AWarn2 - Advanced Warning Module
« Reply #13 on: March 06, 2014, 02:41:40 PM »
I can't see warnings that i place.

(No errors, i just can't see them)
(Looks like they are not registering)
(I can see them in chat when i warn but not in the GUI)

Online MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2450
  • Karma: 376
    • View Profile
    • |G4P| Gman4President
Re: AWarn2 - Advanced Warning Module
« Reply #14 on: March 06, 2014, 06:31:48 PM »
I'm sorry, what?