Blueg r38 deconstructor - 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: Blueg r38 deconstructor (
/showthread.php?tid=502021)
Blueg r38 deconstructor -
CloW - 21.03.2014
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", "");
Re: Blueg r38 deconstructor -
MP2 - 21.03.2014
It seems that 'rows' MUST be 0. Print debug messages.
'Deconstructor' is just a C++ class thing, it doesn't mean something went wrong.
Re: Blueg r38 deconstructor -
CloW - 22.03.2014
Only these messages.Maybe problem is in database?
Re: Blueg r38 deconstructor -
MP2 - 23.03.2014
Enable full mySQL logging by putting this under OnGameModeInit (or change it to this if you already have it - Ctrl+F):