hey guys im looking to see if there is a simple "show spectators" that i could use for my hack, im noob at LUA so i was hoping you guys could help
I need this for DarkRP
here is sample code from Voltage
Code:
local showSpectators = false
hook.Add("HUDPaint", "showspectators", function()
if GetConVarNumber( "vh_spectators" ) >= 1 then return end
local spectatePlayers = {}
local x = 0
for k,v in pairs(player.GetAll()) do
if v:GetObserverTarget() == LocalPlayer() then
table.insert(spectatePlayers, v:Name())
end
end
local textLength = surface.GetTextSize(table.concat(spectatePlayers) ) / 3
draw****undedBox(1, ScrW() - 180, ScrH() - ScrH() + 15, 150, 30 + textLength, Color(0,0,0,150))
draw.SimpleText("Spectators", "ScoreboardText", ScrW() - 140, ScrH() - ScrH() + 17, Color(0, 0, 0, 150))
draw.SimpleText("Spectators", "ScoreboardText", ScrW() - 140, ScrH() - ScrH() + 16, Color(255, 255, 255, 255))
for k, v in pairs(spectatePlayers) do
draw.SimpleText(v, "ScoreboardText", ScrW() - 140, ScrH() - ScrH() + 35 + x, Color(255, 255, 255, 255))
x = x + 15
end
end)