[Request] A command that asks all players if they are 'AFK' - they have 2 minutes to react to it, otherwise they are kicked

Our server is pretty much always at 32/32 people and our staff don’t have the time to keep checking if everyone is AFK or not.

I am looking into writing a script that checks if the person is AFK or not, then disconnecting them if they are.

The command would be /afkcheck or something like that.

Could someone help me write this?

I’m already aware of this one: [Release] AFK and High Ping Kick but it doesn’t quite do what I’m looking for.

Here’s an issue with this, I feel like a lot of people wouldn’t see it and would get kicked for no reason. Maybe do /afkcheck and then if you don’t move within 2 minutes it kicks them?

@Fourthbeam,

This would be a rather easy script to write, if you know either LUA or C# and know how to properly use FiveM Runtimes/Natives. It might also need to be considered that people release modifications for you to be able change their written code for your purposes.

Yeah. It would need to be pretty obvious that it’s asking. Not just a chat popup but a whole screen popup preferably.

I am fine with editing and reusing code but not great at creating it from scratch.

I’m not sure how I would go about doing this one.

@Fourthbeam,

What would be the language you would wish for this type of resource to be created within. Also would you like it to be command prompted, notification or a menu?

You sure that you can’t use a normal afkkick resource? I don’t think that your players would like it. For example If they are driving away from the cops and can’t use the chat or what you want to use.

If you really think that you need this, I would say that it is a good choice to use a button like ‘H’ or something to not get kicked.

Just reply in here, that I know what you think about it.

Take a :hamburger:

1 Like

Command prompted. I literally just admins to be able to type, “/afkcheck” and it pops up.

Language, lua =)

I mean, as active RPers ourselves, it’s easy to know when RP is happening. Usually that RP involves cops.

well I could make that for you, but you need to say how exactly you want it.
There are couple of ways that are able how it could work:

[1] something like that:
picture
(this would appear on your screen when someone (admin) types in chat your command)

[2] something like that:
admin types in chat the command, all users have to write into chat to accept that they aren’t afk

[3] pops up (like you said)
menu is possible and:
something like this: (very difficult, didn’t did that before…)

Just define how exactly it should work and I will upload it than finished here.

Hey thanks for the options, that’s hella nice of you.

I think Option A is probably the best. Something basic that stays on the screen til they press it. They would have 3-5 minutes (definable in config) to press the Button it asks them to.

Ideally, it would repeat the check every minute or so until they got kicked, in case they accidentally had the notification removed.

The button could be ‘G’ or ‘H’. Those would work great.

Thank you very much man.

alright, I will upload it in a few hours or less.

1 Like

Isn’t it an idea to have an automatic check on idle?
Like for example 3-5 minutes no movements (since that’s what you’ve indicated already) and then automatically show a warning to the player?

and it COULD then also send an message to the admins that a playet MIGHT be idle.
I think this will also 'lower workload" on the admins :slight_smile:

And it will also work as an “auto admin” when the admins are not online (still ensuring ‘freeing slots’ when players are AFK) :slight_smile:

Could even make it so that you can exclude admins form the ‘auto kicker’ :slight_smile:

Just quickly posting this before @Real-hamburger starts scripting and would/might need to change it later on haha :slight_smile:

1 Like

The one I linked already does that :slight_smile:

Ahh okay sorry my bad :wink: Didn’t knew that one since i write 99% of the stuff custom for my server :slight_smile:

Can i ask what your motivation is to wanting to check it all manually (all the time)?

Not that it’s a ‘complaint’ or so haha, but just curious why you would want that ‘extra admin work’? :slight_smile:

We sometimes have queues of over 20 people, so if someone is AFK, I want them to log off. Other times the server is at 10 or so people, so I don’t mind if people are AFK for longer.

I am sorry, got something to do, guess I upload it tomorrow…

Ahh okay like that, would’t it be more ‘useful’ (to you and your admins ofcourse) if you can turn on the ‘auto kicker’ OR even "better’ make it ONLY “kick in” (pun intended :P) when it’s something like this:

if CurrentPlayerCount > 30 then
   CheckForAFKAndAutoKick()
end

NOTE: This is just a HYPOTHETICAL CODE of course :wink:

This way people CAN be afk for long when the server has “low user load”
if i has a 'full load" it will auto kick for you :slight_smile:

That’d be nice absolutely =)

Do you already have an “automatic idle kick script” in use at this moment?