RegisterDate
#1

Someone can explain me when i register a new account, the row "RegisterDate" returns "0" instead of the current registration date of the player?

pawn Код:
stock MySQL_Register(playerid, passwordstring[])
{
    new query1[570], pname[24];
    new IP[16];
    GetPlayerIp(playerid, IP, sizeof(IP));
    new Year, Month, Day, Hour, Minute, Second;
    getdate(Year, Month, Day);
    gettime(Hour, Minute, Second);
    new timeReg[200];
    format(timeReg, sizeof(timeReg), "%02d/%02d/%02d - %02d:%02d:%02d", Day,Month,Year,Hour,Minute,Second);
    new Bannedby[20];
    format(Bannedby, 20, "Not Banned");
    GetPlayerName(playerid, pname, 24);
    new buff[129];
    WP_Hash(buff, 129, passwordstring);
    format(query1, sizeof(query1), "INSERT INTO playerdata (user, password, Scores, Cash, Admin, Deaths, Nopm, Muted, Vip, Warn, RegisterDate, Jailed, AdminActions, Cookies, Rank, VipTime, Class, PrototypesStolen, KillAsUsaTeam, KillAsGermanyTeam, KillAsItalyTeam, KillAsJapanTeam, KillAsMercTeam, KillAsMexicoTeam, IP) VALUES('%s', '%s', 0, 0, 0, 0, 0, 0, 0, 0, '%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '%s')", pname, buff, timeReg, IP);
    mysql_query(query1);
    Logged[playerid] = 1;
    WindowForPlayer(playerid, "You are now ~r~registered ~w~to Battlefield War Heroes! Enjoy playing!");
    WelcomeDialog(playerid);
    new echo[130];
    new kname[24];
    GetPlayerName(playerid, kname, 24);
    format(echo,sizeof(echo),"0,3** System: %s (%d) (IP: %s) has registered a new account",pname,playerid,IP);
    IRC_GroupSay(gGroupID, IRC_ACHANNEL, echo);
    new admin[128];
    format(admin,sizeof(admin),"** System: %s (%d) (%s) has registered a new account.",pname,playerid,IP);
    SendMessageToAdmins(LIGHTBLUE,admin);
    new txd[128];
    format(txd,sizeof(txd),"%s (%d) (IP: %s) registered a new account",pname,playerid,IP);
    TextDrawSetString(RegTxd, txd);
    new welcome[130];
    format(welcome, sizeof(welcome), "Welcome to Battlefield War Heroes, ~r~%s! Type ~r~/rules ~w~and ~r~/cmds ~w~for server info.",pname);
    GameTextForPlayer(playerid,welcome,6000,4);
    return 1;
}
Reply
#2

Change the RegDate's data type to VARCHAR
Reply
#3

Oh lol, thanks.
Reply
#4

Are you sure you've set your RegisterDate column to varchar and not int?

PS: You might also want to take a look at MySQL's time/date types: http://dev.mysql.com/doc/refman/5.1/en/datetime.html

EDIT: 2late
Reply
#5

ye fixed already, thanks :L
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)