Skip to content
MilkGames edited this page Feb 27, 2021 · 2 revisions

Give additional warn per day banned (upto 4 total):

hook.Add("xWarnWarnOnBan", "xWarnHandleWarnOnBan", function(target, targetname, time, banid)
	-- They've already been warned once (by the xWarn feature), this hook will add a max of 3 depending on time.
	local timestowarn = (time/86400)-1
	if timestowarn > 3 then
		timestowarn = 3
	end

	if timestowarn > 0 then 
		for i=1,timestowarn do 
			xWarn.Database.CreateWarn(target, targetname, 0, "xWarn", "Banned - Additional warn to scale", banid)
		end
	end
end)

Clone this wiki locally