SA-MP Forums Archive
RegDate - 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: RegDate (/showthread.php?tid=633986)



RegDate - Despacito - 11.05.2017

I'm trying to show register date in /stats.

This is what i did in /stats command:

pawn Код:
format(temp, sizeof(temp), ""WHITE"Register Date: "GREEN"%s\n\n",Player[playerid][RegisterDate]);
    strcat(info, temp);
Register date is saved without a single problem, it shows in RegisterDate row in mysql, i have trouble just with showing it. Because when i do stats, i get "Register Date: " (blank)

This is how i save it when a player creates an account:

pawn Код:
new query[128];
    format(query, sizeof(query), "UPDATE `notyourbusiness` SET `RegisterDate` = '%s' WHERE `user` = '%s'", ReturnDate(), Player[playerid][Name]);
    mysql_tquery(g_SQL, query);
ReturnDate:

pawn Код:
ReturnDate()
{
    static
        date[36];

    getdate(date[2], date[1], date[0]);
    gettime(date[3], date[4], date[5]);

    format(date, sizeof(date), "%02d/%02d/%d, %02d:%02d", date[0], date[1], date[2], date[3], date[4]);
    return date;
}



Re: RegDate - Despacito - 12.05.2017

Bump.


Re: RegDate - Logic_ - 12.05.2017

Simply save it as a string and load it

PHP код:
getdate(yearmonthday);
format(stringsizeof(string), "%02d/%02d/%d"daymonthyear); 



Re: RegDate - Despacito - 12.05.2017

What? Makes no sense since im already saving and loading it. I just wanna show it in /stats command.


Re: RegDate - ShihabSoft - 12.05.2017

Show us the code, where you populate this Player[playerid][RegisterDate].


Re: RegDate - Despacito - 12.05.2017

pawn Код:
new query[128];
    format(query, sizeof(query), "UPDATE `players` SET `RegisterDate` = '%s' WHERE `username` = '%s'", ReturnDate(), Player[playerid][Name]);
    mysql_tquery(g_SQL, query);
The return date function is on first post.


Re: RegDate - Despacito - 13.05.2017

bump