!report <name> <steam_id> <reason>

If you don’t understand what I’m getting at I can honestly say you’re retarded. It’s some type of system that logs reports of annoying players/ban requests in some file somewhere that I can look at daily and ban/watch those players. Also would be nice if you could log the reporter’s ID so I can ban abusers of it. Tanks

This shouldn’t be hard to do really. In fact, I might do it right now because I’m incredibly bored.

lol if you would I might just find a cookie for u


also, if you would, add any features you see fit, I can’t think of any right now but something like maybe it tells the player they have been reported and there is no point in running away

I’m already doing it because I am also really bored.

Already have the saving // reading feature done, also sending the table to you when requested (So you can read it ingame)

I’ll also make a UI for it, but since I’m waiting for GMod Tower to come online I probably won’t test it.



I don’t understand anything in that except “I’m already doing it because I am also really bored.”

Basically, I’ll make a basic menu for it which you can open in the game. The server will then read the report files and send them to you, so you can read them in further detail.

Edit: Oh wow, it’s 100 lines already xD

Wait, send them to me as in save them in a server folder or send them to me in a menu that I can open in game?

They save in a server folder, and the server sends them to you when you wish to view them in the menu I made.

Because if it sent them to me in a menu you know it would have to save them until I come back online.

… It saves to the server, so it will be there until you delete them. Your going offline would only mean it would need to send it again.

OrhcpO. Just let him get on with his generocity. No questions asked.

Meow much?

Im not a cat.

rawr much?*


And look at his post time then mine, he posted that while I was typing mine… Notice something wrong with your RAWR theory?

I dont have RAWR theory? [sp]Sorry, Im not one for Jokes.[/sp]

Anyhow, I could use this Flapjack, So thanks for doing it.

You must learn a law, material objects first, thanks second.


No offense flap :X


I have haxed FP and will now blow all ur pooters up omg what the hell just happened.


fucking FP, why cant they just have the editor?


fucking FP, why cant they just have the editor?


fucking FP, why cant they just have the editor?


omg octuple post much?

I’ll be testing this in a minute: This is untested code


ReportedTable = {}
function RecieveReportList(handler, id, encoded, decoded)
	ReportedTable = decoded
datastream.Hook( "SendReportList", RecieveReportList )

function Menu()
	if !LocalPlayer():IsAdmin() or !LocalPlayer():IsSuperAdmin() then return end
	frame = vgui.Create("DFrame")
	frame:SetSize(ScrW() / 2 + 200 , ScrH() / 2 + 150)
	frame:SetTitle("Thank ¦FlapJack¦ for this awesome report system")
	listview = vgui.Create("DListView")
	listview:SetSize(frame:GetWide() - 40 , frame:GetTall() - 25)
	listview:SetPos(5 , 10)
	listview:AddColumn("# reports")
	listview:AddColumn("Name at first report")
	listview:AddColumn("First report")
	for k , v in pairs(ReportedTable) do
