Here you go..
if SERVER then
local toptime = 0
function CountDown(ply, text, public)
local args = string.Explode(" ", text)
if args[1] == "!countdown" then
if ply:IsAdmin() then
toptime = args[2]
timer.Create("CountDownTimer", 1, 0, CountDownTimer)
ULib.tsay(nil, ply:GetName().. " has started a countdown timer!", true)
else
ULib.tsay(ply, "Sorry, only admins can use this feature", true)
end
return ""
elseif args[1] == "!stopcountdown" then
timer.Destroy("CountDownTimer")
ULib.csay(nil, "Countdown has been halted!")
ULib.tsay(nil, "Countdown has been halted!", true)
end
end
hook.Add( "PlayerSay", "CDChatHook", CountDown )
function CountDownTimer()
if tonumber(toptime) >= 1 then
ULib.csay(nil, tostring(toptime).. " seconds remaining")
toptime = toptime - 1
else
timer.Destroy("CountDownTimer")
ULib.csay(nil, "Countdown has ended!")
ULib.tsay(nil, "Countdown has ended!", true)
end
end
end
Take this code, and stick it in a file called CountDown.lua and put it in your Garrysmod/lua/autorun folder
the commands are..
!countdown <seconds>
and
!stopcountdown
This will display a countdown in the center of the screen of every user on the server until it is halted or until it reaches 0.
EDIT: This is obviously not a feature rich as you would like Im sure, but ULX will never add something like this because it is not necessary as an admin tool, and the goal of ULX is for simplicity. If this is not to your needs, i'm sorry. However I will probably throw it on my server for kicks =)