27.09.2012, 13:49
Uh, you could probably try doing something like this in your /setvip command:
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 Код:
// 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?
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
}