[Release] AFK and High Ping Kick

This allows you to automatically kick players who are AFK for too long or those who have a too high ping. Also it’s configurable (check files).

It’s 2 seperate resources, so you can choose which one you want.

Download

18 Likes

Again a good release, keep up the good work :slight_smile:

Nice release, you are rapidly posting great and very useful scripts for everyone to use. Keep up the good work :slight_smile:

very useful and working … thx man

i changed the afk to 2 minutes 120 seconds and no kick and i know its loaded cause it says it on the server porgram

Compatible esx ? svp

Any possibility of having the ping displayed by typing /ping or just having it on the hud?

Hi Is there a way to make it to where it doesnt kick the owner of server? The reason I ask is because I can be in the server but working on the server at the same time then end up being kicked and have to rejoin to see if what i was just working on worked or not.

Of course. You can just put a simple check in to get groups. so if your group == user then kick. Or you can specify it to check a group you want

how would i go about that? sorry still learning how to script

How can I add Anti Kick for Admins?

Resolved!

Just saw this thanks man 10/10 good script!

Hey!
How you did it?
Thanks!

I have problem when a player died, because the player’s position not changed within 3min, this player will be kicked out, even died.
So here my modification in the client.lua

-- CONFIG --

-- AFK Kick Time Limit (in seconds)
secondsUntilKick = 180

-- Warn players if 3/4 of the Time Limit ran up
kickWarning = true

-- CODE --

Citizen.CreateThread(function()
	while true do
		Wait(1000)
		playerPed = GetPlayerPed(-1)
		if (not IsEntityDead(playerPed)) then
		--if playerPed then
			currentPos = GetEntityCoords(playerPed, true)
			if currentPos == prevPos then
				if time > 0 then
					if kickWarning and time == math.ceil(secondsUntilKick / 4) then
						TriggerEvent("chatMessage", "WARNING", {255, 0, 0}, "^1You'll be kicked in " .. time .. " seconds for being AFK!")
					end

					time = time - 1
				else
					TriggerServerEvent("kickForBeingAnAFKDouchebag")
				end
			else
				time = secondsUntilKick
			end

			prevPos = currentPos
		end
	end
end)

Any chance to protect admins against kick? :wink:
Thanks

1 Like

Me too Thx

I wanna know too Thx

just a quick one, when a player gets kicked on my server they can’t join back. there game just crashes anyway to fix this.

Thanks
Panda

I’ll wait to download it then. Lmao.

can i rewrite this script and share it ?