Finding the date after n days?
#1

I'm recently making my house system with renting.
I want to know how to easily get the data after n days from today, so that I can correctly reduce players' money for each n days. I've searched it and I can't find any topics about it.

Any idea? Do I need to set arrays of days of months, leap year, etc. and calculate them myself? Thanks.
Reply
#2

May I add to this? In my house and business system, I want to sell either one of them if the owner is inactive for 5 days, I just haven't figured out a way to do it yet.
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=254915
Reply
#4

Hey leong124 thanks for asking the question, Xir thanks for answering it . But one thing, this only works mainly with V.I.P because it is executed when the player connects, so if a player is inactive for 6 days then connects on the 7th day, the house/business will then be sold at that time.
Reply
#5

Seems that it can't help me.
Yes it may check if n days is passed, but I also want to calculate the next date to pay for the renters.
We can't decode time stamp into date which is my problem.
Anyway, thanks for the help.

Tee: I think you can set a timer that will run only once in a day(or OnGameModeInit if your server restarts everyday) to check the time, so that when the players is inactive for 5 days their properties will be sold instantly.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)