SA-MP Forums Archive
Mini Help - 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)
+--- Thread: Mini Help (/showthread.php?tid=612145)



Mini Help - Zorono - 14.07.2016

Please do anyone know how to count 1 Month From Today's Date (getdate(blabla,blabla,blabla)) and after that month something ............. will expire or happen for the player when he connect (OnPlayerConnect) please help


Re: Mini Help - Konstantinos - 14.07.2016

60 seconds = 1 minute
60 minutes = 1 hour
24 hours = 1 day

60 * 60 * 24 = 86400 seconds a day
86400 * 30 (days) = 2592000 seconds


Re: Mini Help - Zorono - 14.07.2016

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
60 seconds = 1 minute
60 minutes = 1 hour
24 hours = 1 day

60 * 60 * 24 = 86400 seconds a day
86400 * 30 (days) = 2592000 seconds
please example code i tried to make code but i still don't understand how to detect if today will expire his warning


Re: Mini Help - Konstantinos - 14.07.2016

pawn Код:
new expire_at = gettime() + 2592000;
Save it and when a player connects, read the value and compare:
pawn Код:
if (gettime() >= expire_date)
{
    // it has been expired
}