Can you show us code for saving and also Structure of Table in phpMyAdmin
And see what the output is. You might also want to hide your IP + hashes as that's pretty sensitive information.
Column size, set to 30. It's not just MAX_PLAYER NAME. Read Wiki. Also Each Column and Table name has to be between ` ` and all string values between ' ' to avoid syntax error.
. That can give you possible cause.
Just under the last format. This will just print data into your console to show if it's actually querying the correct data. If this shows up fine, then put mysql_debug(1); under OnGameModeInit and then post your MySQL log file in your server directory.
see? Now we know possible cause.
pawn Код:
stock MySQL_Register(playerid, passwordstring[])
{
if(!IsPlayerConnected(playerid)) return 1;
new query[1200], pname[30], IP[15],string[800];
new year,month,day;
new timex,minutey,secondz;
new Bannedby[20];
format(Bannedby, 20, "Not Banned");
gettime(timex,minutey,secondz);
getdate(year, month, day);
GetPlayerName(playerid, pname, 24);
GetPlayerIp(playerid, IP, 15);
strcat(string, "(user, password, IP, score, money, kills, deaths, registered, loggedin, level, cookies, cakes, biscuits, icecreams, XF, Donator, TiP, Function1,");
strcat(string, "Function2, Function3, Function4, Function5, Function6, Bank, weed, Condoms, inalcatraz, hours, minutes, seconds, SavSkin, UseSkin, PositionX, PositionY, PositionZ, interior1, RegisteredDate, RegisteredTime, LastOnlineDate, LastOnlineTime, TotalCmdsUsed, Complaints, Banned, BannedByAdmin, TotalLogins, TotalKicks, TotalBans, TotalWarnings, ReactionTestWon, RaceWon, ATMCard, AdminKills,BankCash, HidenPickUp)");
format(query, sizeof(query), "INSERT INTO playerdata %s VALUES('%s', SHA1('%s'), '%s', 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \'%d-%d-%d\', \'%d:%d:%d\', \'%d-%d-%d\', \'%d:%d:%d\', 0, 0, 0, '%s', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)", string, pname, passwordstring, IP, year, month, day, timex, minutey, secondz, year, month, day, timex, minutey, secondz, Bannedby);
mysql_query(query);
savedatatimer[playerid] = SetTimerEx("Savedata", 120000, true, "i", playerid);
playedtimer[playerid] = SetTimerEx("TimeOnServer", 1000, 1, "i", playerid);
PlayerInfo[playerid][LoggedIn] = 1;
PlayerInfo[playerid][Registered] = 1;
GivePlayerMoney(playerid,50000);
return 1;
}
Changed name string size to 30 and Added Connection check. If he isn't connected server can't get his name so that could be cause of the problem.