SA-MP Forums Archive
Age from DOB - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Age from DOB (/showthread.php?tid=341940)



Age from DOB - SpankMe2 - 12.05.2012

Hey, I was just wondering how can I get a age from DOB.

EXAMPLE: 12/05/2012 - 0 days old

12/05/2012 - 1 year old.

I need to know that from that exact format for my RP server. This way I can ask this in a dialog and convrt it to an age and update their age on that date


Re: Age from DOB - SuperViper - 12.05.2012

pawn Код:
GetPlayersAge(playerid)
{
    new curDate[3];
    getdate(curDate[0], curDate[1], curDate[2]);
    return curDate[0] - PlayerInfo[playerid][pBornYear];
}