24.03.2014, 07:45
PHP код:
stock LoadHouse()
{
new time = GetTickCount();
mysql_query("SELECT * FROM "TABLE_HOUSE" ORDER BY "TABLE_HOUSE".`ID` ASC ");
mysql_store_result();
for(new i = 1; i < TOTALHOUSE; i++)
{
strmid(BizzInfo[i][bOwner],"The_State",0,strlen("The_State"),24);
}
if (mysql_num_rows() > 0)
{
for(new idx = 1; idx <= mysql_num_rows(); idx++)
{
mysql_fetch_row(query);
sscanf(query, "p<|>iffffffs[24]iiiiis[5]iiiiffffiii",
HouseInfo[idx][hID],
HouseInfo[idx][hEnterX],
HouseInfo[idx][hEnterY],
HouseInfo[idx][hEnterZ],
HouseInfo[idx][hExitX],
HouseInfo[idx][hExitY],
HouseInfo[idx][hExitZ],
HouseInfo[idx][hOwner],
HouseInfo[idx][hValue],
HouseInfo[idx][hInt],
HouseInfo[idx][hLock],
HouseInfo[idx][hOwned],
HouseInfo[idx][hTakings],
HouseInfo[idx][hClass],
HouseInfo[idx][hPaycash],
HouseInfo[idx][hMIcon],
HouseInfo[idx][hVirtWorld],
HouseInfo[idx][hHealme],
HouseInfo[idx][hCarX],
HouseInfo[idx][hCarY],
HouseInfo[idx][hCarZ],
HouseInfo[idx][hCarA],
HouseInfo[idx][hSafe],
HouseInfo[idx][hDrugs],
HouseInfo[idx][hMoney]);
TOTALHOUSE++;
HouseInfo[idx][hRobhouse] = false;
if (HouseInfo[idx][hOwned] == 0)
{
HouseInfo[idx][hPickup] = CreatePickup(1273, 23, HouseInfo[idx][hEnterX], HouseInfo[idx][hEnterY], HouseInfo[idx][hEnterZ]);
HouseInfo[idx][hMIcon] = CreateDynamicMapIcon(HouseInfo[idx][hEnterX], HouseInfo[idx][hEnterY], HouseInfo[idx][hEnterZ], 31, 0, -1, -1, -1, 100.0);
}
if (HouseInfo[idx][hOwned] == 1)
{
HouseInfo[idx][hPickup] = CreatePickup(1272, 23, HouseInfo[idx][hEnterX ], HouseInfo[idx][hEnterY ], HouseInfo[idx][hEnterZ]);
HouseInfo[idx][hMIcon] = CreateDynamicMapIcon(HouseInfo[idx][hEnterX], HouseInfo[idx][hEnterY], HouseInfo[idx][hEnterZ], 32, 0, -1, -1, -1, 100.0);
}
}
}
mysql_free_result();
printf("---------------------------------------------------------");
printf(" [Загрузка домов]: Было загружено - %d потрачено %d (ms)", TOTALHOUSE,GetTickCount() - time);
return 1;
}