zombie survival print name

under a local function called DrawWeapon() I am properly defining a variable


local printname = wep:GetPrintName()

I have it in gamemodes/zombiesurvival/gamemode being included by both cl_init and init.lua
But when my function gets called I get this error


[ERROR] gamemodes/zombiesurvival/gamemode/cl_wepinfo.lua:49: attempt to call method 'GetPrintName' (a nil value)
  1. fn - gamemodes/zombiesurvival/gamemode/cl_wepinfo.lua:49
   2. unknown - addons/ulib/lua/ulib/shared/hook.lua:183

This bothers me ._. it should be working
In one of the core gamemode files (cl_targetid) under the function GM:DrawTargetID(ent, fade) it calls the same thing


local wep = ent:GetActiveWeapon()
	if wep:IsValid() then
		draw.SimpleTextBlur(wep:GetPrintName(), "ZSHUDFontTiny", x, y, colTemp, TEXT_ALIGN_CENTER)
	end

Can anyone tell me why this isn’t working?

This isn’t the proper place for a coding support thread… I’d really suggest removing it before you get banned.

Should this be on the GLUA topic…
I think?

oh. look at that, i meant to put in the the developer Developer Discussion section xD. sorry