28.07.2016, 13:40
Have a variable to store the time in which the lease will expire
And set a timer that will check every minute or every hour if the timestamp has been reached or exceeded
That code would check every hour(to prevent spamming the server with checks) if the 30 days has passed.
Код:
House[houseid][ExpirationDate] = gettime() + 60 * 60 * 24 * 30 //The current timestamp with addition of 30 days, converted to seconds
Код:
House[houseid][ExpirationTimer] = SetTimerEx("CheckTimestamp", 60 * 1000 * 60, true, "i", houseid);
forward CheckTimestamp(houseid);
public CheckTimestamp(houseid)
{
if(gettime() >= House[houseid][ExpirationDate]) {
//Date reached
KillTimer(House[houseid][ExpirationTimer]);
//Do whatever you want here
}
return 1;
}

