Date not working
#1

So I have two problems, both have to do with dates but not working correctly.

First part, This is what should show the day/month of the day/month.
Код:
	// Calculating
	new Month, Day;
	getdate(Month, Day);
	{
	    new ActualDay;
		PlayerInfo[playerb][pIDay] = ActualDay;
		PlayerInfo[playerb][pIMonth] = Month;
  		PlayerInfo[playerb][pIDay] = Day;
		PlayerInfo[playerb][pIMonth] = Month;
	}
code of line i use.
Код:
	format(string, sizeof(string), "%s's statistics on American Roleplay - [%d/%d/2013]", RPN(playerb), PlayerInfo[playerid][pIMonth], PlayerInfo[playerid][pIDay]);
	SendClientMessage(playerid, COLOR_ORANGE, string);
What i see


Now the second part.
This should get the date then add how many days of VIP they have.
Код:
// Calculating
	new Year, Month, Day;
	new Hour, Minute, Second;
	gettime(Hour, Minute, Second);
	getdate(Year, Month, Day);
	if(Day+viptime >= 30)
	{
	    new ActualDay;
		Month ++;
		ActualDay = viptime - (30-Day);
		PlayerInfo[playerb][pVIPDay] = ActualDay;
		PlayerInfo[playerb][pVIPMonth] = Month;
		PlayerInfo[playerb][pVIPHour] = Hour;
	}
	else
	{
	    PlayerInfo[playerb][pVIPDay] = Day+viptime;
		PlayerInfo[playerb][pVIPMonth] = Month;
		PlayerInfo[playerb][pVIPHour] = Hour;
	}
Where this is being used.
[code] if(PlayerInfo[playerid][pVIP]) format(string, sizeof(string), "VIP Expiration: %d/%d/2013", PlayerInfo[playerid][pVIPMonth], PlayerInfo[playerid][pVIPDay]);
SendClientMessage(playerid, COLOR_VIP, string);[/calc]
What I see.


Please help me ASAP
Reply


Messages In This Thread
Date not working - by MichaelWharton101 - 05.04.2013, 14:11
Re: Date not working - by MichaelWharton101 - 05.04.2013, 19:01
Re: Date not working - by L.Hudson - 05.04.2013, 19:27
Re: Date not working - by MichaelWharton101 - 05.04.2013, 19:28
Re: Date not working - by L.Hudson - 05.04.2013, 20:06

Forum Jump:


Users browsing this thread: 1 Guest(s)