Agenda Over-Ride

I want to over-ride the default DarkRP agenda skin, I want it to look like this:



local function Agenda()
	local shouldDraw = hook.Call("HUDShouldDraw", GAMEMODE, "DarkRP_Agenda")
	if shouldDraw == false then return end
	local ply = LocalPlayer()

	local agenda = ply:getAgendaTable()
	if not agenda then return end

	draw.RoundedBox(8, 10, 10, 460, 110, Color( 64, 64, 64, 255 ))
	draw.RoundedBox(8, 11, 11, 458, 108, Color( 84, 84, 84, 255 ))
	draw.RoundedBoxEx(8, 10, 10, 460, 21, Color( 200, 200, 200, 255 ), true, true, false, false )
	draw.RoundedBoxEx(8, 10, 10, 460, 20, Color( 61, 61, 61, 255 ), true, true, false, false )

	draw.DrawNonParsedText(agenda.Title, "DarkRPHUD1", 30, 12, colors.red, 0)

	local text = ply:getDarkRPVar("agenda") or ""

	text = text:gsub("//", "
"):gsub("\
", "
")
	text = DarkRP.textWrap(text, "DarkRPHUD1", 440)
	draw.DrawNonParsedText(text, "DarkRPHUD1", 30, 35, colors.white, 0)
end


I have tried putting it in the cl_hudreplacement.lua, but it is still using the default one.

Try this:
[lua]
local function HideThings( name )
if(name == “DarkRP_Agenda”) then
return false
end
– We don’t return anything here otherwise it will overwrite all other
– HUDShouldDraw hooks.
end
hook.Add( “HUDShouldDraw”, “HideThings”, HideThings )
[/lua]

That should stop the default agenda being drawn, then draw your own, by removing these lines from your code:

[lua]
local shouldDraw = hook.Call(“HUDShouldDraw”, GAMEMODE, “DarkRP_Agenda”)
if shouldDraw == false then return end
[/lua]

Then call agenda in a hudpaint hook.