Finding the date after n days? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Finding the date after n days? (
/showthread.php?tid=259905)
Finding the date after n days? -
leong124 - 06.06.2011
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.
Re: Finding the date after n days? -
Tee - 06.06.2011
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.
Re: Finding the date after n days? -
xir - 06.06.2011
https://sampforum.blast.hk/showthread.php?tid=254915
Re: Finding the date after n days? -
Tee - 06.06.2011
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.
Re: Finding the date after n days? -
leong124 - 07.06.2011
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.