DarkRP - Auto Wanted

What it is:

When you attack a cop, it makes you wanted. Useful if your police can only arrest players if they’re wanted.

Video:
GIF, Because I’m lazy: https://a.pomf.se/dhjxun.gif

Download:
http://ge.tt/14UAqWB2/v/0?c - Place the folder inside the .7z into addons/darkrpmodification/modules/

Or, if you’re lazy like me:
http://pastebin.com/LcuBxc3g - Place in addons/darkrpmodification/modules/random_folder_name/your_file_name.lua

Please note: Making this whilst I’m learning Lua.

Since you’re learning I’m going to give you a little constructive criticism.
The config = config or {} does nothing in this case because your config table is local, and unless you have some addon with a global “config” (an addon shouldn’t do that though) it will never evaluate to true.
Speaking of globals, you should localize the “ILostThisFile3Times” or make it an anonymous function inside the hook.Add call.
The for loop for PrintMessage is unecessary because the global PrintMessage function will send to everyone.
Also, you might want to rethink your logic in the if statements. The victim will always be a player in the PlayerHurt hook, and you’re checking if the attacker is a player twice.
This is a pretty small thing, but when checking if something evaluates to true you don’t need (val == true); you can just use (val).
Shouldn’t the isWanted() check always return true since you set them to wanted directly above the check?
Lastly, there are a few grammar errors in the reasons, but that’s not a huge deal.
On another note, your indentation/spacing is quite inconsistent. If you’re aren’t already, I recommend using either notepad++ or sublime text to write GLua. There are specific plugins for GLua for each as well.
Overall, good job learning! I personally wouldn’t use this on a server because there could be accidents and it sort of takes a little away from being a police officer, though I can see how it might fit into others’ servers.

Link broken