Help fix this bug
#1

please can some one fix this bug? when i type /register my server crashes!
and Register is the main cmd which every one must use before playing on it

P.S i am using Msql no Y_INI or something else

Код:
CMD:register(playerid,params[])
{
 if(PInfo[playerid][Logged] == 1)
     return SendClientMessage(playerid,COL_GREEN,"» "CWHITE"You are already registered and logged in!");

 new szPassword[24];
 if(sscanf(params,"s[24]",szPassword)) return SendClientMessage(playerid,COL_BLUE,"USAGE: "CWHITE"/register (password)");
 new szPass[24];
 mysql_real_escape_string(szPassword,szPass);

 new PIP[16],TempQuery[450], day, month, year, hour, minute, second;
 GetPlayerIp(playerid,PIP,16);

    getdate(year,month,day);
 gettime(hour,minute,second);
 format(TempQuery, sizeof TempQuery,"INSERT INTO `"Users_Table"` (Username, Password, IP, Money, Score, Level, NitroType, Autofix, Fightstyle, SkinID, SB, AcceptPM, Kills, Deaths, Hours, Mins, Goto, Regged, LastOn) VALUES ('%s', sha1('%s'), '%s', '%i', '%i', '0', '0', '0', '0', '-1', '1', '1', '%i', '%i', '0', '0', '%i', '%02d.%02d.%02d','%02d.%02d.%02d at %02d:%02d:%02d')",
 GetPName(playerid),szPass,PIP,GetPlayerMoney(playerid),GetPlayerScore(playerid), PInfo[playerid][Kills],PInfo[playerid][Deaths],
  PInfo[playerid][GotoToggle], day,month,year,day,month,year,hour,minute,second);

 if(mysql_query(TempQuery))
     SendClientMessage(playerid,COL_GREEN,"You have been successfully registered!"),PlaySound(playerid,1057);
 else
     SendClientMessage(playerid,COL_RED,"Some error occured while registering! Please contact the administrators.");

 PInfo[playerid][Logged] = 1;
 PInfo[playerid][Regged] = 1;
 PInfo[playerid][Skin] = -1;

 GameTextForPlayer(playerid,"~g~~h~You have received: ~n~~r~~h~+$5000 ~n~~r~~h~1000 score",5000,3);
 GivePlayerMoney(playerid,5000);
 SetPlayerScore(playerid,GetPlayerScore(playerid)+1000);

 ShowPlayerDialog(playerid,Emaildialog,1,"Email",""CWHITE"For security reason, we ask you to put in an email so you can recover your password in the future: \n","Accept","No Email");
 return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)