} case 1: { format(string, sizeof(string), "Administrator %s has set your VIP status to Bronze.", GetName(playerid)); format(string2, sizeof(string2), "You have set %s's VIP status to Bronze.", GetName(id)); dini_IntSet(file, "VipRank", 1); dini_IntSet(file, "VipTime", gettime() + 2592000); Player[id][VipRank] = 1;
gettime() gets the UNIX time and then you add 2,592,000ms (which is 4.32 hours aka 0.18 days).
60,000ms = 60min 14,440,000ms = 24hr 447,640,000ms = 31days (1 month) |
The number in your first post was correct
First the unix timestamp is in seconds, would it be in ms the 32 bit variable would overflow after 24 days and its running since 1970... 2 592 000 secs = 43 200 mins = 720 hours = 30 days 2 678 400 secs = 31 days Show us the code which tells you that |
if(Player[playerid][VipRank] > 0) { new file[256]; format(file, 256, "Accounts/%s.ini", GetName(playerid)); new time = (gettime() - dini_Int(file, "VipTime")); new daysleft; daysleft = strval(timec(time)); format(string, sizeof(string), "Married To: %s | Crimes: %d | Rank: %s | VIP: %s | VIP Expiration: %d Days", Player[id][MarriedTo], Player[id][CriminalOffences], Rank, VipDate, daysleft); SendClientMessage(playerid, WHITE, string); }
Here you go
Код:
if(Player[playerid][VipRank] > 0) { new file[256]; format(file, 256, "Accounts/%s.ini", GetName(playerid)); new time = (gettime() - dini_Int(file, "VipTime")); new daysleft; daysleft = strval(timec(time)); format(string, sizeof(string), "Married To: %s | Crimes: %d | Rank: %s | VIP: %s | VIP Expiration: %d Days", Player[id][MarriedTo], Player[id][CriminalOffences], Rank, VipDate, daysleft); SendClientMessage(playerid, WHITE, string); } |
//
if(Player[playerid][VipRank] > 0) {
new
file[64]
;
format(file, sizeof file, "Accounts/%s.ini", GetName(playerid));
format(string, sizeof string,
"Married To: %s | Crimes: %d | Rank: %s | VIP: %s | VIP Expiration: %s",
Player[id][MarriedTo],
Player[id][CriminalOffences],
Rank,
VipDate,
timec(dini_Int(file, "VipTime"))
);
SendClientMessage(playerid, WHITE, string);
}