If I wanted to log certain bits of information in a menu how would I do it.
If I wanted to log each time a person clicked a button including the time/person who clicked the button.
Just some pseudo code since I have nothing to base this off of:
[lua]onButtonPress(function()
file.Append("mylog.txt", "Button was pressed/n")
end)[/lua]
That might point you in the right direction. If you're looking for more detail you have to give us more than just "a log when a button is pressed"
[QUOTE=YourStalker;50297360]Just some pseudo code since I have nothing to base this off of:
[lua]onButtonPress(function()
file.Append("mylog.txt", "Button was pressed/n")
end)[/lua]
That might point you in the right direction. If you're looking for more detail you have to give us more than just "a log when a button is pressed"[/QUOTE]
Okay well then to be more precise. I want these logs to draw out nicely across a DFrame.
Log who issued the press. Along with what time they issued the press. That's about it.
I'll figure out the rest on my own.
[QUOTE=dannyf127;50297366]Okay well then to be more precise. I want these logs to draw out nicely across a DFrame.
Log who issued the press. Along with what time they issued the press. That's about it.
I'll figure out the rest on my own.[/QUOTE]
Log who issued the press? [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Global/LocalPlayer]LocalPlayer[/url]
Log when they issued it? [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/os/time]os.time[/url]
If you want to put it nicely in a DFrame, just use any table-to-string and string-to-table functions you want to add the data to the text file, then load it and convert it to a table, then use that table to create the vgui elements needed. Simple.
Sorry, you need to Log In to post a reply to this thread.