Report a Player

I’m looking for someone that can create a lua script so the players will be able to report players.

This is how i want it to be(but not limited to):

  • The player types /report Blasphemy, that user is spamming!

Then that text will be added to a text file in “data/player_reports/reports.txt” with some additional information.

I tried making it myself, but i just don’t have the skills. :confused:

So this is both an opportunity to learn more lua, and a quick getaway.

I will make this if no one does. :slight_smile:

Done!

Things need to be done saving the persons steamid and name
Added steamid incase people spam it with name changer
[lua]
function Report(ply, text, team, death)
if not file.Find(“player_reports/reports.txt”) then file.CreateDir(“player_reports”) end
if (string.sub(text, 1, 7) == “/report”) then
local report = file.Read(“player_reports/reports.txt”)…ply:Name()…" SteamID: “…ply:SteamID()…” Reported: “…string.Replace(text,”/report","")…"
"
file.Write(“player_reports/reports.txt”, report)
return false – Don’t show people the text
end
end
hook.Add( “PlayerSay”, “Report”, Report )
[/lua]

I’ll make it, I want something in return.

:cawg: me-> :commissar: <-you

Cube, your code won’t work.


Error: cubescript.lua: Attempt to concat nil value...

Create the txt file first…