ploxarik

vip system

Feb 27th, 2021
188
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. new VipTime[MAX_PLAYERS];
  2. new VipDate[MAX_PLAYERS];
  3. new VipInections[MAX_PLAYERS];
  4.  
  5. //in loaded account
  6. if(VipTime[playerid] > 0 || VipInections[playerid] > 0)
  7. {
  8.     new year,month,day;
  9.     new countout = getdate(year,month,day);
  10.     new left = VipTime[playerid]-countout;
  11.     if(left <= 0)
  12.     {
  13.         SendClientMessage(playerid, -1, "Your VIP account has expired.");
  14.         VipInections[playerid] = 0;
  15.         VipTime[playerid] = 0;
  16.         VipDate[playerid] = 0;
  17.     }
  18. }
  19. if(VipInections[playerid] > 0)
  20. {
  21.     SendClientMessage(playerid, -1,"Hello VIP player!");
  22. }
  23.  
  24. //command
  25. CMD:setvip(playerid, params[])
  26. {
  27.     //admin check
  28.     if(sscanf(params,"ddd",params[0],params[1],params[2])) return SendClientMessage(playerid, -1, " Use: /setvip [id] [level vip] [days]");
  29.     switch(params[1])
  30.     {
  31.         case 1: SendClientMessage(params[0], -1, "The administrator gave you Bronze VIP");
  32.         case 2: SendClientMessage(params[0], -1, "The administrator gave you Silver VIP");
  33.         case 3: SendClientMessage(params[0], -1, "The administrator gave you Gold VIP");
  34.         default: SendClientMessage(params[0], -1, "The administrator took your VIP Account from you.");
  35.     }
  36.     if(params[2] == 0)
  37.     {
  38.         VipInections[params[0]] = 0;
  39.         VipTime[params[0]] = 0;
  40.         VipDate[params[0]] = 0;
  41.         SendClientMessage(playerid, -1, "- You have taken VIP Status from a player.");
  42.     }
  43.     else
  44.     {
  45.         new Date[3];
  46.         getdate(Date[0], Date[1], Date[2]);
  47.         new countout = getdate(Date[0],Date[1],Date[2]);
  48.         VipInections[params[0]] = params[1];
  49.         VipTime[params[0]] = countout+params[2];
  50.         VipDate[params[0]] = countout;
  51.         SendClientMessage(playerid, -1, "- You have issued a VIP Status to the player.");
  52.     }
  53.     return 1;
  54. }
  55.  
  56. //add to load n save account
  57. //VipInections[playerid]
  58. //VipTime[playerid]
  59. //VipDate[playerid]
RAW Paste Data