Strange Console Error

I’m seeing this clientside when connecting to my sandbox server, not too sure what it its:



ERROR: GAMEMODE:'HUDPaint' Failed: sandbox/gamemode/cl_init.lua:74: attempt to call method 'PaintNotes' (a nil value)


Addons list please.

As you wish:

Ignore the ulx_motd.txt file, it’s just there for backup, in case I fuck up the current one.

I don’t think it’s any addons. Not sure what it is. I don’t have any scoreboard addon or anything.

Try updating Wire if you haven’t already, though the best way would be to remove all addons, then replace them one at a time.

I update everything daily. It’s all up to date.

im having same problem, reinstall time i think

It’s serverside.

[lua]hook.Add(“InitPostEntity” , “FixNotePaints” , function()
NOTIFY_GENERIC = 0
NOTIFY_ERROR = 1
NOTIFY_UNDO = 2
NOTIFY_HINT = 3
NOTIFY_CLEANUP = 4

local NoticeMaterial = {}
NoticeMaterial[ NOTIFY_GENERIC ] 	= surface.GetTextureID( "vgui/notices/generic" )
NoticeMaterial[ NOTIFY_ERROR ] 		= surface.GetTextureID( "vgui/notices/error" )
NoticeMaterial[ NOTIFY_UNDO ] 		= surface.GetTextureID( "vgui/notices/undo" )
NoticeMaterial[ NOTIFY_HINT ] 		= surface.GetTextureID( "vgui/notices/hint" )
NoticeMaterial[ NOTIFY_CLEANUP ] 	= surface.GetTextureID( "vgui/notices/cleanup" )

local HUDNote_c = 0
local HUDNote_i = 1
local HUDNotes = {}

function GAMEMODE:AddNotify( str, type, length )

	local tab = {}
	tab.text 	= str
	tab.recv 	= SysTime()
	tab.len 	= length
	tab.velx	= -5
	tab.vely	= 0
	tab.x		= ScrW() + 200
	tab.y		= ScrH()
	tab.a		= 255
	tab.type	= type
	
	table.insert( HUDNotes, tab )
	
	HUDNote_c = HUDNote_c + 1
	HUDNote_i = HUDNote_i + 1
	
end


local function DrawNotice( self, k, v, i )

	local H = ScrH() / 1024
	local x = v.x - 75 * H
	local y = v.y - 300 * H
	
	if ( !v.w ) then
	
		surface.SetFont( "GModNotify" )
		v.w, v.h = surface.GetTextSize( v.text )
	
	end
	
	local w = v.w
	local h = v.h
	
	w = w + 16
	h = h + 16

	draw.RoundedBox( 4, x - w - h + 8, y - 8, w + h, h, Color( 30, 30, 30, v.a * 0.4 ) )
	
	// Draw Icon
	
	surface.SetDrawColor( 255, 255, 255, v.a )
	surface.SetTexture( NoticeMaterial[ v.type ] )
	surface.DrawTexturedRect( x - w - h + 16, y - 4, h - 8, h - 8 ) 
	
	
	draw.SimpleText( v.text, "GModNotify", x+1, y+1, Color(0,0,0,v.a*0.8), TEXT_ALIGN_RIGHT )
	draw.SimpleText( v.text, "GModNotify", x-1, y-1, Color(0,0,0,v.a*0.5), TEXT_ALIGN_RIGHT )
	draw.SimpleText( v.text, "GModNotify", x+1, y-1, Color(0,0,0,v.a*0.6), TEXT_ALIGN_RIGHT )
	draw.SimpleText( v.text, "GModNotify", x-1, y+1, Color(0,0,0,v.a*0.6), TEXT_ALIGN_RIGHT )
	draw.SimpleText( v.text, "GModNotify", x, y, Color(255,255,255,v.a), TEXT_ALIGN_RIGHT )
	
	local ideal_y = ScrH() - (HUDNote_c - i) * (h + 4)
	local ideal_x = ScrW()
	
	local timeleft = v.len - (SysTime() - v.recv)
	
	// Cartoon style about to go thing
	if ( timeleft < 0.8  ) then
		ideal_x = ScrW() - 50
	end
	 
	// Gone!
	if ( timeleft < 0.5  ) then
	
		ideal_x = ScrW() + w * 2
	
	end
	
	local spd = RealFrameTime() * 15
	
	v.y = v.y + v.vely * spd
	v.x = v.x + v.velx * spd
	
	local dist = ideal_y - v.y
	v.vely = v.vely + dist * spd * 1
	if (math.abs(dist) < 2 && math.abs(v.vely) < 0.1) then v.vely = 0 end
	local dist = ideal_x - v.x
	v.velx = v.velx + dist * spd * 1
	if (math.abs(dist) < 2 && math.abs(v.velx) < 0.1) then v.velx = 0 end
	
	// Friction.. kind of FPS independant.
	v.velx = v.velx * (0.95 - RealFrameTime() * 8 )
	v.vely = v.vely * (0.95 - RealFrameTime() * 8 )

end


function GAMEMODE:PaintNotes()

	if ( !HUDNotes ) then return end
		
	local i = 0
	for k, v in pairs( HUDNotes ) do
	
		if ( v != 0 ) then
		
			i = i + 1
			DrawNotice( self, k, v, i)		
		
		end
		
	end
	
	for k, v in pairs( HUDNotes ) do
	
		if ( v != 0 && v.recv + v.len < SysTime() ) then
		
			HUDNotes[ k ] = 0
			HUDNote_c = HUDNote_c - 1
			
			if (HUDNote_c == 0) then HUDNotes = {} end
		
		end

	end

end

end )[/lua]

Save this in lua/autorun/client.

as what filetype/name ? where ? i run the dedicated server fyi so if its there thats the problem i can fix it :smiley:

Changes are?

I’d start your own thread to keep things organized.

im having the exact same problem, except my scoreboard works

Right but making your own thread is easier, if you take over my thread, it keeps my questions from being answered.

Anyway, the file above, what are the changes?

The changes are for, whatever reason, the annoying hint system isn’t present in Sandbox. What I did was extracted it and added the code in a hook which runs after the gamemode, so the function will exist.

Not making this change doesn’t hurt anything right? Don’t want to change anything if there’s nothing to worry about.

Making the change won’t make any change (Except that you would have the ability to use AddNotify in all gamemodes rather than just Sandbox)