Although I have no idea about code, I think it's meant to be like this???
--[[----------------------------------
ULX Command Cooldown
Originally coded by: Cobalt
Updated by: lynx
Updated: March 3, 2014
----------------------------------]]--
groupcooldown = {}
--[[ Begin Configuration Section ]]--
-- groupcooldown.default
-- This sets the default cooldown for groups not listed in the grouplist.
groupcooldown.default = 15
-- groupcooldown.grouplist
-- This list defines the cooldown times for the groups. If a group is unlisted and not on the whitelist, it will default to default above.
-- This is a table. Please follow the example when adding groups.
groupcooldown.grouplist = {
["superadmin"] = 10;
["admin"] = 5;
["operator"] = 3;
}
-- groupcooldown.whitelist
-- Groups and Steam ID's defined in this list are exempt from the command cooldown regardless if their group is listed above.
groupcooldown.whitelist = { "owner", "developer", "superadmin", "STEAM_0:0:0", "STEAM_0:0:29798183" }
-- groupcooldown.message
-- This is the message dispalyed to the user. A second message will inform them of the time they have remaining to wait.
groupcooldown.message = "You are not allowed to do that right now."
--[[ End Configuration. Please do not modify anything below this line otherwise stuff will break. ]]--
function CmdCooldown(ply, cmd, args)
if table.HasValue( groupcooldown.whitelist, ply:SteamID() ) or table.HasValue( groupcooldown.whitelist, ply:GetUserGroup() ) then
return
end
if not ply.NextCommand or ply.NextCommand <= CurTime() then
ply.NextCommand = CurTime() + ( groupcooldown.grouplist[ply:GetUserGroup()] or groupcooldown.default )
end
if ply.NextCommand > CurTime() then
local nextCmd = ply.NextCommand - CurTime()
ULib.tsay( ply, groupcooldown.message )
ULib.tsay( ply, string.format( "You have %s seconds to wait before you can use a command again.", math.floor(nextCmd) ) )
return false
end
end
timer.Simple( 3, function()
hook.Add( "ULibCommandCalled", "CheckCommands", CmdCooldown )
end )
It doesn't work even though it doesn't give any errors. It doesn't allow any commands at all, just displays wait times and you can't do this command.