07.07.2012, 11:04
This is a simple AFK system that make players who are AFK for 15 minutes invisible. When the player gets back from AFK, he will be visible again.
- Each second all players will be checked and their old coordinates stored
- If at the next check the location did not change, the player is considered AFK and will be checked each second again.
- After 900 seconds (15 minutes) of being AFK, the player will be set in another VW
- If the player is back and moves, he is no longer AFK. The AFK timer will reset and if the player was invisible, he'll be visible again
- If the player types something, the AFK timer resets
- If the player disconnects, he will be visible again to avoid problems with servers that save player data
- This only works for people in VW 0 already
Pastebin;
http://pastebin.com/jvdxjqyb
- Each second all players will be checked and their old coordinates stored
- If at the next check the location did not change, the player is considered AFK and will be checked each second again.
- After 900 seconds (15 minutes) of being AFK, the player will be set in another VW
- If the player is back and moves, he is no longer AFK. The AFK timer will reset and if the player was invisible, he'll be visible again
- If the player types something, the AFK timer resets
- If the player disconnects, he will be visible again to avoid problems with servers that save player data
- This only works for people in VW 0 already
Pastebin;
http://pastebin.com/jvdxjqyb