Загрузка домов (MYSQL)
#1

Сделал систему домов и встретился с грустной штучкой.
Создавая дом, они создаются. После того как я сделаю рестарт, загружается только один дом.
Вот код загрузки:
PHP код:
new query[128];
format(querysizeof query"SELECT * FROM `"TABLE_HOUSE"`");
mysql_function_query(connectionquerytrue"LoadHouses"""); 
PHP код:
forward LoadHouses();
public 
LoadHouses()
{
    new 
rowsfields;
    
cache_get_data(rowsfields);
    if(
rows)
    {
        for (new 
id 1id rows id ++)
        {
            
hInfo[id][hID] = cache_get_field_int(0"ID");
            
hInfo[id][hOwned] = cache_get_field_int(0"Owned"connection);
            
cache_get_field_content(0"Owner"hInfo[id][hOwner], connectionMAX_PLAYER_NAME);
            
hInfo[id][hPos][0] = cache_get_field_float(0"X"connection);
            
hInfo[id][hPos][1] = cache_get_field_float(0"Y"connection);
            
hInfo[id][hPos][2] = cache_get_field_float(0"Z"connection);
            
hInfo[id][hInt] = cache_get_field_int(0"Int"connection);
            
hInfo[id][hType] = cache_get_field_int(0"Type"connection);
            
hInfo[id][hPrice] = cache_get_field_int(0"Price"connection);
            
            switch(
hInfo[id][hOwned])
            {
                case 
0:
                {
                    
hInfo[id][hPickup] = CreatePickup(127223hInfo[id][hPos][0], hInfo[id][hPos][1], hInfo[id][hPos][2], 0);
                    
hInfo[id][hMapIcon] = CreateDynamicMapIcon(hInfo[id][hPos][0], hInfo[id][hPos][1], hInfo[id][hPos][2], 311);
                }
                case 
1:
                {
                    
hInfo[id][hPickup] = CreatePickup(127323hInfo[id][hPos][0], hInfo[id][hPos][1], hInfo[id][hPos][2], 0);
                    
hInfo[id][hMapIcon] = CreateDynamicMapIcon(hInfo[id][hPos][0], hInfo[id][hPos][1], hInfo[id][hPos][2], 321);
                }
            }
        }
    }
    return 
1;

Что не так? Подскажите пожалуйста.

P.S. Mysql R8(BlueG)
Reply
#2

PHP код:
cache_get_field_int(0
на
PHP код:
cache_get_field_int(id
Ты загружаешь постоянно нулевую строку из таблицы.
Reply
#3

Закрыто.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)