" , v) - 1 , string.Explode("|" , v[1])[1] , string.Explode("|" , v[1])[2] , v[3])
	listview.OnRowSelected = function(panel , line)
		for k , v in pairs(ReportedTable) do
			if string.find(listview:GetLine(line):GetValue(3) , v[1]) then
				playerinfo = vgui.Create("DFrame")
				playerinfo:SetTitle("Viewing "..string.Explode("|" , v[1]).."'s reports")
				playerinfo:SetSize(ScrW()/2 , ScrH() / 2)
				reportList = vgui.Create("DListView")
				reportList:SetSize(playerinfo:GetWide() - 40 , playerinfo:GetTall() - 100)
				reportList:SetPos(5 , 10)
				plReports = string.Explode("
" , v[3])
				for a , b in pairs(plReports) do
					if a > 1 then
						reportList:AddColumn(a , string.Explode("|" , v[1])[1] , string.Explode("|" , v[1])[2] ,b)
				BanButton = vgui.Create("DButton")
				BanButton:SetPos(5 , reportList:GetTall() + 5)
				BanButton.DoClick = function()
					banui = vgui.Create("DFrame")
					banui:SetSize(ScrW() / 3 , ScrH() / 3)
					banui:SetText("Ban player "..string.Explode("|" , v[1])[1])
					lengthenter = vgui.Create("DTextEntry")
					lengthenter:SetPos(5 , 10)
					lengthenter:SetSize(banui:GetWide() - 60 , 25)
					lengthenter:SetText("Enter ban length")
					BanButton2 = vgui.Create("DButton")
					BanButton2:SetSize(banui:GetWide() - 60 , 25)
					BanButton2:SetPos(5 , 40)
					BanButton2:SetText("Swing teh banhammer")
					BanButton2.DoClick = function()
						RunConsoleCommand("ReportBan" , lengthenter:GetInt() , string.Explode("|" , v[1])[2])
						timer.Simple(0.5 , function() banui:Close() end )
concommand.Add("Reports_View" , Menu)


function Report(ply , text ,team)
	if !string.sub(string.lower(text) , 0 , 7) == "!report" then return end // Return it so as it doesn't run
	Reason = "" //Reset the reason from the last time it was run
	// Lets check it isn't being spammed
	if not NextToRun then NextToRun = 0 end
	if NextToRun > CurTime() then ply:ChatPrint("You can't report that often!!") return end
	//Now let's seperate the chat arguments
	chatArgs = string.Explode(" " , text)
	for a , b in pairs(chatArgs) do // Loop through the chat arguments
		if !string.find(chatArgs[2] , "STEAM") then // If the player didn't include a steamid
			if a > 1 then 
				Reason = Reason..b
		elseif a > 2 then // Make sure it isn't the steamid or name
			Reason = Reason..b
	// Check If this matches to a player
	for k , v in ipairs(player.GetAll()) do // Loop through all players
		if #string.find(string.lower(chatArgs[1]) , string.lower(v:Nick())) == 1 then // We only want one player
			// Now let's see if a player has been reported before
			if file.Exists("ReportedPlayers/"..v:SteamID():gsub(":" , "_")..".txt") then
				oldFile = file.Read("ReportedPlayers/"..v:SteamID():gsub(":" , "_")..".txt")
				file.Write("ReportedPlayers/"..v:SteamID():gsub(":" , "_")..".txt", oldFile.."
				file.Write("ReportedPlayers/"..v:SteamID():gsub(":" , "_")..".txt", v:Nick().."|"..v:SteamID().."
		elseif chatArgs[2] == v:SteamID() then
			if file.Exists("ReportedPlayers/"..v:SteamID():gsub(":" , "_")..".txt") then
				oldFile = file.Read("ReportedPlayers/"..v:SteamID():gsub(":" , "_")..".txt")
				file.Write("ReportedPlayers/"..v:SteamID():gsub(":" , "_")..".txt", oldFile.."
				file.Write("ReportedPlayers/"..v:SteamID():gsub(":" , "_")..".txt", v:Nick().."|"..v:SteamID().."
	NextToRun = CurTime() + 30 // Only one person can be reported every half minute
hook.Add("PlayerSay" , "ReportHook" , Report) // Hook it so as the --[[function]] gets called every time a player talks

function ReadReports(ply , cmd , args)
	ReportedTable = nil
	ReportedTable = {} // Clear the table so as it doesn't lag the server when sending it
	if !ply:IsAdmin() or !ply:IsSuperAdmin() then return end // Check player is admin
	for k , v in pairs(file.Find("ReportedPlayers/*.txt")) do
		table.insert(ReportedTable , string.Explode("
" , file.Read("ReportedPlayers/"..v)) )
	datastream.StreamToClients(ply , "SendReportList", ReportedTable) // Send the table
concommand.Add("RecieveReports" , ReadReports)

function BanaPlayer(ply , cmd , args)
	if !ply:IsAdmin() or !ply:IsSuperAdmin() then ply:ChatPrint("Fuck off, you arn't allowed to ban people") return end
	steamid = ""
	for k , v in pairs(args) do
		if k > 1 then
			steamid = steamid..v
	RunConsoleCommand("banid" , math.floor(tonumber(args)) , steamid)
concommand.Add("ReportBan" , BanaPlayer)

Mine’s a bit simpler :v:

function ChatTextReporter( ply, txt, teamc, dead )
ply:ChatPrint( ReportFunc( txt ) or “” )

hook.Add( “OnPlayerChat”, “ChatTextReporter”, ChatTextReporter )

function ReportFunc( txt )

local text = string.Explode( ",", string.lower( txt ) )
local cmd = text[1]
local name = text[2]
local steamid = text[3]
local reason = text[4]

if ( cmd != "/report" and cmd != "!report" ) then return end
if ( name == nil or steamid == nil or reason == nil ) then return "Usage: !report &lt;name&gt;, &lt;steamid&gt;, &lt;reason&gt;" end

MsgN( "Reporting..." )
datastream.StreamToServer( "Report", { name, steamid, reason } )
MsgN( "Reported " .. name .. " with STEAM-ID " .. steamid .. ". Reason: " .. reason )

[lua]AddCSLuaFile( “autorun/client/reporter.lua” )

function ReportReceive( ply, handler, id, encoded, decoded )

MsgN( "Received report! Reading data..." )
local name = decoded[1]
local steamid = decoded[2]
local reason = decoded[3]
local reporter = ply
local r_nick = reporter:Nick()
local r_steamid = reporter:SteamID()
local time = os.date() //"%D_%T" 

local filename = Format( "reports/report_%s.txt", time )
local content = Format( "Subject name: %s 

Subject STEAM-ID: %s
Reason: %s

Reported by %s, with STEAM-ID %s", name, steamid, reason, r_nick, r_steamid )
file.Write( filename, content )
MsgN( filename … "
" … content )
ply:ChatPrint( “User " … name … " reported succesfully! Admins will look into the report as soon as possible.” )


datastream.Hook( “Report”, ReportReceive )
Doesn’t work completely yet. For some reason the files aren’t being saved.

whats the command for teh (or each as the situation may provide) menu

You didn’t define cmd :<

Also, the code I posted has some errors. Don’t use it yet.

Mine is reports_view