MYSQL login problem - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MYSQL login problem (
/showthread.php?tid=152423)
MYSQL login problem -
misko28 - 04.06.2010
Hello guys. I have problems with my login script. My samp-server.exe crashes and there's nothing in server-log file.
Код:
public OnPlayerLogin(playerid,password[])
{
MySQLCheckConnection();
new string[128];
MySQLFetchAcctSingle(GetPVarInt(playerid, "SQLID"), "Password", string);
SetPVarString(playerid, "Passowrd", string);
if(strcmp(ReturnPVarString(playerid, "Password"),password, true ) == 0 )
{
new Data[1024];
new Field[64];
new rcnt = 1;
MySQLFetchAcctRecord(GetPVarInt(playerid, "SQLID"), Data);
samp_mysql_strtok(Field, "|", Data);
SetPVarInt(playerid, "Logged", 1);
while (samp_mysql_strtok(Field, "|", "")==1)
{
if (rcnt == 3) SetPVarInt(playerid, "AdminLevel", strval(Field));
rcnt++;
}
}
else
{
ShowPlayerDialog(playerid,LOGIN_DIALOG,DIALOG_STYLE_INPUT,"Login","Љifa koju ste unjeli nije\nvazeca. Pokusajte ponovno!","Login","Izlaz");
SetPVarInt(playerid, "LogTries", GetPVarInt(playerid, "LogTries") + 1);
if(GetPVarInt(playerid, "LogTries") == 4)
{
SendClientMessage(playerid, ERROR_COLOR, "Previse puta ste unjeli pogresnu sifru. Kickani ste!");
Kick(playerid);
}
}
return 1;
}
Код:
public MySQLFetchAcctSingle(sqlplayerid, sqlvalname[], sqlresult[])
{
new query[128];
format(query, sizeof(query), "SELECT %s FROM players WHERE id = %d LIMIT 1", sqlvalname, sqlplayerid);
samp_mysql_query(query);
samp_mysql_store_result();
if(samp_mysql_fetch_row(sqlresult)==1)
{
return 1;
}
return 0;
}
public MySQLFetchAcctRecord(sqlplayerid, sqlresult[]) // by Luk0r
{
new query[64];
format(query, sizeof(query), "SELECT * FROM players WHERE id = %d LIMIT 1", sqlplayerid);
samp_mysql_query(query);
samp_mysql_store_result();
if(samp_mysql_fetch_row(sqlresult)==1)
{
return 1;
}
return 0;
}
Re: MYSQL login problem -
DJDhan - 04.06.2010
When a server crashes, the error is logged in a file called "crashinfo".
Re: MYSQL login problem -
misko28 - 04.06.2010
Код:
SA-MP Server: 0.3a R7
Exception At Address: 0x609C17BC
Registers:
EAX: 0x00000000 EBX: 0x02A4F0F4 ECX: 0x7EFDD000 EDX: 0x00000008
ESI: 0x021B8500 EDI: 0x021B8500 EBP: 0x0018F500 ESP: 0x0018F4C8
EFLAGS: 0x00010206
Stack:
+0000: 0x9593416B 0x000081C0 0x032F2048 0x021B8500
+0010: 0x02A4F0F4 0x021B8500 0x0018F500 0x00000000
+0020: 0x609C9040 0x9593416B 0x00000001 0x0281F848
+0030: 0x02D3DED8 0x00000001 0x02A501B8 0x00401096
+0040: 0x021B8500 0x02A5C830 0x02A54890 0x00402BB3
+0050: 0x021B8500 0x00000011 0x0018F538 0x02A5C830
+0060: 0x0018F820 0x021B8500 0x00000000 0x00000000
+0070: 0x00000001 0x00007FA4 0x00007FA0 0x000085F4
+0080: 0x00004610 0x000081A8 0x00004610 0x02A4F0F4
+0090: 0x02A54890 0x00000000 0x02A4E488 0x0000579C
+00A0: 0x0046143C 0x021B8500 0x0018F5B8 0x00000011
+00B0: 0x021B8500 0x00000000 0x021B8500 0x00000064
+00C0: 0x021B8500 0x00000001 0x021B8500 0xFFFFFFFF
+00D0: 0x021B8500 0x0018F5D4 0x0018F5BC 0x0018F708
+00E0: 0x02A58E88 0x00000000 0x021B8500 0x00000000
+00F0: 0x00000000 0x02A58E88 0x0047ED27 0x00000011
+0100: 0x00000064 0x00000001 0xFFFFFFFF 0x000045F8
+0110: 0x0018F82C 0x01E4C300 0x01000001 0x0105FEA4
+0120: 0x0000FFFF 0x00000064 0x00000060 0x00000060
+0130: 0x00000058 0x0018F82C 0x4C08B600 0x6F636E49