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
#2

Anyone
Reply
#3

I think you put the getdate wrong since it's
pawn Код:
gettdate(year, month, day)
Reply
#4

Did not help me
Reply
#5

Like this

pawn Код:
new Year, Month, Day;
    getdate(Year, Month, Day);
    {
        new ActualDay;
        PlayerInfo[playerb][pIDay] = ActualDay;
        PlayerInfo[playerb][pIMonth] = Month;
        PlayerInfo[playerb][pIDay] = Day;
        PlayerInfo[playerb][pIMonth] = Month;
                PlayerInfo[playerb][pYear] = Year; // Add this enum
    }
pawn Код:
format(string, sizeof(string), "%s's statistics on American Roleplay - [%d/%d/%d]", RPN(playerb), PlayerInfo[playerid][pIMonth], PlayerInfo[playerid][pIDay], PlayerInfo[playerid][pYear]);
    SendClientMessage(playerid, COLOR_ORANGE, string);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)