HELP
[CODE]
local function ffnd(pl)
local LocalPlayer = LocalPlayer()
local boneIndex = pl:LookupBone('ValveBiped.Bip01_Head1')
local bonePos = boneIndex and pl:GetBonePosition(boneIndex) or pl:GetPos()
local myEyeAngles = LocalPlayer:EyeAngles()
myEyeAngles.p = 0
myEyeAngles:RotateAroundAxis(myEyeAngles:Right(), 90)
myEyeAngles:RotateAroundAxis(myEyeAngles:Up(), -90)
bonePos = bonePos + myEyeAngles:Forward() * 10
cam.Start3D2D(bonePos, myEyeAngles, 0.1)
cam.IgnoreZ(true)
draw.SimpleText(pl:Health(),"Trebuchet18",0,0,Color(255,255,255))
cam.End3D2D()
end
hook.Add("PostDrawTranslucentRenderables", "ffnd", ffnd)
[/CODE]
ERROR:
[IMG]http://skrinshoter.ru/s/120717/PqqmSC.png[/IMG]
I am confused as to why are you using PostDrawTranslucentRenderables?
Just use PostPlayerDraw, as PostPlayerDraw uses player arguments.
PostDrawTranslucentRenderables is like for drawing world shit, aka skybox, as well this hook only takes boolean arguments.
it looks like the error is caused by "pl" being something other than a player entity. ([img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/GM/PostDrawTranslucentRenderables]GM:PostDrawTranslucentRenderables[/url] arguments are DrawDepth and DrawSkybox which are both Booleans)
You can attempt to replace pl with LocalPlayer() instead.
I don't really know what you're trying to attempt, but if you want to run it on other players, you should probably do that inside the hook itself.
Sorry, you need to Log In to post a reply to this thread.