Hello xD
#5

Quote:
Originally Posted by runcis
Посмотреть сообщение
It's easy to get age form date.

e.g.
Код:
PlayerData[playerid][pAge] = 2015-Year;
Thats Bullshit...

Then the age is to 50% wrong...

PHP код:
stock const g_days_m[12] = {312831303130313130313031};
stock GetPlayerAge(input[])
{
    new 
date[12];
    
strcat(dateinput);
    if(
date[1] == '.'strins(date"0"012);
    if(
date[4] == '.'strins(date"0"312);
    if(!
date[9] || date[10]) return -1;
    new 
day 10*(date[0]-48)+(date[1]-48);
    new 
month 10*(date[3]-48)+(date[4]-48);
    new 
year 1000*(date[6]-48)+100*(date[7]-48)+10*(date[8]-48)+(date[9]-48);
    if(
year 1000 || year 9999 || month || month 12 || day 1) return -1;
    if(
month == 2)
    {
        if(
day 28 && (year != || (year 100 == && year 400 != 0))) return -1;
    }
    else if(
day g_days_m[month-1]) return -1;
    new 
dmy;
    
getdate(ymd);
    new 
age year;
    if(
monthage--;
    else if(
== month && dayage--;
    return (
age 0) ? (-1) : (age);

Greekz
Reply


Messages In This Thread
Hello xD - by Mariciuc223 - 16.07.2015, 05:45
Re: Hello xD - by X337 - 16.07.2015, 05:47
Re: Hello xD - by Roberto80 - 16.07.2015, 06:37
Re: Hello xD - by thaKing - 16.07.2015, 06:44
AW: Re: Hello xD - by Kaliber - 16.07.2015, 06:55
Re: AW: Re: Hello xD - by thaKing - 16.07.2015, 06:57
Re: Hello xD - by Mariciuc223 - 16.07.2015, 09:24

Forum Jump:


Users browsing this thread: 1 Guest(s)