SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > 0.3.7 RC Scripting

 
 
Thread Tools Display Modes
Old 13/07/2015, 12:00 PM   #1
dusk
High-roller
 
dusk's Avatar
 
Join Date: Jul 2008
Posts: 1,118
Reputation: 46
Default 0.3.7 R2 sqlite function db_get_field_assoc_int crash

Code:
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:

Code:
[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.
dusk is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQLite - Load function problem Psyhophatic Scripting Help 1 29/11/2014 10:34 PM
SQLite makes server.exe crash when reading data. knackworst Scripting Help 7 05/11/2013 09:12 PM
SQLite Ban System Crash. vampirmd Scripting Help 0 13/11/2012 12:05 PM
Function that crash the server tal_peretz Scripting Help 5 18/02/2012 08:57 PM
What crashing here ? && Function that crash tal_peretz Scripting Help 5 18/02/2012 08:39 PM


All times are GMT. The time now is 09:13 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.