• kontrol - Administration in Moderation
    113 replies, posted
  • Take ASSMod for an example, it has a prop protection plugin built in, but it sucks. If you want a prop protection addon you should go with standalone stuff, anyway I've finished bring and goto.
  • It's a bit optimistic but here it goes :) [b]A strikeout plugin :O[/b] -Simply, whenever a player is banned (Or they are banned for over 24hours), they recieve one strike point which is added to their account -Once the player reaches the strikeout limit they are permently banned from the server -The strikeout limit is set via a variable that can be changed in the menu -Also have commands to set (Add/Remove) points from a players SteamID or however kontrol registers and stores player details Hope you take this into account, and I feel if included and enabled with MySQL it would be great as server owners could control this system via their website aswell and therefore be able to add points to players without them being ingame :)
  • [QUOTE=xomaxhox;28386620]It's a bit optimistic but here it goes :) [b]A strikeout plugin :O[/b] -Simply, whenever a player is banned (Or they are banned for over 24hours), they recieve one strike point which is added to their account -Once the player reaches the strikeout limit they are permently banned from the server -The strikeout limit is set via a variable that can be changed in the menu -Also have commands to set (Add/Remove) points from a players SteamID or however kontrol registers and stores player details Hope you take this into account, and I feel if included and enabled with MySQL it would be great as server owners could control this system via their website aswell and therefore be able to add points to players without them being ingame :)[/QUOTE] Sounds like a really simple yet effective plugin, thanks for the idea! All I have to do is kill you so that when I start charging a monthly subscription fee to use this plugin, nobody will know you are the original author..
  • [QUOTE=Kopimi;28394051]Sounds like a really simple yet effective plugin, thanks for the idea! All I have to do is kill you so that when I start charging a monthly subscription fee to use this plugin, nobody will know you are the original author..[/QUOTE] Sounds good :P
  • I like the slogan a lot, it's pretty catchy. Also the colours of the UI aren't bad at all like [del]Prefan's is (can't remember the name)[/del] Exsto.
  • I'm sick of all the admin mods being created recently but daaaammmn this looks sexy. Rated artistic. EDIT: A suggest as well for people who are too shit with lua to even work this: [code]if !pl:KAdmin() && !pl:KModerator() then return end[/code] I reckon you can have "Default" settings for who gets to use the commands and you can set permissions in the derma menu. (My opinion to change shit on the fly instead of having to restart the server again and again)
  • I have a small suggestion, you should override the default IsAdmin and IsSuperAdmin commands, so this can be used with gamemodes and stuff without having to change too much.
  • [QUOTE=Buggzie;28415080]I'm sick of all the admin mods being created recently but daaaammmn this looks sexy. Rated artistic. EDIT: A suggest as well for people who are too shit with lua to even work this: [code]if !pl:KAdmin() && !pl:KModerator() then return end[/code] I reckon you can have "Default" settings for who gets to use the commands and you can set permissions in the derma menu. (My opinion to change shit on the fly instead of having to restart the server again and again)[/QUOTE] [lua]return !pl:KAdmin() and !pl:KModerator()[/lua]
  • [QUOTE=Banana Lord.;28417546][lua]return !pl:KAdmin() and !pl:KModerator()[/lua][/QUOTE] Then the function would always instantly return and never be run. [editline]4th March 2011[/editline] Also, good news! Loures has volunteered to help develop kontrol since I'm too busy to really put all my effort into it. Say hello to your new kontrol developer, Loures :buddy:
  • I will add some plugins and fix some stuff whenever I get SVN access.
  • [QUOTE=Kopimi;28421902]Then the function would always instantly return and never be run. [editline]4th March 2011[/editline] Also, good news! Loures has volunteered to help develop kontrol since I'm too busy to really put all my effort into it. Say hello to your new kontrol developer, Loures :buddy:[/QUOTE] [lua]return pl:KAdmin() or pl:KModerator()[/lua]
  • Again, doing a return in a function returns the value and [B]stops the function.[/B]
  • He was doing "if player isnt an admin and isnt a moderator then stop function" You can do it in a shorter way with how I did it. Return true if admin or moderator. errr, that should be !pl:KAdmin() and !pl:KModerator(). or IDK. But either way, it was shorter than his if statement.
  • [QUOTE=Banana Lord.;28429946]He was doing "if player isnt an admin and isnt a moderator then stop function" You can do it in a shorter way with how I did it. Return true if admin or moderator. errr, that should be !pl:KAdmin() and !pl:KModerator(). or IDK. But either way, it was shorter than his if statement.[/QUOTE] And doesn't run the rest of the code IN ANY CASE :downsbravo: Don't blame your stupidity on Lua.
  • [QUOTE=Banana Lord.;28429946]He was doing "if player isnt an admin and isnt a moderator then stop function" You can do it in a shorter way with how I did it. Return true if admin or moderator. errr, that should be !pl:KAdmin() and !pl:KModerator(). or IDK. But either way, it was shorter than his if statement.[/QUOTE] GET OUT OF MY THREAD, SHOO, BE GONE WITH YOU. Your stupid is leaking all over my freshly waxed floors, get out already!
  • Listen 'ere, kiddo. Your scripting sucks something awful, and I'll explain why, so hang tight. [url]http://kontrol-mod.googlecode.com/svn/trunk/lua/plugins/ban.lua[/url] [list] [*] This does not need to be a shared file, none of your so-called "plugins" do, all you're achieving with this structure is that you're sending all the serverside code to a client that doesn't need it, and forcing the serverside lua instance to parse (though not execute) your clientside code. [*] You're repeating code like this was an essay with a minimum word count that you couldn't figure out how to live up to. Throw the shit from SQL_ACTIVE outside of it, and keep the SQL query itself inside it. This goes for pretty much all(read: all) of your SQL code. [*] Globals, globals everywhere (Thanks CapsAdmin). It's pretty naïve to think that no other addon, gamemode or lua file will ever use the global variable "Ban", "plugins" or "Kick". Use globals for crying out loud! You're not accessing them anywhere else but in this file! Better yet, skip the variable bit and feed the function straight into the call to concommand.Add. [lua]concommand.Add( "I'm a lousy coder", function(pl, cmd, args ) print( "It's true!" ) end )[/lua] [*] On line 159 through 185, you seem to have caught a bad case of the Nullsquared. Use a table, this will make your life so much easier, and you can even reuse it when filling your menu on line 139! [/list] [url]http://kontrol-mod.googlecode.com/svn/trunk/lua/cl_init.lua[/url] [list] [*] Throw all your functions, variables, whatnots and haveswhats in a global table, because [list] [*] Nested lists, whatcha gonna do, bitch? [*] Lua doesn't have to look through a million Ban, BanMenu, kontrolMenu, MAIN_FRAME, etc. variables to find the one it's actually looking for [*] Makes your code neater [*] Safer, safer, safer, safer. [*] They're like locals, only they don't disappear when you turn your back. [/list] [*] Create your menu once and then use the fancy-cool function "SetVisible" to make it seemingly fade in and out of existence, it's like magic with less bunnies. [/list] [url]http://kontrol-mod.googlecode.com/svn/trunk/lua/autorun/server/kontrol.lua[/url] [list] [*] Do you have any idea what string.Explode does to the poor processor, not to what mention file.Read does to your harddrive? [*] And secondly, I- I'm just kidding bro, apart from the complete disinterest in minimizing the impact of your script on Gmod's performance, it's cool bro. [/list] [url]http://kontrol-mod.googlecode.com/svn/trunk/lua/init.lua[/url] [url]http://kontrol-mod.googlecode.com/svn/trunk/lua/plugins/mute.lua[/url] [url]http://kontrol-mod.googlecode.com/svn/trunk/lua/plugins/unban.lua[/url] [list] [*] Don't [*] Send [*] Lua [*] "But it's just one string, no harm, right?" - Wrong. One string is 'kay, but there's more than one script running on a Gmod server or client at any given time, see. And if each of those wants to SendLua just one tiny string, it all adds up pretty fucking fast. If everyone stopped thinking "Just one string, it won't hurt" and started thinking "YES I CAN SAVE 100 BYTES BY NOT BEING A QUEER" Gmod would run noticeably faster (Won't get rid of Sleep(30000) though). [/list] [url]http://kontrol-mod.googlecode.com/svn/trunk/lua/shared.lua[/url] [lua] hook.Add("Initialize", "InitKontrol", function() print("\n< kontrol initialized " .. (CLIENT && "client" || "server") .. "side >\n") end) [/lua] - If you absolutely must notify everyone of your adminmods existence. Just because your adminmod was designed with "stupidly simplistic ideals in mind", doesn't mean it has to be simplistically stupid.
  • [quote=Dr Magnusson][i]good points[/i][/quote] I think all that is, in his opinion, "avoiding object-oriented programming, with which everyone else is obsessed".
  • It would be effort to do, but maybe if you could create a Vote Kick and Vote Ban plugin and also a chat command for anyone to start it with (Also in single player why when I type "!" into my chat does the menu not come up :l I put my SteamID and name into there before for something else but then removed it, could that have messed something up?)
  • [QUOTE=Dr Magnusson;28439193]Asserting my dominance by showing you how bad you are at everything grah grah grah[/QUOTE] Pardon me for not being an amazing Lua scripter. If you think my scripting is bad it'd be fine to point out my errors without seeming like you have a personal vendetta against me because I used globals. I made a script for myself and enjoyed it so I felt like I'd share, I don't see why it's necessary for you to nitpick at even little things like sending an initialization message through the console (Which almost all modern admin mods do in case you haven't noticed) and pretend I'm calling myself the patriarch of modern programming because I wrote an admin mod. So thanks for at least pointing out the many things I've done wrong (:v:), but the way you did it just makes you look like a douche. (But holy shit reading your post I did do a shitty job :O) And then again, even though you point out tons of little instances where I'm being wasteful of system resources and "abusing" the server's poor poor processor, the admin mod works. I haven't seen any loss in performance from my server due to all these bountiful cases of lazy scripting, so it confuses me even more as to why you blow it so far out of proportion.
  • I don't recommend people use this... [url=http://pirate-servers.com/bans/]Link.[/url] [img_thumb]http://img845.imageshack.us/img845/1977/lolololo.png[/img_thumb]
  • The bad scripting practices of some addons has long bothered me, yours was just a particularly good example of a lot of the common ones. The rant wasn't only aimed at you, I'm just a little fed up with how people release addons filled to the brim with ineffecient pieces of code. [QUOTE=Kopimi;28447853]And then again, even though you point out tons of little instances where I'm being wasteful of system resources and "abusing" the server's poor poor processor, the admin mod works. I haven't seen any loss in performance from my server due to all these bountiful cases of lazy scripting, so it confuses me even more as to why you blow it so far out of proportion.[/QUOTE] As I believe I pointed out near the end of the rant, a single inefficient script isn't gonna make an impact (unless it is particularly horrible), but servers often have hundreds of scripts running concurrently, and if every one of them is paying no attention to resource usage, you'll end up with a server performing well below what it could be, if everyone cared just a little bit. A pretty good example of this, would be one of the old Resource Distribution, or Life Support addons. They would use Networked variables on the entity to update the resource production/consumption of every single life support entity every second, regardless of whether the player needed it or not. For one entity, this wasn't a problem, but when you have 8-players all flying around in their ridiculous supercarriers completely alone, with 10 fusion reactors and 200 auxiliary life support systems, the server tends to notice. [editline]6th March 2011[/editline] Just noticed you're using VARCHAR(255) to store the IDs of players in your ranks table. VARCHAR(255) means that the id accepts up to 255 characters, which is completely unnecessary. Use an unsigned integer data-type instead and store the Unique ID. 255 bytes is enough space to store integers up to a size of 126238304966058622268417487065116999845484776053576109500509161826268184136202698801551568013761380717534054534851164138648904527931605160527688095259563605939964364716019515983399209962459578542172100149937763938581219604072733422507180056009672540900709554109516816573779593326332288314873251559077853068444977864803391962580800682760017849589281937637993445539366428356761821065267423102149447628375691862210717202025241630303118559188678304314076943801692528246980959705901641444238894928620825482303431806955690226308773426829503900930529395181208739591967195841536053143145775307050594328881077553168201547776 And I'm fairly sure there aren't that many Gmod players out there, so just use the standard unsigned integer, it's good for a few billion I believe!
  • Lmao, our server just got our asses handed to us because apparently there's a huge exploit in the mod, sorry for bothering to release this to you guys, I hope it didn't do any harm, yet. Going to try and keep my lazy scripts to myself from now on lol. And kudos to Zack and Drew for the exploitation, it was pretty funny logging onto Steam and seeing a million people complaining about "random bans" Oh well, fun while it lasted :v:
  • [QUOTE=Drew P. Richard;28462366]Good thing you noticed how we got in.[/QUOTE] To be honest I'm still searching for the problem lol Not my favorite way to end a day of shooting but at least its entertaining hehe Whoop found the issue, pretty stupid lol. Thats what I get for releasing a 2 day script :smithicide: