Stevenson
Умник
помогите перевести загрузку домов с MYSQL R6 на MYSQL R41
Вот как я попытался сделать, пишет что 822 дома загрузилось но в игре их нет:
PHP:
forward LoadProperty();
public LoadProperty()
{
new time = GetTickCount();
new result[300];
mysql_query("SELECT * FROM `house` ORDER BY `house`.`hID` ASC ");
mysql_store_result();
if(mysql_num_rows() > 0)
{
for (new i = 1;i <= mysql_num_rows();i ++)
{
mysql_fetch_row(result);
sscanf(result, "p<|>dffffffffffs[32]dddddddddddd",
HouseInfo[i][hID],
HouseInfo[i][hEntrancex],
HouseInfo[i][hEntrancey],
HouseInfo[i][hEntrancez],
HouseInfo[i][hExitx],
HouseInfo[i][hExity],
HouseInfo[i][hExitz],
HouseInfo[i][hCarx],
HouseInfo[i][hCary],
HouseInfo[i][hCarz],
HouseInfo[i][hCarc],
HouseInfo[i][hOwner],
HouseInfo[i][hValue],
HouseInfo[i][hHel],
HouseInfo[i][hInt],
HouseInfo[i][hLock],
HouseInfo[i][hOwned],
HouseInfo[i][hTakings],
HouseInfo[i][hDate],
HouseInfo[i][hKlass],
HouseInfo[i][hVec],
HouseInfo[i][hVcol1],
HouseInfo[i][hVcol2],
HouseInfo[i][hVehSost]);
if(HouseInfo[i][hOwned] == 0)
{
HouseInfo[i][hPickup] = CreatePickup(1273, 23, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez],-1);
pickups++;
HouseInfo[i][hMIcon] = CreateDynamicMapIcon(HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez], 31, COLOR_WHITE, 0, -1, -1, 400.0);
}
if(HouseInfo[i][hOwned] == 1)
{
HouseInfo[i][hPickup] = CreatePickup(1272, 23, HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez],-1);
pickups++;
HouseInfo[i][hMIcon] = CreateDynamicMapIcon(HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez], 32, COLOR_WHITE, 0, -1, -1, 400.0);
}
TotalHouse++;
}
}
mysql_free_result();
if(logs == 1)
{
printf("Домов загружено: %i. Потрачено: %d",TotalHouse, GetTickCount() - time);
}
return true;
}
PHP:
forward LoadProperty();
public LoadProperty()
{
static rows;
cache_get_row_count(rows);
new idx, temp[32];
if(rows)
{
for(new he = 0; he < rows; he++)
{
cache_get_value_index_int(he, 0, HouseInfo[he][hID]);
cache_get_value_index_float(he, 1, HouseInfo[he][hEntrancex]);
cache_get_value_index_float(he, 2, HouseInfo[he][hEntrancey]);
cache_get_value_index_float(he, 3, HouseInfo[he][hEntrancez]);
cache_get_value_index_float(he, 4, HouseInfo[he][hExitx]);
cache_get_value_index_float(he, 5, HouseInfo[he][hExity]);
cache_get_value_index_float(he, 6, HouseInfo[he][hExitz]);
cache_get_value_index(he, 7, HouseInfo[he][hOwner], 32);
cache_get_value_index_int(he, 8, HouseInfo[he][hValue]);
cache_get_value_index_int(he, 9, HouseInfo[he][hHel]);
cache_get_value_index_int(he, 10, HouseInfo[he][hInt]);
cache_get_value_index_int(he, 11, HouseInfo[he][hLock]);
cache_get_value_index(he, 12, HouseInfo[he][hOwned], 32);
cache_get_value_index_int(he, 13, HouseInfo[he][hTakings]);
cache_get_value_index_int(he, 14, HouseInfo[he][hVec]);
cache_get_value_index_int(he, 15, HouseInfo[he][hKlass]);
cache_get_value_index_int(he, 16, HouseInfo[he][hVehSost]);
cache_get_value_index_float(he, 17, HouseInfo[he][hCarx]);
cache_get_value_index_float(he, 18, HouseInfo[he][hCary]);
cache_get_value_index_float(he, 19, HouseInfo[he][hCarz]);
cache_get_value_index_float(he, 20, HouseInfo[he][hCarc]);
cache_get_value_index_int(he, 21, HouseInfo[he][hKlass]);
cache_get_value_index_int(he, 22, HouseInfo[he][hDate]);
cache_get_value_index_int(he, 23, HouseInfo[he][hVcol1]);
idx++;
if(HouseInfo[he][hOwned] == 0)
{
HouseInfo[he][hPickup] = CreatePickup(1273, 23, HouseInfo[he][hEntrancex], HouseInfo[he][hEntrancey], HouseInfo[he][hEntrancez],-1);
pickups++;
HouseInfo[he][hMIcon] = CreateDynamicMapIcon(HouseInfo[he][hEntrancex], HouseInfo[he][hEntrancey], HouseInfo[he][hEntrancez], 31, COLOR_WHITE, 0, -1, -1, 400.0);
}
if(HouseInfo[he][hOwned] == 1)
{
HouseInfo[he][hPickup] = CreatePickup(1272, 23, HouseInfo[he][hEntrancex], HouseInfo[he][hEntrancey], HouseInfo[he][hEntrancez],-1);
pickups++;
HouseInfo[he][hMIcon] = CreateDynamicMapIcon(HouseInfo[he][hEntrancex], HouseInfo[he][hEntrancey], HouseInfo[he][hEntrancez], 32, COLOR_WHITE, 0, -1, -1, 400.0);
}
}
printf("[ %d ] Дома успешно загружены.",idx);
}
else printf("Дома не загружены.");
return true;
}
