[Help] Vip System
#1

hey guys may you could help me out on this i have this vip system but when i make someone vip it give the expire date but instead that it say it will expier in a month it say a day.... strange becouse i dont know how to fix this anyone ?

Код:
 	if(strcmp(cmd, "/makevip", true) == 0)
	{
     	GetPlayerName(playerid, sendername, sizeof(sendername));
		if(PlayerInfo[playerid][pAdmin] >= 99999 || strcmp(sendername, "Tommy_Martins", true) == 0)
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makevip [playerid/PartOfName] [rank]");
				SendClientMessage(playerid, COLOR_WHITE, "1 - Bronze || - Silver || 3 - Gold || 4 - Platinum || 5 - Moderator");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if(giveplayerid == INVALID_PLAYER_ID)
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Invalid player.");
				return 1;
			}
			new x_string[64];
			x_string = strtok(cmdtext, idx);
			if(!strlen(x_string))
			{
			    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makevip [playerid/PartOfName] [rank]");
				return 1;
			}
			new Year, Month, Day;
			getdate(Year, Month, Day);
			if(strcmp(x_string,"0",true) == 0)
			{
			    PlayerInfo[giveplayerid][pDonateRank] = 0;
				format(string, sizeof(string), "Admin %s has revoked you of your VIP status.", PlayerName(playerid));
				SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
				ClearVIP(giveplayerid);
				return 1;
			}
			else if(strcmp(x_string,"1",true) == 0)
			{
				PlayerInfo[giveplayerid][pDonateRank] = 1;
				format(string, sizeof(string), "Your Donator rank has been set to Bronze VIP by the administrator %s.", PlayerName(playerid));
				SendClientMessage(giveplayerid, COLOR_WHITE, string);
			}
			else if(strcmp(x_string,"2",true) == 0)
			{
				PlayerInfo[giveplayerid][pDonateRank] = 2;
				format(string, sizeof(string), "Your Donator rank has been set to Silver VIP by the administrator %s.", PlayerName(playerid));
				SendClientMessage(giveplayerid, COLOR_WHITE, string);
			}
			else if(strcmp(x_string,"3",true) == 0)
			{
				PlayerInfo[giveplayerid][pDonateRank] = 3;
				format(string, sizeof(string), "Your Donator rank has been set to Gold VIP by the administrator %s.", PlayerName(playerid));
				SendClientMessage(giveplayerid, COLOR_WHITE, string);
			}
   			else if(strcmp(x_string,"4",true) == 0)
			{
				PlayerInfo[giveplayerid][pDonateRank] = 4;
				format(string, sizeof(string), "Your Donator rank has been set to Platinum VIP by the administrator %s.", PlayerName(playerid));
				SendClientMessage(giveplayerid, COLOR_WHITE, string);
			}
			else if(strcmp(x_string,"5",true) == 0)
			{
				PlayerInfo[giveplayerid][pDonateRank] = 5;
				format(string, sizeof(string), "You have been promoted to a VIP moderator by the administrator %s.", PlayerName(playerid));
				SendClientMessage(giveplayerid, COLOR_WHITE, string);
			}
			format(string, 32, "%02d/%02d/%d", Month, Day, Year);
			strmid(PlayerInfo[giveplayerid][pVIPJoinDate], string, 0, strlen(string), 255);
			format(string, 32, "%02d/%02d/%d", Month+1, Day, Year);
			strmid(PlayerInfo[giveplayerid][pVIPExpDate], string, 0, strlen(string), 255);
			if(Month == 12) { format(PlayerInfo[giveplayerid][pVIPExpDate], 32, "%02d/%02d/%d", 1, Day, Year+1); }
			format(string, sizeof(string), "You have recieved your donator rank in %s - It will Expire in %s", PlayerInfo[giveplayerid][pVIPJoinDate], PlayerInfo[giveplayerid][pVIPExpDate]);
			SendClientMessage(giveplayerid, COLOR_GRAD2, string);
		}
		else { SendClientMessage(playerid, COLOR_GRAD2, "You are not authorized to use this command."); }
		return 1;
	}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)