Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player_GetBySteamID = player.GetBySteamID
- function report_to_admins(desc)
- for k, ply in pairs(player.GetAll()) do
- if ply:GetNWInt("stankRank", 1) >= 2 then ply:PrintMessage(HUD_PRINTCONSOLE, desc) end
- end
- end
- net.Receive("SubmitPlayerReport", function(len, ply)
- if not IsValid(ply) or ply.reportblacklisted then return end
- local reporterSID = net.ReadString() or ""
- local reportedSID = net.ReadString() or ""
- local category = net.ReadString() or ""
- local reason = net.ReadString() or ""
- if #reporterSID > 256 or #reportedSID > 256 or #category > 256 or #reason > 256 then
- blacklist_player(ply, "submitted parameters exceeding length limits")
- return
- end
- local REAL_REPORTER = player_GetBySteamID(reporterSID)
- local REAL_REPORTED = player_GetBySteamID(reportedSID)
- if not REAL_REPORTER or not REAL_REPORTED then
- blacklist_player(ply, "invalid reporter or reported")
- return
- end
- if REAL_REPORTER ~= ply then
- blacklist_player(ply, "false reporter origin")
- return
- end
- if category == "" or reason == "" or #reason < 4 then
- blacklist_player(ply, "invalid category or insufficient reason")
- return
- end
- ply.reportcounts = (ply.reportcounts or 0) + 1
- if ply.reportcounts > 20 then
- blacklist_player(ply, "exceeded report limit")
- return
- end
- local desc = table.concat({"Report Sys", REAL_REPORTER:Nick() .. " - " .. REAL_REPORTER:SteamID(), REAL_REPORTED:Nick() .. " - " .. REAL_REPORTED:SteamID(), "category: " .. category, "reason: " .. reason}, "\n")
- report_to_admins(desc)
- if IsValid(REAL_REPORTED) then
- if (category == "Cheating / Exploiting") then
- net.Start("supercss_msg")
- net.WriteString("Report received. " .. REAL_REPORTED:Nick() .. " will be closely monitored for cheats.")
- net.Send(ply)
- REAL_REPORTED.suspected = true
- antihake.Reporter(REAL_REPORTED)
- --game.ConsoleCommand("antihake_report " .. REAL_REPORTED:Nick() .. "\n")
- else
- net.Start("supercss_msg")
- net.WriteString("Report received.")
- net.Send(ply)
- end
- end
- end)
- hook.Add("PlayerSay", "OpenReportMenuCommand", function(ply, text) if string.lower(text) == "!report" then ply:ConCommand("super_report") end end)
Advertisement
Add Comment
Please, Sign In to add comment