!reported (BLA BLA)
!lookForReported
= Reports List
USGN = {} dir = "sys/lua/data/" addhook("join", "_j") addhook("say", "_say") function _j(id) USGN[id] = player(id, "usgn") end function reportuser(id, res, reporter) local file = io.open (dir.."report.txt", "a+") if USGN[reporter] > 0 then if USGN[id] > 0 then file:write("#Date: "..os.date().." #Reported USGN: "..player(id, "usgn").." #Reported IP: "..player(id, "ip").." #Reason: "..res.." #Reporter name: "..player(reporter, "name").." #Reporter USGN: "..player(reporter, "usgn").."\n") else file:write("#Date: "..os.date().." #Reported Name: "..player(id, "name").." #Reported IP: "..player(id, "ip").." #Reason: "..res.." #Reporter name: "..player(reporter, "name").." #Reporter USGN: "..player(reporter, "usgn").."\n") end msg2(reporter, "Report is sent!") file:close() else msg2(reporter, "You must be logged in to usgn to report a player!") end end function _say(p, t) if t:sub(1, 7) == "!report" then 		local r = tonumber(t:sub(9,10)) 		local rs = t:sub(11) if player(r, "exists") then reportuser(r, rs, p) else msg2(p, "Reported user doesn't exist!") end 		return 1 end end
path = "sys/lua/reports.txt" pl = {} addhook("join", "_join") function _join(id) 	pl[id] = {} 	pl[id].usgn = player(id,"usgn") end addhook("say","_say") function _say(id, txt) 	if txt:sub(1,7)=="!report" then 		t = tonumber(txt:sub(8,9)) 		r = txt:sub(10) 		if t~=nil and r~= nil then 			if t~=id then 				if pl[id].usgn > 0 then 					if player(id,"exists") then 						if not player(t,"bot") then 							if r:len() > 5 then 								report(id, t, r) 								return 1 							else 								msg2(id,"\169255150150Error: \169255255255Please enter a valid reason") 								return 1 							end 						else 							msg2(id,"\169255150150Error: \169255255255You cannot report a bot") 							return 1 						end 					else 						msg2(id,"\169255150150Error: \169255255255Player does not exist") 						return 1 					end 				else 					msg2(id,"\169255150150Error: \169255255255You have to be logged into USGN to report a player") 					return 1 				end 			else 				msg2(id,"\169255150150Error: \169255255255You cannot report yourself") 				return 1 			end 		else 			msg2(id,"\169255150150Usage: \169255255255!report <id> <reason>") 			return 1 		end 	end end function report(id, t, r) 	f = io.open(path, "a+") 	f:write(os.date().. ": "..player(id,"name").." ("..pl[id].usgn..") reported "..player(t,"name").." ("..pl[t].usgn.."|"..player(t,"ip")..") Reason: "..r.."\n") 	f:close() 	msg2(id,"\169255255255Info: You successfully reported \169175255100"..player(t,"name")) end