Blueg r38 deconstructor
#1

When i want to load vehicles from database print this in mysql log.Database isn't empty.
Код:
[18:24:40] [DEBUG] Calling callback "LoadCars"..
[18:24:40] [DEBUG] cache_get_data - connection: 1
[18:24:40] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
This is code.
Код:
forward LoadCars();
public LoadCars()
{
	new rows, fields;
	cache_get_data(rows, fields);
	if(rows)
	{
		new id = rows + 1;
		for(new i = 249; i < id; i++)
		{
			format(szString, sizeof(szString), "SELECT * FROM `Vozila` WHERE `ID` = '%d'", i);
			mysql_pquery(connection, szString, "DLCars", "i", i);
		}
	}
	return 1;
}
forward DLCars(v);
public DLCars(v)
{
	new rows, fields;
	cache_get_data(rows, fields);
	if(rows)
	{
		v = cache_get_row_int(0, 0);
		Vozila[v][mKoristen] = cache_get_row_int(0, 1);
		Vozila[v][mModel] = cache_get_row_int(0, 2);
		Vozila[v][mX] = cache_get_row_float(0, 3);
		Vozila[v][mY] = cache_get_row_float(0, 4);
		Vozila[v][mZ] = cache_get_row_float(0, 5);
		Vozila[v][mA] = cache_get_row_float(0, 6);
		Vozila[v][mpBoja] = cache_get_row_int(0, 7);
		Vozila[v][mdBoja] = cache_get_row_int(0, 8);
		Vozila[v][mZakljucan] = cache_get_row_int(0, 9);
		Vozila[v][mMats] = cache_get_row_int(0, 10);
		Vozila[v][mDrugs] = cache_get_row_int(0, 11);
		Vozila[v][mRegistracija] = cache_get_row_int(0, 12);
		if(Vozila[v][mRegistracija])
		{
			cache_get_field_content(0, "Tablice", Vozila[v][mTablice], connection, 24);
		}
		Kilometraza[v] = cache_get_row_int(0, 14);
		TipGoriva[v] = cache_get_row_int(0, 15);
		Vozila[v][mBroj] = cache_get_row_int(0, 16);
		cache_get_field_content(0, "Vlasnik", Vozila[v][mVlasnik], connection, 24);
	}
	return 1;
}
ANd this ongamemodeinit
Код:
	format(szString, sizeof(szString), true, "SELECT * FROM `Vozila`");
	mysql_function_query(connection, szString, "LoadCars", "");
Reply
#2

It seems that 'rows' MUST be 0. Print debug messages.

'Deconstructor' is just a C++ class thing, it doesn't mean something went wrong.
Reply
#3

Only these messages.Maybe problem is in database?
Reply
#4

Enable full mySQL logging by putting this under OnGameModeInit (or change it to this if you already have it - Ctrl+F):

pawn Код:
mysql_log(LOG_ALL);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)