Report System Errors

Ok so I am getting this error


[Snowa℃|3|STEAM_0:0:91971341] Lua Error:
 
[ERROR] addons/reportsystem/lua/autorun/client/cl_admincalls.lua:64: ')' expected near '<eof>'
  1. unknown - addons/reportsystem/lua/autorun/client/cl_admincalls.lua:0
 
 
[Snowa℃|3|STEAM_0:0:91971341] Lua Error:
 
[ERROR] addons/reportsystem/lua/autorun/client/cl_admincalls.lua:168: 'end' expected (to close 'function' at line 35) near '<eof>'
  1. unknown - addons/reportsystem/lua/autorun/client/cl_admincalls.lua:0

I am trying to make this work cause this is very old and I want to customize it, but I cant customize what I cant see.

Here are my files

client side


net.Receive( "STAFF_REC", function( len )	 
	plyname_read = net.ReadString()
	steamid_read = net.ReadString()
	plyreports_read = net.ReadString() 
	
	end ) 

-- If you are using ulx then set ulx_char to true
ulx_char = true

-- Don't touch this! --
-------------------------------------|--
local cmdChar = "/"               ---|--
if ulx_char then cmdChar = "!" end --|--
-------------------------------------|--

surface.CreateFont("Bebas13", {
	font = "Bebas", 
	size = 18, 
	weight = 500, 
	blursize = 0, 
	scanlines = 0, 
	antialias = true, 
	underline = false, 
	italic = false, 
	strikeout = false, 
	symbol = false, 
	rotary = false, 
	shadow = false, 
	additive = false, 
	outline = false, 
})


function Reports()

local plyname_read = ply:Nick()
local steamid_read = ply:SteamID()

	math.randomseed(os.time())
	surface.PlaySound("HL1/fvox/bell.wav")
	local dP = vgui.Create( "DFrame" )
	dP:SetPos( (1/30)*ScrW(),ScrH()/10 )
	dP:SetSize( 285, 135 )
	dP:SetTitle( "Admin Report" )
	dP:SetVisible( true )
	dP:SetDraggable( false )
	dP:ShowCloseButton( false )
	dP:SetKeyboardInputEnabled(false)
	dP:SetMouseInputEnabled(true)
	dP:SetVisible(true)
	dP.Paint = function()
		surface.SetDrawColor(0,0,0,150)
		dP:DrawFilledRect()
		surface.SetDrawColor(0,0,0)
		dP:DrawOutlinedRect()
	end

	local dB = vgui.Create( "DFrame" )
	dB:SetPos( (1/30)*ScrW() + 290,ScrH()/10 )
	dB:SetSize( 100, 135 )
	dB:SetTitle( " " )
	dB:SetVisible( true )
	dB:SetDraggable( false )
	dB:ShowCloseButton( false )
	dB:SetKeyboardInputEnabled(false)
	dB:SetMouseInputEnabled(true)
	dB:SetVisible(true)
	dB.Paint = function()
		surface.SetDrawColor(0,0,0,150)
		dB:DrawFilledRect()
		surface.SetDrawColor(0,0,0)
		dB:DrawOutlinedRect()
	end

	
	local name = vgui.Create( "DLabel",dP )
	name:SetPos(10, 15)
	name:SetText("Name: "..plyname_read)
	name:SetFont("Bebas13")
	name:SetSize(200,50)
	name:SetColor(Color(236, 240, 241))

	local steamid = vgui.Create( "DLabel",dP )
	steamid:SetPos(10, 40)
	steamid:SetText("SteamID: "..steamid_read)
	steamid:SetFont("Bebas13")
	steamid:SetSize(280,50)
	steamid:SetColor(Color(236, 240, 241))

	local subtitle = vgui.Create( "DLabel",dP )
	local a,b,c
	subtitle:SetPos(10, 15)
	if string.len(plyreports_read) > 40 then 
		a = string.sub(plyreports_read, 40, string.len(plyreports_read))
		b = string.sub(plyreports_read, 2, 39)
		c = b.."
