06.01.2014, 12:21
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;
}