SA-MP Forums Archive
VIP Temporary help! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: VIP Temporary help! (/showthread.php?tid=382402)



VIP Temporary help! - RyanPetersons - 03.10.2012

i added in my vip cmd..

pawn Код:
getdate(year,month,day);
dini_IntSet(path,"vipdate",day);
and i added on onplayerconnect
pawn Код:
new year,month,day;
            getdate(year,month,day);
if(day - 0 > dini_Int(path,"Vip"))
            {
            pInfo[playerid][vip] = 0;
            SendClientMessage(playerid,Red,"Your vip subscription is finished");
            }
It compiles correct, but it doesn't work, pleaze help me with this...


Re: VIP Temporary help! - Roel - 03.10.2012

you should use timestamp for this.
instead of saving the data, save the timestamp
Код:
expiretimestamp = gettime() + TOTAL DAYS HE WILL BE VIP * 24 * 60 * 60;
// remove the TOTAL DAYS HE WILL BE VIP to the days he will be vip.
// save expiretimestamp into the dini as 'vipdate'
Код:
// For exampe at every login you use this:
if(dini_Int(path,"vipdate") < gettime())
{
  // expired
}