Hi, can someone make me this kinda position/angle HUD?
[IMG]http://i.imgur.com/vdG7e.png[/IMG]
How it should work: So I want it to have a console command like, "angle/position 1/0" <- something like that. And what ever I look at like a prop, car, player, etc... it gives me there Angle, Position, and Model.
Trying to do one at the moment, give me a bit though.
Edit: This works in singleplayer, and it should work in multiplayer, tested at 1600x900 and lowest resolution, at 1600, space between lines is a bit larger, but at 640 its about what the picture you had is, so the text will not overlap at any time. It does sometimes get fuzzy though.
[CODE]
hook.Add( "HUDPaint", "propinfo_hud",function()
CreateClientConVar("entity_info_enable",0,true,false)
CreateClientConVar("entity_info_angle",0,true,false)
CreateClientConVar("entity_info_pos",0,true,false)
CreateClientConVar("entity_info_model",0,true,false)
if ConVarExists("entity_info_enable") and GetConVar("entity_info_enable"):GetInt() == 1 then
for k,v in pairs (ents.GetAll()) do
surface.SetTextColor(255,255,255,255)
local tracer = LocalPlayer():GetEyeTraceNoCursor()
local model,pos,angle
if tracer.HitNonWorld then
local tang = tracer.Entity:GetAngles():Forward()
model = Format("model: %s\n",tracer.Entity:GetModel())
pos = Format("Position(x,y,z): %f %f %f",tracer.Entity:GetPos().x,tracer.Entity:GetPos().y,tracer.Entity:GetPos().z)
angle = Format("Angle(x,y,z): %f %f %f",tang.x,tang.y,tang.z)
if GetConVar("entity_info_angle"):GetInt() == 1 then
surface.SetTextPos(20,ScrH() * 0.75)
surface.DrawText(angle)
end
if GetConVar("entity_info_pos"):GetInt() == 1 then
surface.SetTextPos(20,ScrH() * 0.80)
surface.DrawText(pos)
end
if GetConVar("entity_info_model"):GetInt() == 1 then
surface.SetTextPos(20,ScrH() * 0.85)
surface.DrawText(model)
end
end
end
end
end)
[/CODE]
Someone already made one. And yes it still works.
[url]http://www.garrysmod.org/downloads/?a=view&id=32129[/url]
To be honest, this should have been integrated into gmod a long time ago...
Sorry, you need to Log In to post a reply to this thread.