28.06.2018, 17:09
Hey guys,
I want to create objects that are read from my database. However always comes "No Active Cache"
My user accounts are loaded from the database without any problems.
I want to create objects that are read from my database. However always comes "No Active Cache"
PHP код:
LoadObject();
PHP код:
public LoadObject()
{
new mquery[256];
mysql_format(handle, mquery, sizeof(mquery), "SELECT * FROM material");
mysql_pquery(handle, mquery);
new rowsa;
cache_get_row_count(rowsa);
if(rowsa == 0)
{
return 1;
}
else
{
for(new im; im < sizeof(mquery); im++)
{
cache_get_value_name_int(0, "modelid", iMaterial[im][modelid]);
cache_get_value_float(0, "posx", iMaterial[im][m_x]);
cache_get_value_float(0, "posy", iMaterial[im][m_y]);
cache_get_value_float(0, "posz", iMaterial[im][m_z]);
cache_get_value_name(0, "3dtext", iMaterial[im][mText]);
material[im] = CreateDynamicObject(iMaterial[im][modelid],iMaterial[im][m_x],iMaterial[im][m_y],iMaterial[im][m_z] - 1.0, 0.0, 0.0, 0.0, 0);
}
}
return 1;
}