[Help] Player inactivity timer
#1

I have a house system and I want to be able to add a timer so that it automatically detects if a player hasn't been on for 7 days.
Reply
#2

You don't need a timer, save the date (try timestamp [date in seconds]) on the player's file. Then, when they login and it's been over 7 days compared to what is saved on their file, reset their house.

Or if you're using MySQL then it's easy to check with a timer (preferably repeat set to every hour). You just have to again save the LastLogin, and make a query checking if any players haven't logged in for 7 days or more and own a house (also you should add this method when they login to be safe).

Method for MySQL can be used as well if your file saving system is SQLite.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)