On Screen Console

Hello everyone, I wanted to release a project of mine that I have been working on for a little while now. This is my on screen log system, it was designed so that admins can get live logs on there screen making it easier to catch people in the act. This console appears at the top left of an admins screen.

http://images.akamai.steamusercontent.com/ugc/432700399044701615/5435EBB2E59A885666C5B884AD86F2CA117BE137/

The console currently has 8 different log types. It will display kicks, brings, gotos, arrests, wants, deaths, disconnects, and name changes. The goto, bring and kick logs utiliz ULX so if you are not using that it will not display properlly. The arrests, wants, and name changes are done through darkRP so they will only work if darkRP is running. I plan to add support for other gamemodes and other ULX commands in the future. If you would like to have a command added to the log system please post it below and I will do my best to add it. I would also love if you could give me some feedback on this addon. I have only been coding in gLua for about 2 months now so any advice would be appreciated!

You can get it here.

This is amazing for how small the file is. I love it it and I think I got to be the first other tester?

do you input command to bring this up or is it automatically up?

I talked to him about it he said he would add it when he has time unless someone wants to help him?

[lua]concommand.Add(“openboxlog”, openlogwindow)

function openlogwindow(ply)
if DFrame == nil || !DFrame:IsVisible() then
rankLen = table.Count(ranks)
plyLocal = LocalPlayer()
flag = false
print(LocalPlayer())
for l = 1, rankLen do
if (plyLocal:GetUserGroup() == ranks[l]) then flag = true end
end
if (flag == true) then-- #
local DFrame = vgui.Create( “DFrame” ) – #
counter = counter + 1 – #
DFrame:SetSize( 500, 125 ) – #
DFrame:SetPos(1,5) – #
DFrame:SetTitle( “” )-- NO TITLE #
DFrame:KillFocus() – #
DFrame:ShowCloseButton( true ) – #
function DFrame:Paint( w, h ) – #
draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0,0,200 ) ) – #
end – #
– #
local str = “” – #
str = “more space!” – #
lengthFor = 25 – #
DermaList = vgui.Create( “DPanelList”, DFrame ) – #
DermaList:SetPos( 1,0 ) – #
DermaList:SetSize( 500, 125 ) – #
DermaList:SetSpacing( 0 ) – Spacing between items #
DermaList:EnableHorizontal( false ) – Only vertical items #
DermaList:EnableVerticalScrollbar( true ) – Allow scrollbar if you exceed the Y axis #
timer.Create( “LogDisplay”, 1, 0, displayTheLog) – #
end-- #
end
end – [/lua]

Untested but i think it will work

instead of having it hook into InitPostEntity
i also turned on the close button
(replaces 215 - 246)

[editline]8th October 2015[/editline]

might have missed an end or something in that all the – and # are screwing with my notpad++ for some reason

I think it works the only problem you need a console command to close the panel
[Lua]
[ERROR] addons/logsystem/lua/autorun/logsystem.lua:218: calling ‘IsVisible’ on bad self (Panel expected, got table)

  1. IsVisible - [C]:-1
  2. unknown - addons/logsystem/lua/autorun/logsystem.lua:218
    3. unknown - lua/includes/modules/concommand.lua:54

[Lua/]

DFrame:SetVisible( true )

[editline]8th October 2015[/editline]

[lua]concommand.Add(“toggleboxlog”, openlogwindow)

function openlogwindow(ply)
if DFrame == nil || !DFrame:IsVisible() then
rankLen = table.Count(ranks)
plyLocal = LocalPlayer()
flag = false
print(LocalPlayer())
for l = 1, rankLen do
if (plyLocal:GetUserGroup() == ranks[l]) then flag = true end
end
if (flag == true) then-- #
local DFrame = vgui.Create( “DFrame” ) – #
counter = counter + 1 – #
DFrame:SetSize( 500, 125 ) – #
DFrame:SetPos(1,5) –
DFrame:SetVisible( true)
DFrame:SetTitle( “” )-- NO TITLE #
DFrame:KillFocus() – #
DFrame:ShowCloseButton( false ) – #
function DFrame:Paint( w, h ) – #
draw.RoundedBox( 0, 0, 0, w, h, Color( 0, 0,0,200 ) ) – #
end – #
– #
local str = “” – #
str = “more space!” – #
lengthFor = 25 – #
DermaList = vgui.Create( “DPanelList”, DFrame ) – #
DermaList:SetPos( 1,0 ) – #
DermaList:SetSize( 500, 125 ) – #
DermaList:SetSpacing( 0 ) – Spacing between items #
DermaList:EnableHorizontal( false ) – Only vertical items #
DermaList:EnableVerticalScrollbar( true ) – Allow scrollbar if you exceed the Y axis #
timer.Create( “LogDisplay”, 1, 0, displayTheLog) – #
end-- #
end
else
DFrame:SetVisible( false)
end – [/lua]

[editline]8th October 2015[/editline]

try that, that should toggle the log window (should?) sorry i am not really that experienced with gui
NOTE: i changed the command to toggleboxlog

The original intention for this script is to have the log system automatically show up. However I will work on a chat command to close the window once it has been opened and another to re-open it.

so have the player run the function in the InitPostEntity hook

[editline]8th October 2015[/editline]

hook.Add( “InitPostEntity”, “beginLogs”, openlogwindow)

[editline]8th October 2015[/editline]

oh wow ignore everything i posted i just tested what i did XD

I am confused… It already does this. As is the log system will automatically appear on the person screen everything is setup nothing in it is broken. I only have to add the chat command to make the window close and re-open.

i know i was trying to make it work with the command i set up but screwed it all up, didnt realize everything after what i edited was part of the same function and just messed everything up, just ignore me :stuck_out_tongue: i obviously dont know what im doing

Look up EPOE gmod and you will get the same thing but much better

Not really the same thing, that console is meant for development purposes. This is a log system for admins they are quite different.

Upload to github

Just curious what is with that hud lol

Probably a test/script server so maybe that explains the werid hud

That is exactly it, I have two HUDs on my test server and didn’t disable them because they didn’t pertain to this script.

Haha alright, I was just brown-nosing script looks alright