Advertisement
Guest User

Untitled

a guest
Aug 12th, 2016
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.19 KB | None | 0 0
  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.  
  33. if not gBan.Config then
  34. gBan.Config = {}
  35. end
  36.  
  37. -- Your MySQL Connection info
  38. gBan.Config.SQL = {
  39. Host = "173.208.205.131", -- IP to connect to the database server with.
  40. Username = "benanhur", -- User to connect to the database with.
  41. Password = "pepsibenoit94", -- 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 )
  47. gBan.Config.SQLRetry = 30
  48.  
  49. -- Enable this if you want gBan to log events into the console
  50. gBan.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
  54. gBan.Config.APIKey = "74C68D5BE7AD0AB59B03C560CAC8D8EC"
  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!
  58. gBan.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!
  62. gBan.Config.IPBanning = true
  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 )
  66. gBan.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!
  70. gBanConfig.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.
  75. gBan.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.
  79. gBan.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 :)
  85. gBan.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.
  90. gBan.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. gBan.Config.Hierarchy = {
  96. ["Owner"] = 5,
  97. ["superadmin"] = 4,
  98. ["Developer"] = 4,
  99. ["admin"] = 3,
  100. ["DAdmin"] = 3,
  101. ["user"] = 2,
  102. ["DEFAULT_USER"] = 1
  103. }
  104.  
  105. -- The color of gBan tags in chat. If you don't like the color red, change it up!
  106. gBan.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.
  109. gBan.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.  
  117. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement