16.06.2012, 19:30
Hello,
Timmers are useless here, because they will deduct value of your var only when player is online.
If player stats saves in *.ini, you can do sth like this.
When player buys licence, do something like this:
Date[2] - Year
Date[1] - Month
Date[0] - Day
Okay, so now you know, when player bought this licence.
For eg, 2012.06.21
Good. If you have enum, add there variable:
And
So variables from enumelator will assign values of Month, Year and Day when player bought licence.
All you need to do now, is to somehow save these values, and make scrpit which will calculate an exact
date which will be after 21 days. You need to think a bit, cuz if you simply add this 21 days to current day,
server will have such info:
Such day doesnt exists, does it?
I had script which calculates such things on my old PC (cuz I did same thing like you on my own, W/O any support ^^).
If you do this script, you can make in same way as eDate's xDate's, which will be assigned with values of date, when server must remove player license.
Understand anything? xD
Good luck!
Greetz,
Lets
Timmers are useless here, because they will deduct value of your var only when player is online.
If player stats saves in *.ini, you can do sth like this.
When player buys licence, do something like this:
pawn Код:
...
new Date[3];
GetDate(Date[2], Date[1], Date[0]);
..
Date[1] - Month
Date[0] - Day
Okay, so now you know, when player bought this licence.
For eg, 2012.06.21
Good. If you have enum, add there variable:
pawn Код:
enum something
{
...
eDateD,
eDateM,
eDateY
..
}
Player[MAX_PLAYERS][something];
pawn Код:
Player[playerid][eDateD] = Date[0];
Player[playerid][eDateM] = Date[1];
Player[playerid][eDateY] = Date[2];
All you need to do now, is to somehow save these values, and make scrpit which will calculate an exact
date which will be after 21 days. You need to think a bit, cuz if you simply add this 21 days to current day,
server will have such info:
Код:
Server: Ohh, damn, I've to remove his licence in 42.06.2012?? Oh ma god.. -,-
I had script which calculates such things on my old PC (cuz I did same thing like you on my own, W/O any support ^^).
If you do this script, you can make in same way as eDate's xDate's, which will be assigned with values of date, when server must remove player license.
Understand anything? xD
Good luck!
Greetz,
Lets