Jump to content

AFK in Scoreboard


Recommended Posts

Posted

hello everyone, who know how to do this in scoreboard? (AFK)

I have 1 year searched this, I try to make it and I can not, any one know how?

gta_sa_2014_07_14_16_24_19_24.png

76561198387870432.png

ZI ZOMBIE INFECTION: mtasa://5.196.7.163:22003

560x95_FFFFFF_FF9900_000000_000000.png

Posted

this would do i think:

getPlayerIdleTime -- checks his idle time 
setElementData -- for the score board 

it's easy.

tested and works, make sure to add AFK Scoreboard column

function checkAFKPlayers() 
    for index, thePlayer in ipairs(getElementsByType("player"))do  
        if (getPlayerIdleTime(thePlayer) > 5000) then -- Player hasn't moved for 5 seconds 
            setElementData(thePlayer, "AFK", "Yes") 
           else 
             setElementData(thePlayer, "AFK", "No") 
        end 
    end 
end 
setTimer(checkAFKPlayers, 2000, 0) 

Aftermath

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...