Timer!
#4

Uh, you could probably try doing something like this in your /setvip command:

pawn Код:
// Top of your script
new JoinDate[MAX_PLAYERS][4];
new ExpireDate[MAX_PLAYERS][4];

// /setvip
new year, month, day, string[128];
getdate(year, month, day);

JoinDate[playerid][1] = day;
JoinDate[playerid][2] = month;
JoinDate[playerid][3] = year;

ExpireDate[playerid][1] = day;
ExpireDate[playerid][2] = month;
ExpireDate[playerid][3] = year + 1; // notice the year + 1?
You would then link the JoinDate and ExpireDate variables to your account system, so you can save/load the values.

When the player logs in, check for this:

pawn Код:
new day, month, year;
getdate(year, month, day);
if ((year >= ExpireDate[playerid][3]) && (month >= ExpireDate[playerid][2]) && (day >= ExpireDate[playerid][1]))
{
    // Set the player's VIP to 0
}
Reply


Messages In This Thread
Timer! - by Red_Dragon. - 27.09.2012, 13:36
Re: Timer! - by Emmet_ - 27.09.2012, 13:37
Re: Timer! - by Red_Dragon. - 27.09.2012, 13:41
Re: Timer! - by Emmet_ - 27.09.2012, 13:49
Re: Timer! - by Glint - 27.09.2012, 13:59
Re: Timer! - by Red_Dragon. - 27.09.2012, 14:22
Re: Timer! - by Glint - 27.09.2012, 14:27
Re: Timer! - by Red_Dragon. - 27.09.2012, 14:31
Re: Timer! - by Red_Dragon. - 28.09.2012, 10:44
Re: Timer! - by NoahF - 28.09.2012, 10:45

Forum Jump:


Users browsing this thread: 1 Guest(s)