• 3d2d on doors.
    2 replies, posted
Hey, I'm trying to make a 3d2d text on the doors for my server(To show if they are owned or not etc, just like the default one buy a 3d2d in the world instead of text on the screen). Anyways, I'm having a trouble making it, I've tried many ways, but apparently I'm putting the code in the wrong place. Here is the default code (DarkRP default code): [lua] local pos = {x = ScrW()/2, y = ScrH() / 2} if whiteText then draw.DrawText(st, "TargetID", pos.x + 1, pos.y + 1, Color(0, 0, 0, 200), 1) draw.DrawText(st, "TargetID", pos.x, pos.y, Color(255, 255, 255, 200), 1) else draw.DrawText(st, "TargetID", pos.x , pos.y+1 , Color(0, 0, 0, 255), 1) draw.DrawText(st, "TargetID", pos.x, pos.y, Color(53, 160, 225, 200), 1) end [/lua] Here is what I tried to make: [lua] local Pos = tr.Entity:GetPos() local Ang = tr.Entity:GetAngles() Ang:RotateAroundAxis(Ang:Up(), 90) cam.Start3D2D(Pos + Ang:Up() , Ang, 1) draw.RoundedBox( 6, 0 , 0, 100, 10, Color(150, 150, 150, 50)) draw.SimpleText("test", "HUDNumber4", 0, 0, Color(255,255,255,255)) cam.End3D2D() [/lua] Unfortunately, nothing happens. Any hints on how to fix it? Any help appreciated.
Nevermind, solved.
You may notice that each type of door (each different door class) behaves differently, and many do not return angles correctly. You have to apply offsets based on each door's class, and find the angle using the door's OBB information.
Sorry, you need to Log In to post a reply to this thread.