Jump to content

getPlayerIdleTime [bugged?]


Castillo

Recommended Posts

function checkAFKPlayers() 
    for index, thePlayer in ipairs(getElementsByType("player"))do -- Loop all online players 
        if (getPlayerIdleTime(thePlayer) > 300000) then -- Player hasn't moved for 300,000ms (5 minutes) 
            kickPlayer(thePlayer, "Idle for 5 minutes") -- Kick the idle player 
        end 
    end 
end 
setTimer(checkAFKPlayers, 30000, 0) -- Timer to execute every 30 seconds, checking for idlers 

Link to comment

Dude, do you think I'm one of these newbies who comes here to ask for help with all their problems? Nah, I come here ONLY when I have tried it all.

And btw, copying a wiki example WON'T HELP ME.

Now, please everyone who doesn't have idea of what is this about, DON'T REPLY.

Link to comment

Solidsnake is one of the most talented scripters, so don't think that copying from the wiki, or creating something same by yourself is going to work; he has tried everything there can be, and now asking for solutions from other scripters who may have solved this.

However, this is the wrong place to post.

Report it up at Mantis or PM one of the developers who are involved with functions.

Link to comment
i tried it , and it works fine for me ! , using latest 1.2 version

If you tried it and it works fine on you, mind giving us something to work on?

How are we going to solve this without any help. Scripting forum is for help, not to say that you know the answer and you're not going to share it until we solve it with nothing to work with.

Link to comment
i tried it , and it works fine for me ! , using latest 1.2 version

If you tried it and it works fine on you, mind giving us something to work on?

How are we going to solve this without any help. Scripting forum is for help, not to say that you know the answer and you're not going to share it until we solve it with nothing to work with.

i used the example that Evil-Cod3r posted and when i reconnect the idle time is reset'ed

Link to comment

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...