13.08.2018, 19:20
I found a way to fix it. Now got another problem. In mysql log file i see "invalid connection handle" referred to this:
(OnGameModeInit to load vending machines)
Vendor_Load (after my fix):
Already checked, vending machines are created perfectly in mysql table. What's the problem?
pawn Код:
mysql_tquery(g_SQL, "SELECT * FROM `vendors`", "Vendor_Load", "");
Vendor_Load (after my fix):
pawn Код:
public Vendor_Load()
{
static rows, fields;
for (new i = 0; i < rows; i ++) if (i < MAX_VENDORS)
{
if(cache_num_rows() > 0)
{
VendorData[i][vendorExists] = true;
VendorData[i][vendorID] = cache_get_value_int(i,"vendorID",VendorData[i][vendorID]);
VendorData[i][vendorType] = cache_get_value_int(i,"vendorType",VendorData[i][vendorType]);
VendorData[i][vendorPos][0] = cache_get_value_float(i, "vendorX",VendorData[i][vendorPos][0]);
VendorData[i][vendorPos][1] = cache_get_value_float(i, "vendorY",VendorData[i][vendorPos][1]);
VendorData[i][vendorPos][2] = cache_get_value_float(i, "vendorZ",VendorData[i][vendorPos][2]);
VendorData[i][vendorPos][3] = cache_get_value_float(i, "vendorA",VendorData[i][vendorPos][3]);
VendorData[i][vendorInterior] = cache_get_value_int(i,"vendorInterior",VendorData[i][vendorInterior]);
VendorData[i][vendorWorld] = cache_get_value_int(i,"vendorWorld",VendorData[i][vendorWorld]);
Vendor_Refresh(i);
}
}
return 1;
}