View Full Version : MySQL vip for 1 month.

22/10/2013, 09:34 AM
I have searched but i don't find any mysql one.
Can anybody tell me how to make a vip system with a limited time of 1 month and save it in mysql database.

Thank You.

22/10/2013, 09:54 AM
Well, I can't make the whole script for you, but I can give you a little suggestion - use unix timestamps (http://forum.sa-mp.com/showthread.php?t=254915) for the temporary system.

JaKe Elite
22/10/2013, 09:58 AM
Are you talking about something like a vip with specified days, and when the day comes, the player's vip expired?
If you're talking about that, You might need to use unixtimestamp.

22/10/2013, 10:02 AM
how to add this system in this code below.

COMMAND:makevip(playerid, params[])
if(GetPlayerAdminLevel(playerid) < 7) return SendClientMessage(playerid, COLOR_ORANGE, "=> You're not authorized to use this command!");
new target, level;
if(sscanf(params, "ui", target, level)) return SendClientMessage(playerid, COLOR_ORANGE, "=> Usage: /makevip [playerid/name] [level]");
else if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ORANGE, "=> Enter a valid player ID/name!");
SetPVarInt(target, "VIP", level);
new string[128], pName[MAX_PLAYER_NAME], gName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
GetPlayerName(target, gName, MAX_PLAYER_NAME);
format(string, sizeof string, "=> Admin %s has set %s VIP.", pName, gName);
format(string, sizeof string, "=> Admin %s has set your VIP level to %i.", pName, level);
SendClientMessage(target, COLOR_ROYALBLUE, string);
format(string, sizeof string, "%s set %s admin level to: %i", pName, gName, level);
Log("MakeAdmin", string);
return 1;

zT KiNgKoNg
22/10/2013, 10:08 AM
If you don't understand how to use Unix Timestamps then i suggest you post a reply on one of the six script request threads or look for a filterscript since i know there is one somewhere on the forums, just can't find it for you at this current time.

JaKe Elite
22/10/2013, 10:21 AM
go to ___'s tutorial, He create a whole explanation about Unix Timestamp.

22/10/2013, 10:27 AM
You have to check if he is vip maybe every connection or where you want.. you need to create a query by saving the current date plus one month after which uses another query to check if the current date is greater than the date that you saved

22/10/2013, 10:27 AM
Ehh, I just made one that checks if day > daylastintxtfile days++ then save that (along with the getdate day). Then again, I only did that so they didn't lose VIP days if the server was down for an entire day.