"..a
	else
		c = plyreports_read
	end
	subtitle:SetText(c)
	subtitle:SetFont("Bebas13")
	subtitle:SetFont("Trebuchet18")
	subtitle:SetColor(Color(236, 240, 241))
	subtitle:SetSize(250,150)
	subtitle:SetWrap(false)

	local gotop = vgui.Create( "DButton",dB )
	gotop:SetPos(8, 5)
	gotop:SetText("  Goto")
	gotop:SetTextColor(Color(236, 240, 241))
	gotop:SetSize(80,20)
	gotop:SetImage("materials/goto_icon.png")
	gotop.Fill = false
	gotop.OnCursorEntered = function() gotop.Fill = true end 
	gotop.OnCursorExited = function() gotop.Fill = false end 
	gotop.Paint = function()
	if !gotop.Fill then 
		surface.SetDrawColor(0,0,0)
		gotop:DrawOutlinedRect()
	else
		surface.SetDrawColor(200,0,0,200)
		gotop:DrawFilledRect()
		surface.SetDrawColor(0,0,0)
		gotop:DrawOutlinedRect()
	end
	end
	gotop.DoClick = function() 
		surface.PlaySound("buttons/blip1.wav")
		RunConsoleCommand("say",cmdChar.."goto "..plyname_read)
		LocalPlayer():ChatPrint("Went to "..plyname_read..".")
	end
	
	local bringp = vgui.Create( "DButton",dB )
	bringp:SetPos(8, 30)
	bringp:SetText("  Bring")
	bringp:SetTextColor(Color(236, 240, 241))
	bringp:SetSize(80,20)
	bringp:SetImage("materials/bring_icon.png")
	bringp.Fill = false
	bringp.OnCursorEntered = function() bringp.Fill = true end 
	bringp.OnCursorExited = function() bringp.Fill = false end 
	bringp.Paint = function()
	if !bringp.Fill then 
		surface.SetDrawColor(0,0,0)
		bringp:DrawOutlinedRect()
	else
		surface.SetDrawColor(200,0,0,200)
		bringp:DrawFilledRect()
		surface.SetDrawColor(0,0,0)
		bringp:DrawOutlinedRect()
	end
	end
	bringp.DoClick = function() 
		surface.PlaySound("buttons/blip1.wav")
		RunConsoleCommand("say",cmdChar.."bring "..plyname_read)
		LocalPlayer():ChatPrint("Brought "..plyname_read.." to you.")
	end

	
	local kickp = vgui.Create( "DButton",dB )
	kickp:SetPos(8, 55)
	kickp:SetText("  Freeze")
	kickp:SetTextColor(Color(236, 240, 241))
	kickp:SetSize(80,20)
	kickp:SetImage("materials/freeze_icon.png")
	kickp.Fill = false
	kickp.OnCursorEntered = function() kickp.Fill = true end 
	kickp.OnCursorExited = function() kickp.Fill = false end 
	kickp.Paint = function()
	if !kickp.Fill then 
		surface.SetDrawColor(0,0,0)
		kickp:DrawOutlinedRect()
	else
		surface.SetDrawColor(200,0,0,200)
		kickp:DrawFilledRect()
		surface.SetDrawColor(0,0,0)
		kickp:DrawOutlinedRect()
	end
	end
	kickp.DoClick = function() 
		surface.PlaySound("buttons/blip1.wav")
		RunConsoleCommand("say",cmdChar.."freeze "..plyname_read)
		LocalPlayer():ChatPrint("Froze "..plyname_read..".")
	end

	local specp = vgui.Create( "DButton",dB )
	specp:SetPos(8, 80)
	specp:SetText("  Spec")
	specp:SetTextColor(Color(236, 240, 241))
	specp:SetSize(80,20)
	specp:SetImage("materials/spec_icon.png")
	specp.Fill = false
	specp.OnCursorEntered = function() specp.Fill = true end 
	specp.OnCursorExited = function() specp.Fill = false end 
	specp.Paint = function()
	if !specp.Fill then 
		surface.SetDrawColor(0,0,0)
		specp:DrawOutlinedRect()
	else
		surface.SetDrawColor(200,0,0,200)
		specp:DrawFilledRect()
		surface.SetDrawColor(0,0,0)
		specp:DrawOutlinedRect()
	end
	end
	specp.DoClick = function() 
		surface.PlaySound("buttons/blip1.wav")
		RunConsoleCommand("say",cmdChar.."spectate "..plyname_read)
		LocalPlayer():ChatPrint("Spectating "..plyname_read..".")
	end
	
	local specp = vgui.Create( "DButton",dB )
	specp:SetPos(8, 105)
	specp:SetText(" Copy SID")
	specp:SetTextColor(Color(236, 240, 241))
	specp:SetSize(80,20)
	specp:SetImage("materials/copyid_icon.png")
	specp.Fill = false
	specp.OnCursorEntered = function() specp.Fill = true end 
	specp.OnCursorExited = function() specp.Fill = false end 
	specp.Paint = function()
	if !specp.Fill then 
		surface.SetDrawColor(0,0,0)
		specp:DrawOutlinedRect()
	else
		surface.SetDrawColor(200,0,0,200)
		specp:DrawFilledRect()
		surface.SetDrawColor(0,0,0)
		specp:DrawOutlinedRect()
	end
	end
	specp.DoClick = function() 
		surface.PlaySound("buttons/blip1.wav")
		SetClipboardText(steamid_read)
		LocalPlayer():ChatPrint("Copied SteamID to clipboard.")
	end

	local okc = vgui.Create( "DButton",dP )
	okc:SetPos(210, 105)
	okc:SetText("   OK")
	okc:SetTextColor(Color(236, 240, 241))
	okc:SetSize(65,20)
	okc:SetImage("materials/ok_icon.png")
	okc.Fill = false
	okc.OnCursorEntered = function() okc.Fill = true end 
	okc.OnCursorExited = function() okc.Fill = false end 
	okc.Paint = function()
	if !okc.Fill then 
		surface.SetDrawColor(0,0,0)
		okc:DrawOutlinedRect()
	else
		surface.SetDrawColor(200,0,0,200)
		okc:DrawFilledRect()
		surface.SetDrawColor(0,0,0)
		okc:DrawOutlinedRect()
	end
	end
	okc.DoClick = function() 
		surface.PlaySound("buttons/blip1.wav")
		dB:Close()
		dP:Close()
	end

	
