Timer!
#1

I need an FS or something to let me give a TEMPORARILY vip i have three types of vip in my script: bronze, silver and gold but when i /setvip to someone it goes to him PERMANENTLY but i want to give as i choose like giving a brozne for 1 month or 2 and like giving silver for 1 year and so on
and thanks
Reply
#2

tempvip.zip
Reply
#3

Ehm... this link open the script request thread #5 :S
Reply
#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
#5

Learn UNIX (POSIX) Timestamps they are really useful https://sampforum.blast.hk/showthread.php?tid=254915
Reply
#6

I learned the UNIX TimeStamps but i didn't understand anything from it
Reply
#7

Quote:
Originally Posted by Red_Dragon.
Посмотреть сообщение
I learned the UNIX TimeStamps but i didn't understand anything from it
You learned it but you didn't understand anything from it!

Then how did you learn it ?
Reply
#8

Sorry it was a mistake, I meant i didn't understand it I READ IT but didn't understand it
Reply
#9

Bump -.-
Reply
#10

Post in the script request thread/section.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)