Hi, I'm having problems with the Hook "HUDPaint". How exactly do I make it so that it will draw on Everyone's screen and not just mine? This is the code I have come up with:
[code]
if(SERVER)then
AddCSLuaFile("autorun/CustomDrawing.lua")
return
end
function DrawBox()
local W = ScrW()
local H = ScrH()
local ply = LocalPlayer()
draw.RoundedBox( 8, W-200, 100, 200, 90, Color(0, 0, 0, 150) );
draw.DrawText("Name: " .. ply:Nick(), "ScoreboardText", (W-185), 105, Color(255,255,255,255),0)
if(ply:Frags() < 0)then
draw.DrawText("Kills: 0", "ScoreboardText", (W-185), 125, Color(255,255,255,255),0)
else
draw.DrawText("Kills: " .. ply:Frags(), "ScoreboardText", (W-185), 125, Color(255,255,255,255),0)
end
draw.DrawText("Deaths: " .. ply:Deaths(), "ScoreboardText", (W-185), 145, Color(255,255,255,255),0)
if(string.len((ply:Frags()/ply:Deaths())) >= 6)then
if(string.find(tostring(ply:Frags()/ply:Deaths()), "#"))then
draw.DrawText("K/D Ratio: 0", "ScoreboardText", (W-185), 165, Color(255,255,255,255),0)
else
draw.DrawText("K/D Ratio: " .. string.sub(tostring((ply:Frags()/ply:Deaths())), 0, 6), "ScoreboardText", (W-185), 165, Color(255,255,255,255),0)
end
else
draw.DrawText("K/D Ratio: " .. (ply:Frags()/ply:Deaths()), "ScoreboardText", (W-185), 165, Color(255,255,255,255),0)
end
end
hook.Add("HUDPaint", "Testing", DrawBox)
[/code]
I'm still sort of new to Lua, so if you could please help, that'd be GREATLY appreciated. Thanks!
you need to make 2 files i think, one for client and one for server
place the client file in "autorun/client" and server one in "autorun/server"
Sorry, you need to Log In to post a reply to this thread.