nk0zkh0z Posted May 18, 2015 Posted May 18, 2015 I want to change the time afk. So here '600000' is how many seconds? local pending = {} function checkAFK() for thePlayer, isPending in pairs(pending) do if (getPlayerIdleTime(thePlayer) > 600000) then if exports.global:isPlayerFullAdmin(thePlayer) then if getElementData(thePlayer, "adminduty") == 1 then exports['anticheat-system']:changeProtectedElementDataEx(thePlayer, "adminduty", 0, false) exports.global:sendMessageToAdmins("AdmDuty: " .. getPlayerName(thePlayer):gsub("_", " ") .. " went off duty (AFK).") exports.global:updateNametagColor(thePlayer) end else triggerClientEvent(thePlayer, "accounts:logout", thePlayer, "You have been put to the character selection for being AFK.") end else pending[thePlayer] = nil end end
Mann56 Posted May 18, 2015 Posted May 18, 2015 I want to change the time afk. So here '600000' is how many seconds? 600000 milliseconds = 600 seconds = 10 minutes "When i'll grow older, i'll be stronger, they'll call me freedom, just like a waving flag" "Have confidence in yourself, no problem is impossible in life"
Walid Posted May 18, 2015 Posted May 18, 2015 I want to change the time afk. So here '600000' is how many seconds? 1 millisecond = 0.001 seconds next time before you start posting questions like that use google I recommend you to check this : Milliseconds to Seconds Conversion Calculator Do not yield your back to your enemy, might feel something strange in your ass. Two things are infinite the universe and human stupidity and i'm not sure about the universe. UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators
ALw7sH Posted May 18, 2015 Posted May 18, 2015 local pending = {} local afkTime = 30 -- In seconds function checkAFK() for thePlayer, isPending in pairs(pending) do if (getPlayerIdleTime(thePlayer) > afkTime*1000) then if exports.global:isPlayerFullAdmin(thePlayer) then if getElementData(thePlayer, "adminduty") == 1 then exports['anticheat-system']:changeProtectedElementDataEx(thePlayer, "adminduty", 0, false) exports.global:sendMessageToAdmins("AdmDuty: " .. getPlayerName(thePlayer):gsub("_", " ") .. " went off duty (AFK).") exports.global:updateNametagColor(thePlayer) end else triggerClientEvent(thePlayer, "accounts:logout", thePlayer, "You have been put to the character selection for being AFK.") end else pending[thePlayer] = nil end end end
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now