end	
usermessage.Hook( "Reports", Reports )

Server Side



util.AddNetworkString("ADMIN_R")
function adminCmd( ply, text, public )
    if (text[1] == "@") and !ply:IsAdmin() then
		-- if ply:IsAdmin() then return "" end
		if ply:GetNWBool("AdminFilter") then ply:ChatPrint("Give the admins time to respond!") return "" end
		print(tostring(string.len(string.sub(text, 5, string.len(text)))))
		if string.len(string.sub(text, 2, string.len(text))) < 65 and string.len(string.sub(text, 2, string.len(text))) > 1 then
			net.Start("ADMIN_R")
				net.WriteString( ply:Nick() )
				net.WriteString( ply:SteamID() )
				net.WriteString( string.sub(text, 2, string.len(text)) )
				ply:SetNWBool("AdminFilter",true)
				timer.Create("TAF"..ply:SteamID64(),15,1,function() ply:SetNWBool("AdminFilter",false) end)
			net.Broadcast()
			for k, v in pairs( player.GetAll() ) do
				if ( v:IsAdmin() ) then
					umsg.Start( "Reports", v )
					umsg.End( )	
				end
			end
			ply:ChatPrint("Thank you, the report was sent to the admins.")
			return ""
		else
			ply:ChatPrint("Message not sent. (Message must be between 2 to 65 characters!)")
			return ""
		end
    end
end
hook.Add( "PlayerSay", "adminCmd", adminCmd );

Is this the correct file from the error? I’m not seeing any syntax issues.

As im seeing the <eof> things i remember that this error was some sort of lua autorefresh bug, that just appeared randomly but the script was loading perfectly?

That means it searched until the end of file, aka it doesn’t exist.

I already know that, but as i was saying i remember an autorefresh bug that did exactly this, give some sort of error like this when the script was loading perfectly fine, some sort of false positive.

A friend and I had this exact problem when we were working on a gamemode. The file would load fine, but we’d always get an eof error in the file on autorefresh even though it successfully ran. I’m not saying this is happening with the OP (I haven’t even read the code), but just chiming in here that I too have experienced this strange bug.

i did have problems with it once too, though it never happened to me again

Well it duplicated the same errors one after another. Like this


[Snowa℃|3|STEAM_0:0:91971341] Lua Error:
 
[ERROR] addons/reportsystem/lua/autorun/client/cl_admincalls.lua:64: ')' expected near '<eof>'
  1. unknown - addons/reportsystem/lua/autorun/client/cl_admincalls.lua:0
 
 
[Snowa℃|3|STEAM_0:0:91971341] Lua Error:
 
[ERROR] addons/reportsystem/lua/autorun/client/cl_admincalls.lua:168: 'end' expected (to close 'function' at line 35) near '<eof>'
  1. unknown - addons/reportsystem/lua/autorun/client/cl_admincalls.lua:0


[Snowa℃|3|STEAM_0:0:91971341] Lua Error:
 
[ERROR] addons/reportsystem/lua/autorun/client/cl_admincalls.lua:64: ')' expected near '<eof>'
  1. unknown - addons/reportsystem/lua/autorun/client/cl_admincalls.lua:0
 
 
[Snowa℃|3|STEAM_0:0:91971341] Lua Error:
 
[ERROR] addons/reportsystem/lua/autorun/client/cl_admincalls.lua:168: 'end' expected (to close 'function' at line 35) near '<eof>'
  1. unknown - addons/reportsystem/lua/autorun/client/cl_admincalls.lua:0

It happens everytime i update my script via ftp because of lua refresh. My script will load fine and usually ill know if i made a mistake because it wilk throw an additional error letting me know what went wrong and my script wont work. Not sure what Snowa is going on about. Think hes trolling

I see where your getting the trolling from but I am not. I will send screenshots if you want.

As many others here have stated, that error usually is generated from a lua refresh. Unless you have additional code that is introducing the error. Someone above said your syntax is fine so it shouldn’t be erroring in the first place.

As i said various times, you shouldnt worry about that error, its a bug, there is nothing with your code and your code is fine. And we trust you, we know its giving those errors. You should just ignore them, its a BUG you can do nothing about it!