TigoAntiCheat icon indicating copy to clipboard operation
TigoAntiCheat copied to clipboard

Autoban based on X amount of explosions

Open CruelAlpha opened this issue 5 years ago • 1 comments

Hi there, Not sure if this would be useful for you but could some sort of auto ban go out if there are X explosions by someone? Code for example can be:

recentExplosions = {}

		AddEventHandler('explosionEvent', function(sender, ev)
		if Components.Explosions and ev.damageScale ~= 0.0 and ev.ownerNetId == 0 then -- make sure component is enabled, damage isnt 0 and owner is the sender
			ev.time = os.time()
			table.insert(recentExplosions, {sender = sender, data=ev})
		end
	end)
end)

Citizen.CreateThread(function()
	while true do 
		Wait(2000)
		clientExplosionCount = {}
		for i, expl in ipairs(recentExplosions) do 
			if not clientExplosionCount[expl.sender] then clientExplosionCount[expl.sender] = 0 end
			clientExplosionCount[expl.sender] = clientExplosionCount[expl.sender]+1
			table.remove(recentExplosions,i)
		end 
		recentExplosions = {}
		for c, count in pairs(clientExplosionCount) do 
			if count > 5 then
				local license, steam = GetPlayerNeededIdentifiers(c)
				local name = GetPlayerName(c)
(SEND AUTO BAN FUNCTION HERE)

			end
		end
	end
end)

CruelAlpha avatar Feb 06 '20 05:02 CruelAlpha

This is definitely a good feature, I'll look at this and make it possible in the antichaet

ThymonA avatar Feb 06 '20 07:02 ThymonA