//karma.lua - at the end of the KARMA.ApplyKarma function if ply:GetBaseKarma() <= 700 then umsg.Start( "LowKarmaWarning", ply ) umsg.Entity( ply ) umsg.End() end//cl_init.lua - at the end of the scriptlocal function WarningReceived( data ) local ply = data:ReadEntity() if !IsValid( ply ) then return end local color_red = Color(255,0,0) local color_gold = Color(255,165,0) chat.AddText( color_red, "Warning", ply:Nick(), color_gold, " Low Karma: ", color_red, ply:GetBaseKarma(), color_gold, " Be Careful Autokick is at ", color_red, GetConVarString( "ttt_karma_low_amount" ) )endusermessage.Hook( "LowKarmaWarning", WarningReceived )
gui.EnableScreenClicker(false) end) gui.EnableScreenClicker(true) elseif CurTime() > (idle.t + (idle_limit / 2)) then -- will repeat MSTACK:AddMessage("WARNING: YOU APPEAR TO BE IDLE/AFK, AND WILL BE MADE TO SPECTATE UNLESS YOU SHOW ACTIVITY!") end end local function WarningReceived( data ) local color_red = Color(255,0,0) local color_gold = Color(255,165,0) chat.AddText( color_red, "Warning", LocalPlayer():Nick(), color_gold, " Low Karma: ", color_red, data:ReadString(), color_gold, "Be Careful Autokick is at", color_red, data:ReadString() )endusermessage.Hook( "LowKarmaWarning", WarningReceived )end
function KARMA.ApplyKarma(ply) local df = 1 -- any karma at 1000 or over guarantees a df of 1, only when it's lower do we -- need the penalty curve if ply:GetBaseKarma() < 1000 then df = 1 + -0.0000025 * ((ply:GetBaseKarma() - 1000)^2) end ply:SetDamageFactor(math.Clamp(df, 0.1, 1.0)) if IsDebug() then print(Format("%s has karma %f and gets df %f", ply:Nick(), ply:GetBaseKarma(), df)) end if ply:GetBaseKarma() < 700 then umsg.Start( "LowKarmaWarning", ply ) umsg.String( ply:GetBaseKarma() ) umsg.String( GetConVarString("ttt_karma_low_amount") ) umsg.End() endend
-- will repeat MSTACK:AddMessage("WARNING: YOU APPEAR TO BE IDLE/AFK, AND WILL BE MADE TO SPECTATE UNLESS YOU SHOW ACTIVITY!") end end end local function WarningReceived( data ) local color_red = Color(255,0,0) local color_gold = Color(255,165,0) chat.AddText( color_red, "Warning", LocalPlayer():Nick(), color_gold, " Low Karma: ", color_red, data:ReadString(), color_gold, " Be Careful Autokick is at ", color_red, data:ReadString() )endusermessage.Hook( "LowKarmaWarning", WarningReceived )