• This HUD doesn't draw anymore
    5 replies, posted
It worked some weeks before and now it doesn't work anymore and there aren't any error logs in both consoles. [CODE]function PLUGIN:HUDPaint() viewEntity = LocalPlayer():GetViewEntity() if (Schema:IsPlayerCombineRank(LocalPlayer(), "SCN") and !LocalPlayer():GetNetworkedVar("CamMode", true)) then local scrW, scrH = ScrW(), ScrH() local w, h = SCANNER_PIC_W, SCANNER_PIC_H local x, y = scrW*0.5 - (w * 0.5), scrH*0.5 - (h * 0.5) local x2, y2 = x + w*0.5, y + h*0.5 surface.SetDrawColor(255, 255, 255, 10 + math.random(0, 1)) surface.DrawRect(x, y, w, h) surface.SetDrawColor(255, 255, 255, 150 + math.random(-50, 50)) surface.DrawOutlinedRect(x, y, w, h) surface.DrawLine(x2, 0, x2, y) surface.DrawLine(x2, y + h, x2, ScrH()) surface.DrawLine(0, y2, x, y2) surface.DrawLine(x + w, y2, ScrW(), y2) x = x + 8 y = y + 8 local position = LocalPlayer():GetPos() draw.SimpleText("POS: ("..math.floor(position.x)..","..math.floor(position.y)..","..math.floor(position.z)..")", "ScannerText", x, y, color_white, 0, 0) local c = true local digits = "" for i=1, #LocalPlayer():GetName() do local n = LocalPlayer():GetName() if !string.find(string.sub(n, #n-i, #n-i), "[.-]") and c then digits = string.sub(n, #n-1, #n-1) .. digits else c = false end end draw.SimpleText("UNIT: ("..digits..")", "ScannerText", x + w - surface.GetTextSize("UNIT: ("..digits..")"), y, color_white, 0, 0) local p = math.floor(-LocalPlayer():GetAimVector():Angle().p+360) if p > 180 then p = p - 360 end draw.SimpleText("YAW: "..math.floor(LocalPlayer():GetAimVector():Angle().y).."; PITCH: "..p, "ScannerText", x, y + 24, color_white, 0, 0) draw.SimpleText("HULL: "..math.floor(LocalPlayer():Health()).."%", "ScannerText", x, y + 48, Color(math.Clamp(100-(LocalPlayer():Health()*2)+100, 0, 100)*2.55, math.Clamp(LocalPlayer():Health(), 0, 100)*2.55, 0), 0, 0) local r, g, b = 185, 185, 185 local length = 64 local trace = util.QuickTrace(viewEntity:GetPos(), LocalPlayer():GetAimVector()*3600, viewEntity) local entity = trace.Entity if (IsValid(entity) and entity:IsPlayer()) then self.target = entity draw.SimpleText("TARGET: "..string.upper(entity:GetName()).."; VITALS: "..entity:Health().."%", "ScannerText", x, y + 48 + 24, color_white, 0, 0) r = 255 g = 255 b = 255 else draw.SimpleText("TARGET: NONE", "ScannerText", x, y + 48 + 24, color_white, 0, 0) end local ScannerCooldown = LocalPlayer():GetNetworkedVar("ScannerCooldown", 0) if (ScannerCooldown>CurTime()) then draw.SimpleText("RECHARGING: "..string.sub(tostring(CurTime()-ScannerCooldown), 1, 5), "ScannerText", x, y + h - 48, Color(255, 0, 0), 0, 0) end end end[/CODE]
My guess is PLUGIN:HUDPaint is not called. Figure it out. [editline]13th October 2016[/editline] Or this doesn't pass: if (Schema:IsPlayerCombineRank(LocalPlayer(), "SCN") and !LocalPlayer():GetNetworkedVar("CamMode", true)) then
[QUOTE=Robotboy655;51197939]My guess is PLUGIN:HUDPaint is not called. Figure it out. [editline]13th October 2016[/editline] Or this doesn't pass: if (Schema:IsPlayerCombineRank(LocalPlayer(), "SCN") and !LocalPlayer():GetNetworkedVar("CamMode", true)) then[/QUOTE] The other one should pass bcs I mean if HUDPaint doesn't pass then other stuff using HUDPaint won't pass either but they pass and the other one looks clean I mean.
have u tried [LUA]hook.add("HUDPaint", "Hud_Stuff", function() end)[/LUA] Or PLUGIN = GM ??? Just try hook add. or the statement just not pass.
[QUOTE=kem008;51208056]have u tried [LUA]hook.add("HUDPaint", "Hud_Stuff", function() end)[/LUA] Or PLUGIN = GM ??? Just try hook add. or the statement just not pass.[/QUOTE] Uhm, the hook already exist and the statement too.
[QUOTE=Robotboy655;51197939]My guess is PLUGIN:HUDPaint is not called. Figure it out. [editline]13th October 2016[/editline] Or this doesn't pass: if (Schema:IsPlayerCombineRank(LocalPlayer(), "SCN") and !LocalPlayer():GetNetworkedVar("CamMode", true)) then[/QUOTE] Yes, but one time it worked and the code never changed, why it doesn't work now anymore?
Sorry, you need to Log In to post a reply to this thread.