i got more problems
#6

Quote:
Originally Posted by Kaliber
Посмотреть сообщение
Ok dude, first...write this function like this if you want DD/MM/YYYY

PHP код:
//Write it at the end of your script
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);
}
//Then in dialog response:
new age GetPlayerAge(inputtext);
if(
age == -1) return ShowPlayerDialog(playeridDIALOG_AGEDIALOG_STYLE_INPUT"Age:[6-35]""When were you born? ?\n[DD/MM/YYYY]""Next""");
//Otherwise the age is good :) 
1. Use a timer:

PHP код:
//OnGameModeInit
SetTimer("@checkPlayer",999,0);
//Then outside
@checkPlayer();@checkPlayer() {
    for(new 
i,l=GetPlayerPoolSize()+1i<li++)
    {
        if(!
IsPlayerInRangeOfPoint(i,3.0,x,y,z)) continue; //replace x,y,z with your coords
        
GameTextForPlayer(i, ...);        
    }
    return 
1;

2. You can use a TextDraw that you draw over it

3. Yes it's obviously a string because of the /
I wish i can give you again +rep but that say me a stupid message ..

Solved .
Reply


Messages In This Thread
[Solved] I got problems - by Mariciuc223 - 16.07.2015, 15:01
Re: i got more problems - by Mariciuc223 - 16.07.2015, 19:12
Re: i got more problems - by Mariciuc223 - 17.07.2015, 09:07
Re: i got more problems - by PrinceKumar - 17.07.2015, 09:16
AW: i got more problems - by Kaliber - 17.07.2015, 09:23
Re: AW: i got more problems - by Mariciuc223 - 17.07.2015, 10:31

Forum Jump:


Users browsing this thread: 1 Guest(s)