Problem with registration date
#1

Hello, I have a problem, create a user registration system, that is, detect the date, but in / stats does not come out. Only the first number of the record comes out, what can it be?

Login:

Код:
db_get_field_assoc(Result, "REGISTRO", Field, 45);
PlayerInfo[playerid][Registro]=strval(Field);
/Stats

Код:
format(stats,sizeof(stats),"{00FF00}» Registro: {FFFFFF}%d/%d/%d\n",PlayerInfo[playerid][Registro]);
strcat(xdxdxd,stats);
Image:
Reply
#2

help
Reply
#3

You are using three '%d' specifiers, yet you define one of them.
Reply
#4

Help!
Reply
#5

You're defining just one '%d' specifier with 'PlayerInfo[playerid][Registro]'.
So the two other '%d' specifiers, will return '0'.
PHP код:
format(stats,sizeof(stats),"{00FF00}» Registro: {FFFFFF}%d/%d/%d\n",PlayerInfo[playerid][Registro]); 
Do you understand that?
Reply
#6

Yes, but then how would it be? If I put one, it does not walk the same.
Reply
#7

try using especifier %s to strings

PHP код:
format(stats,sizeof(stats),"{00FF00}» Registro: {FFFFFF}%s",PlayerInfo[playerid][Registro]); 
Reply
#8

It does not work.
Reply
#9

Set your column REGISTRO type Varchar, and use this function to get Date and Hour



PHP код:
Before Main()
new 
Meses[12][11] =    { {"Enero"}, {"Febrero"}, {"Marzo"}, {"Abril"}, {"Mayo"}, {"Junio"}, {"Julio"}, {"Agosto"}, {"Septiembre"}, {"Octubre"}, {"Noviembre"}, {"Diciembre"} };
ReturnDate()
{
    static 
date[36] ;
    
getdate(date[2], date[1], date[0]);
    
gettime(date[3], date[4], date[5]);
    
date[1]--;
        
    if(
date[3] < 12){
        
format(datesizeof(date), "%02d %s %d, %02d:%02d AM "date[0], Meses[date[1]], date[2], date[3], date[4]);
    }
    else if(
date[3] > 12){
        
date[3] = date[3]-12;
        
format(datesizeof(date), "%02d %s %d, %02d:%02d PM"date[0], Meses[date[1]], date[2], date[3], date[4]);
    }
    else if(
date[3] == 12){
        
format(datesizeof(date), "%02d %s %d, %02d:%02d PM"date[0], Meses[date[1]], date[2], date[3], date[4]);
    }
    return 
date;

Reply
#10

I want to find solution to the script that I put, because in the database it detects it well, the problem is in the command /stats
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)