Extracting specific information from table, sorta...

I am making my own report system, and I have it so you can successfully report someone, and the admins can see all the reports in a list. What I am stuck on is when you right click, I want to have it so you click, “View full description” then another menu pops up where you can view the full description of the one you clicked on. I am not sure how to get the information just from the one you selected. I already have all the derma for the menu and everything arranged, but what I am trying to figure out is how to do what I just said. What I have done is
[LUA]
for _, report in pairs(myowntable)do
this_is_my_function_to_open_the_menu_but_the_code_is_too_long_to_actually_post_just_know_that_this_is_the_function_to_open_it()
end
[/LUA]

but what that does is it opens all the correct information but for every single report in the list… This is what I have to add the reports to the list:
[LUA]
for _, report in pairs(myowntable)do
list:AddLine( report.REPORTER, report.FAGGOT, report.RULEBROKEN, report.DATE, report.ID )
list:SortByColumn( 4, true )
end
[/LUA]
The ID is the name of the text file. So you can access the id with “list:GetLine( line ):GetValue(5)”. I have seperated all the information with “+” so I can do
[LUA]
local content = file.Read(“reports/”…id)
local explode = string.Explode("+", content)

ID = report,
REPORTER = explode[1],
REPORTERID = explode[2],
VIOLATOR = explode[3],
VIOLATORID = explode[4],
RULEBROKEN = explode[5],
DESCRIP = explode[6],
ADDN = explode[7],
DATE = explode[8],
[/LUA]
yet nothing I do seems to work… If you have read everything, kudos to you. Can anyone help me out?

Make the menu outside of the loop?

Then how would it get the table… I am just not sure how to get the text from the table of the one you right click on.

I have been stuck on this for 4 days now and I feel like the answer is really simple and I am just over complicating things… I would seriously greatly appreciate help.

I don’t get what you are having problems with, but I do know that if the description has “+” in it your seperation system will break.

I ended up changing the + to //// instead shortly after posting my thread. But what I am asking in a very condensed way is for my report system when you click on a report I want it to have information about that report that you selected. I don’t know how to get the information from just one table without selecting all of them which I did with “for _, report in pairs(myowntable)do”

Just a head’s up-

https://scriptfodder.com/scripts/view/258
https://scriptfodder.com/scripts/view/1026

What you’re trying to do has already been done (you’d probably be able to get it on scriptfodder along with the others instead of publishing it free, just an idea…)

This person can’t code this simple thing and you suggest he put it on scriptfodder, fuck off.

I’m having a hard time understanding the actual problem, what is your problem? It’ll be an easy solution if we can just understand the problem

Also remember to save the reports server side then send the reports to the client requesting it. If you save it client side then only that one client with the report can see it, unless you relay it through the server to other clients (more expensive)

-snip, misread post-

Well, there’s no fun in buying it. I am making it for my friends server while trying to better experience myself in the world of coding. Though lua isn’t too helpful in the real world, it is still a start. So- What I have is when you open the report, it opens the report of everything posted, thanks to this:
[LUA]
for _, report in pairs(myowntable)do
this_is_my_function_to_open_the_menu_but_the_code_is_too_long_to_actually_post_just_know_that_this_is_the_function_to_open_it()
end
[/LUA]
How can I get it so instead of opening all of them, it opens just the one you selected.

I mention to get the table ID you would do
[LUA]
list:GetLine( line ):GetValue(5)
[/LUA]
but I don’t know what to do with the ID…



for _, report in pairs(myowntable)do
this_is_my_function_to_open_the_menu_but_the_code_is_too_long_to_actually_post_just_know_that_this_is_the_function_to_open_it()
end


What this does is: it calls the function one time for each report in the menu. It doesn’t actually pass the report to the function, all it does is call the function a bunch of times (or 0 times if there are no report).

well yea, I knew it did that. I don’t know how else to extract the information from the table without doing it for every entry in the table… That’s why I have it like that.