· 6 years ago · Oct 06, 2019, 01:53 PM
1--[[-------------------------------------------------------------------
2 Global Ban! (gBan):
3 A simple solution to banning.
4 Powered by
5 _ _ _ ___ ____
6 __ _(_) | |_ / _ \/ ___|
7 \ \ /\ / / | | __| | | \___ \
8 \ V V /| | | |_| |_| |___) |
9 \_/\_/ |_|_|\__|\___/|____/
10
11 _____ _ _ _
12|_ _|__ ___| |__ _ __ ___ | | ___ __ _(_) ___ ___
13 | |/ _ \/ __| '_ \| '_ \ / _ \| |/ _ \ / _` | |/ _ \/ __|
14 | | __/ (__| | | | | | | (_) | | (_) | (_| | | __/\__ \
15 |_|\___|\___|_| |_|_| |_|\___/|_|\___/ \__, |_|\___||___/
16 |___/
17-------------------------------------------------------------------]]--[[
18
19 Lua Developer: King David
20 Contact: http://steamcommunity.com/groups/wiltostech
21
22 Web Developer: BearWoolley
23 Contact: N/A
24
25 Purchased at www.scriptfodder.com
26
27 THIS IS WHERE YOU'RE GOING TO CUSTOMIZE HOW GBAN WORKS!
28 FEEL FREE TO EDIT THIS FILE, AND FEEL FREE TO ASK QUESTIONS
29 IF SOMETHING IS CONFUSING.
30
31----------------------------------------]]--
32
33if not gBan.Config then
34 gBan.Config = {}
35end
36
37-- Your MySQL Connection info
38gBan.Config.SQL = {
39 Host = "127.0.0.1", -- IP to connect to the database server with.
40 Username = "root", -- User to connect to the database with.
41 Password = "fffff", -- Password to connect to the database with.
42 Database = "gban", -- Database to connect too, make sure this is created.
43 Port = 3306 -- Port, if you're not sure what it is, most likely it's the default 3306.
44}
45
46-- How long before we retry connecting to the database assuming we failed? IN SECONDS ( Def. 30 seconds )
47gBan.Config.SQLRetry = 30
48
49-- Enable this if you want gBan to log events into the console
50gBan.Config.EnableLogging = true
51
52-- API Key. This is now an integral part of the system and IS required. It's extremely easy to get one.
53-- You can find your steam key at: https://steamcommunity.com/dev/apikey
54gBan.Config.APIKey = "41CCBE273B57134619A50AC96BE2C0B0"
55
56-- Enable this if you want gBan to check family shared accounts for bans
57-- This will NOT work without a steam API key above. Make sure you have one!
58gBan.Config.SharedFamilyBan = false
59
60-- Enable this if you want gBan to check the IP of a player for bans. Keep in mind this will ONLY work if the player was banned in the server and not through the steamID.
61-- Keep in mind this will increase load on the server if you have a lot of banned players! You may also wrongfully ban players who play on public domains!
62gBan.Config.IPBanning = false
63
64-- Enable this if you want gBan to sync with TTT Karma bans
65-- You should only have this enabled if you're hosting a TTT server ( duh )
66gBan.Config.EnableTTT = false
67
68-- Enable this if you want gBan to sync with CAKE Anti Cheat
69-- Only enable this if you have !cake Anti Cheat installed, otherwise you will see errors!
70gBan.Config.EnableCAC = false
71
72-- Enable this if, for whatever reason, you don't want ULX Bans to be global across servers.
73-- If this is enabled, you will have to use gBan's manual functions to ban globally.
74-- Highly advise not enabling this unless you have a very, very, VERY particular reason for doing it.
75gBan.Config.DisableULX = false
76
77-- How often you want the server to refresh it's data from your database IN SECONDS ( Def. 300 seconds )
78-- If you're experiencing server performance issues, increase this number to reduce strain on the server.
79gBan.Config.RefreshRate = 300
80
81-- The limit of how many entries an allocated table will contain when sent to the client. IE: A table of 500 will be split into 5 tables of 100 entries. ( Def. 100 entries )
82-- This is mainly used for ban lists that are EXTREMELY LARGE to prevent high loads on the client
83-- If you're experiencing server performance issues or NET errors, try LOWERING this number.
84-- If you don't know what you're doing, it's better not to touch this :)
85gBan.Config.EntryAllocation = 100
86
87-- If your server is having instability while using gBans or you have a ban list of over 10,000 entries ( Wow! ) then
88-- set this to true. It will delay the history being sent to the client until AFTER the bans are synced. Be aware that the
89-- client will not immediately be able to open the ban menu with this delay.
90gBan.Config.DelayHistory = false
91
92-- This controls if a user has permission to ban someone
93-- Higher the value, higher the priority
94-- If a value is the same in two ranks, those two are matched with power and cannot ban one another
95-- DO NOT ADD THE DEFAULT USERS HERE OR THEY WILL HAVE ACCESS TO ADMIN SETTINGS AND BAN PLAYERS
96-- I REPEAT, DO NOT PUT DEFAULT USER GROUPS HERE! THIS IS HIERARCHY FOR PEOPLE WHO ARE ADMINS ONLY!
97gBan.Config.Hierarchy = {
98 ["Owner"] = 5,
99 ["superadmin"] = 4,
100 ["Developer"] = 4,
101 ["admin"] = 3,
102 ["DAdmin"] = 3,
103}
104
105-- The color of gBan tags in chat. If you don't like the color red, change it up!
106gBan.Config.IDColor = Color( 255, 0, 0 )
107
108-- If you don't know how to edit this and you're using ulx, keep it the same.
109gBan.Config.CanBan = function( ply, vic )
110
111 if not gBan.Config.Hierarchy[ ply:GetNWString( "usergroup" ) ] then return false end
112
113 if gBan.Config.Hierarchy[ ply:GetNWString("usergroup") ] >= ( gBan.Config.Hierarchy[ vic:GetNWString( "usergroup" ) ] or 0 ) then return true end
114
115 return false
116
117end