Countdown, timer function

I made this code



local DeathRemaining = GAMEMODE.Config.respawntime
	timer.Create( "DTimer", 1, 60, function()
	MsgN("Respawn in..." .. DeathRemaining)
	DeathRemaining = DeathRemaining - 1
	end)


and put it in “gamemode_functions.lua” func on 364 line, it’s works fine.
But when i try to change MsgN to draw.:



local DeathRemaining = GAMEMODE.Config.respawntime
	timer.Create( "DTimer", 1, 60, function()
	draw.SimpleText("Respawn in... " .. DeathRemaining,"BudgetLabel",150,ScrH() - 70)
	DeathRemaining = DeathRemaining - 1
	end)


it’s show error and don’t work.

Help me please.

DarkRP mod.

draw.SimpleText is a drawing function, as in it can only be used in a rendering hook, like HUDPaint.

Set the variable in the timer function, and draw the text in a HUDPaint hook.

http://www.gifok.net/images/2013/05/23/YxStp.png

hud.lua:



function GM:HUDPaint()
    if DRE == 1 
	then
	draw.SimpleText("Вы возродитесь через... " .. DeathRemaining,"BudgetLabel",150,ScrH() - 70)
	end
	DrawHUD()
	DrawZombieInfo()
	DrawEntityDisplay()
	self.BaseClass:HUDPaint()
end


gamemode_functions.lua



	DeathRemaining = GAMEMODE.Config.respawntime
	timer.Create( "DTimer", 1, 60, function()
	DRE = 1
	MsgN("Вы возродитесь через..." .. DeathRemaining)
	DeathRemaining = DeathRemaining - 1
	end)