Forum

> > CS2D > Scripts > @report - May I Please Have Some Help?
Forums overviewCS2D overview Scripts overviewLog in to reply

English @report - May I Please Have Some Help?

26 replies
Page
To the start Previous 1 2 Next To the start

old @report - May I Please Have Some Help?

Cirium
User Off Offline

Quote
I Am Making A Server, And i Was Wondering if I Could Have Some Help?

I'm Specifically Looking For A Lua Function That Allows Users To Use @report.

Have Seen Lots of Files In The File Archive. About This, However They Are To Complicated For Me.


I Was Wondering If Someone Could Help by Posting A "@report Lua Script."
That Simply Use's @report And Makes A File, Under The Lua Folder. That Says Why.

ie: "@report [id] [reason]

Thx.

old Habit...

Cirium
User Off Offline

Quote
Its A Habit I Seem To Have...

old kk

Cirium
User Off Offline

Quote
kk ill try not tu...

old Re: @report - May I Please Have Some Help?

244453211332112
User Off Offline

Quote
He wants a Lua which says to admin if someone uses

@report [ID] [Reason]

this lua has to say that if a player reports a other player for hacking also like
@report 3 speedhacker

Than has by the admins to stand only by the admins:

Someone has report [Name of ID]: speedhacker

And by the users has to stand:

You have successfully reported [Name of ID]


PS: It gives that on GTA: San Andreas and it's really useful!

old Thx

Cirium
User Off Offline

Quote
Thats exactly what im looking for!

thx for explaining.

old Re: @report - May I Please Have Some Help?

KimKat
GAME BANNED Off Offline

Quote
You would need a Lua similar to this...
Spoiler >

old Re: @report - May I Please Have Some Help?

DannyDeth
User Off Offline

Quote
Well, KimKat tried, but his example wasn't very correct
Here is code that will write the report to a log in the sys directory containing USGn and IP address:
1
2
3
4
5
6
7
8
9
10
11
12
13
addhook("say","report_cheater")
function report_cheater(txt)
	if string.sub(txt,1,7)=="!report" then
		loadstring(string.sub(txt,2,string.len(txt)))
		return 1
	end
end

function report(type,id)
	file = io.open("sys/report_log.txt","a")
	file:write("["..os.time("%H:%M:%S - %d/%m/%Y").."]: A "..type.." was reported. DETAILS:\nUSGN: "..player(id,"usgn").."\nIP ADDRESS: "..player(id,"ip").."\n---")
	file:close
end

NOTE: You use it by saying this:
1
!report(REASON,CHEATERS ID)
Where REASON would be "speedhacker" or something like that and CHEATERS ID to be the ID of the player who is cheating. Say I wanted to report Player, who's ID is 4 because I think he is an aimbotter, I would say:
1
!report("aimbot",4)
To report him to a log file.

EDIT: The report will look like something this:
1
2
3
[12:38:46 - 25/5/2011]: A aimbot was reported. DETAILS:
USGN: 1234
IP: 123.456.789.123

old Re: @report - May I Please Have Some Help?

KimKat
GAME BANNED Off Offline

Quote
I got a idea too, to prevent spam in reports.
Here's another Lua attempt, lol.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
addhook("say","report_txt")
function report_txt(id,txt)
rcon = {1}
authorized = player(rcon[id])	
server = authorized[i]
	%text% = player(txt,"reason")
	reason_text = "%text%"
	reason = "..reason_text.."
	if (txt~=[[!report("aimbot","..id..")]]) then
		return 1
	elseif (txt~=[[!report("speedhack","..id..")]]) then
		return 1
	elseif (txt~=[[!report("cheater","..id..")]]) then
		return 1
	elseif (txt==[[!report("..reason..","..server..")]]) then
		return 1
	end
end
Perhaps it's not correct but, but my idea was to enable some sort of report filtering so a regular user cannot write something like "!report("hahahahahaha bla bla!",1)" to report a admin of a server or such and to disable report if it's not correctly written. The script I wrote, I was trying to make so that if a report doesn't contain any of these texts it will disable a player from saying them to ensure report is spam proof. Perhaps it is complicated to implement but then there would be no abuse of reports.

old Re: @report - May I Please Have Some Help?

KimKat
GAME BANNED Off Offline

Quote
I guess so, lol.
Everybody lacks at something, Lua is not my strongest side.

I hope someone could script that report filtering though, unless you want kids abusing the script.

old Re: @report - May I Please Have Some Help?

KimKat
GAME BANNED Off Offline

Quote
Well, I guess you're right on that one...
I was wondering though if player id to report is "10"
that's two characters, wouldn't "!report 10" exceed or anything? or does 10 become one in some magical way lol? I'm confused there.

And wouldn't there be a good thing to add a limit from 1 to 32, as if you report id 0 or 33 it would produce a Lua error.

Just saying for the safety and compatability of the Lua script.

old Re: @report - May I Please Have Some Help?

Hanz
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
if string.sub(saycom[1], 1, 1)=="!" then --user commands
		saycom[1]=string.lower(saycom[1])

if saycom[1]=="@report" then
					if rankid[id] < 1 then msg2(id, Color(255, 0, 0), "ERROR: You do not have enough power to execute that command.") ; return 1; end
					if table.getn(saycom)==3 then
						if isnumber(saycom[2]) then
							saycom[2]=saycom[2]-1+1
								if player(saycom[2], "exists") then
									if saycom[2]==id then
										msg2(id, Color(255, 0, 0), "ERROR: You may not report yourself.")
										return 1
									else
										file2=io.open("/sys/www/reported.html", "a+")
										file2:write("<br>\n<br>\n"..os.date().."<br>\n"..player(id, "name").." ("..myname[id]..") IP: "..player(id, "ip").." USGN: "..myusgn[id].." REPORTED <br>\n"..player(saycom[2], "name").." IP: "..player(saycom[2], "ip").." USGN: "..myusgn[saycom[2]].."<br>\nReason: "..saycom[3])
										file2:close()
										msg(Color(255,255,255), player(id, "name").." used "..string.lower(message.."."))
										return 1
									end
								msg2(id, Color(255, 0, 0), "ERROR: Player does not exist.")
								return 1
								end
						else
							msg2(id, Color(255, 0, 0), "ERROR: Correct Syntax is @report [ID] [reason].")
							return 1
						end
					else
						msg2(id, Color(255, 0, 0), "ERROR: Correct Syntax is @report [ID] [reason].")
						return 1
		end
	end
end

I think like that but in my notepad++ the line of script not same maybe notepad++ line max and unrealsoftware post line max not same
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview