• Changing TTT's default karma-ban to use sourcebans
    4 replies, posted
I am just triple checking if this would be a correct way to do it. In ttt's karma.lua, this is what the entire function is: [CODE] local reason = "Karma too low" function KARMA.CheckAutoKick(ply) if ply:GetBaseKarma() <= config.kicklevel:GetInt() then if hook.Call("TTTKarmaLow", GAMEMODE, ply) == false then return end ServerLog(ply:Nick() .. " autokicked/banned for low karma.\n") -- flag player as autokicked so we don't perform the normal player -- disconnect logic ply.karma_kicked = true if config.persist:GetBool() then local k = math.Clamp(config.starting:GetFloat() * 0.8, config.kicklevel:GetFloat() * 1.1, config.max:GetFloat()) ply:SetPData("karma_stored", k) KARMA.RememberedPlayers[ply:UniqueID()] = k end if config.autoban:GetBool() then ply:KickBan(config.bantime:GetInt(), reason) else ply:Kick(reason) end end end [/CODE] I would focus on this part: [CODE] if config.autoban:GetBool() then ply:KickBan(config.bantime:GetInt(), reason) else ply:Kick(reason) end [/CODE] Now, to use sourcebans, I don't believe there is a non-ulx way to do this since it's straight ULX integration so that's kind of obvious. So I'd have to make it run console commands. Is this the correct change to make here?: [CODE] if config.autoban:GetBool() then ply:ConCommand("ulx sban 1440 Karma too low.") else ply:Kick(reason) end [/CODE] I gotta say that's definitely incorrect spacing or quoting there, as I'm pretty sure "ulx sban", 1440, and "Karma too low." should be separated somehow someway, but I'm not sure how.
ttt_ban_type?
[QUOTE=Chessnut;47234005]ttt_ban_type?[/QUOTE] yes, it would not be using "sm_ban" or "ulx ban" though, so I can't use that configuration
It says it uses sm_ban if you set it to.
[QUOTE=Chessnut;47234432]It says it uses sm_ban if you set it to.[/QUOTE] [QUOTE=Jerpy;47234018]yes, it would not be using "sm_ban" or "ulx ban" though, so I can't use that configuration[/QUOTE] What I meant to say probably would've made more since if I said "I would not be using" instead of it. The ULX version integration of sbans uses ulx sban, not sm_ban. All sourcemod commands are nonexistent in any version of gmod sourcebans usually since it doesn't work. I'm just wondering how to get that console command in my first post working correctly
Sorry, you need to Log In to post a reply to this thread.