Posts: 1,072
Threads: 168
Joined: Aug 2012
Reputation:
0
Hi, I want to make it so if you've been offline for x ammount of days your stuff like house and vehicles will be automaticlly sold.
I was thinking it should work with just make a variable in the user account that will go ++ each day and be resetted too 0 everytime he login. How can I count the days and add ++ to the user's offline days once a new day comes??
Posts: 1,197
Threads: 213
Joined: Feb 2011
Reputation:
0
It would be pretty simple if you're using mysql, as mysql allows you to easily update a player's account whilst their offline. You'd need to have a timer in the script, that starts when the gamemode starts, and if the gamemode ever exits, save the current time, and reload from that time, in case of server crashes or server restarts. Then decide how often you want to add to the users offline time, and go from there.
Posts: 1,072
Threads: 168
Joined: Aug 2012
Reputation:
0
Can I still do it to an offline user without mysql?
Posts: 1,197
Threads: 213
Joined: Feb 2011
Reputation:
0
You could but it would be annoying and difficult.
Posts: 1,072
Threads: 168
Joined: Aug 2012
Reputation:
0
What do you mean with "now here gt num of rows in players database" ?
EDIT: I allready have it saved in pinfo enum when the player last where online. Can I use that and just check it when the player login?
Posts: 1,072
Threads: 168
Joined: Aug 2012
Reputation:
0
How do I loop the files in my userfolder? Both those who are off and online??
I don't understand that part.