Don’t take this the wrong way, if your resource is using ~200 lines of code it’s either poorly developed or has way too much bloat. The below does in 41 lines what you have done in 200 lines (excluding the fxmanifest.lua file).
But hey, if you get people to pay for something which is simple enough for a beginner to work on then best of luck.
Config
Config = {}
Config.Framework = "esx" -- esx or qbcore ( notificationsystem )
Config.kickWarning = true -- set if player should get a notifcation warning before getting kicked
Config.secondsUntilKick = 120-- How long they can be AFK before they get kicked in seconds
Config.KickedSoonMsg = "You're being kicked in" -- set the Earlynotify text
Config.Notifytreason = "For being afk too long" -- set your notify reason
Config.Notifytime = 5000 -- Set how long the notify has to be displayed in miliseconds
Config.PlayerDroppedmsg = "You were kicked for being afk too long!" -- Set the message players will see in the FiveM menu after getting kicked
Config.EnableWarningSound = true -- set to true or to false to disable/enable a warningsound
Client
Citizen.CreateThread(function()
while true do
Wait(1000)
local playerPed = PlayerPedId()
if playerPed then
local currentPos = GetEntityCoords(playerPed, true)
if prevPos and currentPos == prevPos then
if timeLeft > 0 then
if Config.kickWarning and timeLeft == math.ceil(Config.secondsUntilKick / 4) then
if Config.EnableWarningSound then PlaySoundFrontend(-1, "BASE_JUMP_PASSED", "HUD_AWARDS", 0, 1)
end
if Config.Framework == "esx" then
ESX.ShowNotification(Config.KickedSoonMsg .. " " .. timeLeft .. " seconds" .. " (" .. Config.Notifytreason .. ")", Config.Notifytime)
elseif Config.Framework == "qbcore" then
TriggerEvent("qb:sendNotification", {text = Config.KickedSoonMsg .. " " .. timeLeft .. " seconds" .. " (" .. Config.Notifytreason .. ")", type = "warning", timeout = Config.Notifytime, layout = "centerLeft", queue = "left"})
end
end
timeLeft = timeLeft - 1
else
TriggerServerEvent("antiafk:server:kick")
end
else
timeLeft = Config.secondsUntilKick
end
prevPos = currentPos
end
end
end)
If you can open your eyes properly, the code where the distance check is happening is client side i.e. more resmon. Mine runs at 0.00 resmon.
Secondly, it does not have “captcha”. Which means it will kick people without giving them any warnings or if they are roleplaying as “sitting on a bench”
Thirdly, I have a system where it detects if a player is using “macro” to move around or using any tools which avoids getting AFK kick.
So before you think you are smart, you probably aren’t in 90% cases.
Please provide the link with the above mentioned features *
If someone is not willing to pay, they should not be surfing ‘paid’ section on FiveM. You should be using GitHub to find free scripts.
People purchase scripts to get “support” from creators. And the price for a script is decided upon how long and what quality of support is going to be given. My scripts come with 80% price for support 20% for the actual code.
People who cannot afford paying for someone’s time should not come to any threads to waste someone’s time.
that is quite incorrect, it’s not that your resource has “0.00 resmon” it’s just that the calculations are done server sided so the load is given to the server that is (hopefully) better that the client at handling that, so it apperas 0 for the client but you should check it from the server side to see the real value.
Nothing to say abt the resource, everyone is free to do whatever they want just wanted to make sure you knew about this.