• Hud panel at spawn
    0 replies, posted
  • Avatar of Xstasy
  • Hi facepunchers! I've been trying to make a 3D2D screen approx. at spawn with a browser. The code is ready, but I am not sure where to put the lua script as this is my first script. This should be a script that is run on client when connected to the server. The script currently resides in garrysmod/lua/autorun/client/hud.lua My script: [CODE]local pos = Vector(0, 0, 0) local ang = Angle(0, 270, 90) local width = 1024 local height = 768 local scale = 0.125 local url = "http://google.com" if g_3DHTML and g_3DHTML:IsValid() then g_3DHTML:Remove() end local browser = vgui.Create("HTML") g_3DHTML = browser browser:SetPaintedManually(true) browser:SetSize(width, height) browser:SetMouseInputEnabled(false) browser:OpenURL(url) local function DrawSign() -- Draw a background surface.SetDrawColor(255, 255, 255, 255) surface.DrawRect(0, 0, width, height) -- Draw the screen render.SetMaterial(browser:GetHTMLMaterial()) render.DrawQuad(Vector(0, 0, 0), Vector(width, 0, 0), Vector(width, height, 0), Vector(0, height, 0)) end hook.Add("RenderScreenspaceEffects", "3DHTMLSign", function() cam.Start3D(EyePos(), EyeAngles()) cam.Start3D2D(pos, ang, scale) local status, err = pcall(DrawSign) cam.End3D2D() if not status then Error(err) end end) [/CODE] I've tried to run RenderScreenspaceEffects in console, but it states it as an unknown command. Could you guys please help a fellow facepuncher out? Best regards Xstasy