Guest User

Console's beautiful report system

a guest
Apr 19th, 2026
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. local player_GetBySteamID = player.GetBySteamID
  2.  
  3. function report_to_admins(desc)
  4. for k, ply in pairs(player.GetAll()) do
  5. if ply:GetNWInt("stankRank", 1) >= 2 then ply:PrintMessage(HUD_PRINTCONSOLE, desc) end
  6. end
  7. end
  8.  
  9. net.Receive("SubmitPlayerReport", function(len, ply)
  10. if not IsValid(ply) or ply.reportblacklisted then return end
  11. local reporterSID = net.ReadString() or ""
  12. local reportedSID = net.ReadString() or ""
  13. local category = net.ReadString() or ""
  14. local reason = net.ReadString() or ""
  15. if #reporterSID > 256 or #reportedSID > 256 or #category > 256 or #reason > 256 then
  16. blacklist_player(ply, "submitted parameters exceeding length limits")
  17. return
  18. end
  19.  
  20. local REAL_REPORTER = player_GetBySteamID(reporterSID)
  21. local REAL_REPORTED = player_GetBySteamID(reportedSID)
  22. if not REAL_REPORTER or not REAL_REPORTED then
  23. blacklist_player(ply, "invalid reporter or reported")
  24. return
  25. end
  26.  
  27. if REAL_REPORTER ~= ply then
  28. blacklist_player(ply, "false reporter origin")
  29. return
  30. end
  31.  
  32. if category == "" or reason == "" or #reason < 4 then
  33. blacklist_player(ply, "invalid category or insufficient reason")
  34. return
  35. end
  36.  
  37. ply.reportcounts = (ply.reportcounts or 0) + 1
  38. if ply.reportcounts > 20 then
  39. blacklist_player(ply, "exceeded report limit")
  40. return
  41. end
  42.  
  43. local desc = table.concat({"Report Sys", REAL_REPORTER:Nick() .. " - " .. REAL_REPORTER:SteamID(), REAL_REPORTED:Nick() .. " - " .. REAL_REPORTED:SteamID(), "category: " .. category, "reason: " .. reason}, "\n")
  44. report_to_admins(desc)
  45.  
  46. if IsValid(REAL_REPORTED) then
  47. if (category == "Cheating / Exploiting") then
  48. net.Start("supercss_msg")
  49. net.WriteString("Report received. " .. REAL_REPORTED:Nick() .. " will be closely monitored for cheats.")
  50. net.Send(ply)
  51. REAL_REPORTED.suspected = true
  52. antihake.Reporter(REAL_REPORTED)
  53. --game.ConsoleCommand("antihake_report " .. REAL_REPORTED:Nick() .. "\n")
  54. else
  55. net.Start("supercss_msg")
  56. net.WriteString("Report received.")
  57. net.Send(ply)
  58. end
  59. end
  60. end)
  61.  
  62.  
  63. 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