SA-MP Forums Archive
0.3.7 R2 sqlite function db_get_field_assoc_int crash - 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)
+--- Thread: 0.3.7 R2 sqlite function db_get_field_assoc_int crash (/showthread.php?tid=581472)



0.3.7 R2 sqlite function db_get_field_assoc_int crash - dusk - 13.07.2015

pawn Код:
public OnPlayerConnect(playerid)
{
    new query[70];
    GetPlayerName(playerid, query, sizeof(query));
    format(query, sizeof(query), "SELECT * FROM players WHERE name = '%q'", query);
    new DBResult:result = db_query(UserDB, query);

    if(db_num_rows(result) && db_next_row(result)) // Also tried removing db_next_row.
    {
        PlayerData[ playerid ][ Uid ] = db_get_field_assoc_int(result, "uid"); // Line 48
        db_get_field_assoc(result, "username", PlayerData[ playerid ][ Name ], MAX_PLAYER_NAME);
        PlayerData[ playerid ][ Health ] = db_get_field_assoc_float(result, "health");
        PlayerData[ playerid ][ Money ] = db_get_field_assoc_int(result, "money");
        PlayerData[ playerid ][ Score ] = db_get_field_assoc_int(result, "score");
    }
    db_free_result(result);
}
Backtrace:

Код:
[14:59:37] [debug] AMX backtrace:
[14:59:37] [debug] #0 native db_get_field_assoc_int () from samp-server.exe
[14:59:37] [debug] #1 00000900 in public OnPlayerConnect (playerid=0) at sqlite.pwn:48
[14:59:37] [debug] Native backtrace:
[14:59:37] [debug] #0 00498e59 in ?? () from samp-server.exe
[14:59:37] [debug] #1 004010b6 in ?? () from samp-server.exe
[14:59:37] [debug] #2 5d2a01b4 in ?? () from plugins\crashdetect.DLL
[14:59:37] [debug] #3 5d2a62ca in ?? () from plugins\crashdetect.DLL
[14:59:37] [debug] #4 5d2a8b28 in ?? () from plugins\crashdetect.DLL
[14:59:37] [debug] #5 5d2a09c7 in ?? () from plugins\crashdetect.DLL
[14:59:37] [debug] #6 5d2a631a in ?? () from plugins\crashdetect.DLL
[14:59:37] [debug] #7 5ccb49fb in ?? () from plugins\streamer.DLL
[14:59:37] [debug] #8 0046d940 in ?? () from samp-server.exe
[14:59:37] [debug] #9 0046650f in ?? () from samp-server.exe
[14:59:37] [debug] #10 00498ce6 in ?? () from samp-server.exe
[14:59:37] [debug] #11 77b5e063 in ?? () from C:\Windows\SysWOW64\ntdll.dll
[14:59:37] [debug] #12 75c614bd in ?? () from C:\Windows\syswow64\kernel32.dll
[14:59:37] [debug] #13 00498da1 in ?? () from samp-server.exe
[14:59:37] [debug] #14 00495064 in ?? () from samp-server.exe
[14:59:37] [debug] #15 458d5151 in ?? () from samp-server.exe
[14:59:37] [debug] #16 15ff50f8 in ?? () from samp-server.exe
[14:59:37] [debug] #17 004ac0c4 in ?? () from samp-server.exe
No other errors, database is opened and table exists.