• Уважаемый Гость.
    - Прежде чем создать свою тему, пожалуйста, попробуй воспользоваться этим -> ПОИСКОМ !!!
    - После решения Вашего вопроса (проблемы) - нажмите "Лучший ответ", на сообщении, которое его решило. За игнорирование этого действия - Вы получите соответствующее предупреждение. Мы - стараемся Вам помочь. Уделите 10 секунд - чтобы нажать кнопку. (Если у Вас нет такой возможности - укажите в последнем своем сообщении какой ответ Вы считаете лучшим. Наши модераторы сделают это за Вас)
    ЗАПРЕЩЕНО:
    - Cоздавать темы с названиями "Помогите", "Плиз", "Ошибка", "Не могу найти", "Хелп" и тому подобное;
    - Cоздавать темы без детального описания того, что нужно исправить.
    - Cоздавать темы из одного скриншота.
    За игнор правил форума - Ваша тема будет удалена, а Вы получите системное предупреждение.

Ошибка в загрузке бизнесов

Leonardo_Martinez

Умник
В логе пишется:
[19:25:44] [debug] Run time error 4: "Array index out of bounds"
[19:25:44] [debug] Attempted to read/write array element at negative index -1
[19:25:44] [debug] AMX backtrace:
[19:25:44] [debug] #0 00544468 in public businesses_loading () at C:\SAMP MODES\EVER\gamemodes\new.pwn:65424
[19:25:44] sscanf warning: Format specifier does not match parameter count.
[19:25:44] sscanf warning: Format specifier does not match parameter count.
[19:25:44] sscanf warning: Format specifier does not match parameter count.
[19:25:44] sscanf warning: Format specifier does not match parameter count.
[19:25:44] sscanf warning: Format specifier does not match parameter count.
[19:25:44] sscanf warning: Format specifier does not match parameter count.
[19:25:44] sscanf warning: Format specifier does not match parameter count.
[19:25:44] sscanf warning: Format specifier does not match parameter count.
[19:25:44] sscanf warning: Format specifier does not match parameter count.
[19:25:44] sscanf warning: Format specifier does not match parameter count.
[19:25:44] sscanf warning: Format specifier does not match parameter count.
Вот те две строки на которых ошибка:
Код:
    new pickup_biz = CreateDynamicPickup ( 1318, 23, b_interior [ bis_int ] [ i_position ] [ 0 ], b_interior [ bis_int ] [ i_position ] [ 1 ], b_interior [ bis_int ] [ i_position ] [ 2 ], b_info [ t ] [ b_id ] + 1000, b_interior [ bis_int ] [ i_interior ] ) ;
    pick_info [ pickup_biz ] [ pick_type ] = pick_type_bexit ;
Вся система загрузки:
Код:
callback: businesses_loading ()
{
    new fields ;
    cache_get_data ( b_count, fields ) ;
    if ( b_count )
    {
        for ( new t = 0 ; t < b_count ; t ++ )
        {
            b_info [ t ] [ b_id ] = cache_get_field_content_int ( t, "b_id", sql_connection ) ;
            b_info [ t ] [ b_owner_inc ] = cache_get_field_content_int ( t, "b_owner_inc", sql_connection ) ;

            cache_get_field_content ( t, "b_owner_name", b_info [ t ] [ b_owner_name ] , sql_connection, 32 ) ;
            cache_get_field_content ( t, "b_name", b_info [ t ] [ b_name ] , sql_connection, 32 ) ;

            b_info [ t ] [ b_position ] [ 0 ] = cache_get_field_content_float ( t, "b_pos_x", sql_connection ) ;
            b_info [ t ] [ b_position ] [ 1 ] = cache_get_field_content_float ( t, "b_pos_y", sql_connection ) ;
            b_info [ t ] [ b_position ] [ 2 ] = cache_get_field_content_float ( t, "b_pos_z", sql_connection ) ;
            b_info [ t ] [ b_position ] [ 3 ] = cache_get_field_content_float ( t, "b_pos_c", sql_connection ) ;

            b_info [ t ] [ b_int ] = cache_get_field_content_int ( t, "b_int", sql_connection ) ;

            b_info [ t ] [ b_money ] = cache_get_field_content_int ( t, "b_money", sql_connection ) ;
            b_info [ t ] [ b_family ] = cache_get_field_content_int ( t, "b_family", sql_connection ) ;

            b_info [ t ] [ b_close ] = cache_get_field_content_int ( t, "b_close", sql_connection ) ;
            b_info [ t ] [ b_price ] = cache_get_field_content_int ( t, "b_price", sql_connection ) ;
            b_info [ t ] [ b_product ] = cache_get_field_content_int ( t, "b_product", sql_connection ) ;
            b_info [ t ] [ b_type ] = cache_get_field_content_int ( t, "b_type", sql_connection ) ;

            b_info [ t ] [ b_fee ] = cache_get_field_content_int ( t, "b_fee", sql_connection ) ;
            b_info [ t ] [ b_maxproduct ] = cache_get_field_content_int ( t, "b_maxproduct", sql_connection ) ;

             b_info [ t ] [ b_cost ] = cache_get_field_content_int ( t, "b_cost", sql_connection ) ;

            b_info [ t ] [ b_mafia ] = cache_get_field_content_int ( t, "b_mafia", sql_connection ) ;

            new sscanf_delimit [ 36 ] ;
            cache_get_field_content ( t, "b_improve", sscanf_delimit, sql_connection, 36 ) ;
            sscanf ( sscanf_delimit, "p<|>ddd", b_info [ t ] [ b_improve ] [ 0 ], b_info [ t ] [ b_improve ] [ 1 ], b_info [ t ] [ b_improve ] [ 2 ] ) ;

            if ( b_info [ t ] [ b_type ] == bizz_type_shop || b_info [ t ] [ b_type ] == bizz_type_pharm || b_info [ t ] [ b_type ] == bizz_type_electronic || b_info [ t ] [ b_type ] == bizz_type_clothes || b_info [ t ] [ b_type ] == bizz_type_carshop || b_info [ t ] [ b_type ] == bizz_type_cafe || b_info [ t ] [ b_type ] == bizz_type_club || b_info [ t ] [ b_type ] == bizz_type_bar )
            {
                if ( b_info [ t ] [ b_owner_inc ] == -1 )
                {
                    new label_string [ 228 ] ;
                    format ( label_string, sizeof ( label_string ), ""c_server"%s (№%d)\n"c_grey"Цена: "c_white"%dр\n"c_grey"Контроль: "c_white"%s\n"c_grey"Бизнес продаётся",
                    b_types [ b_info [ t ] [ b_type ] ], b_info [ t ] [ b_id ], b_info [ t ] [ b_price ], mafia_owner_name [ b_info [ t ] [ b_mafia ] - 1 ] ) ;
                   
                    b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1,  b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;
                }
                else
                {
                    new label_string [ 228 ] ;
                    format ( label_string, sizeof ( label_string ), ""c_server"%s (№%d)\n"c_grey"Владелец: "c_white"%s\n"c_grey"Цена: "c_white"%dр\n"c_grey"Контроль: "c_white"%s\n"c_grey"Состояние: "c_white"%s",
                    b_types [ b_info [ t ] [ b_type ] ], b_info [ t ] [ b_id ], b_info [ t ] [ b_owner_name ], b_info [ t ] [ b_price ], mafia_owner_name [ b_info [ t ] [ b_mafia ] - 1 ], ( ! b_info [ t ] [ b_close ]) ? ("{1a9616}Открыт") : ("{e11010}Закрыт") ) ;

                    b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1,  b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;

                }


                b_info [ t ] [ b_pickup ] = CreateDynamicPickup ( 1318, 23, b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ], 0, 0 ) ;
                pick_info [ b_info [ t ] [ b_pickup ] ] [ pick_type ] = pick_type_bentrance ;

                b_info [ t ] [ b_int ] --;
                new bis_int = b_info [ t ][ b_int ] ;

                new pickup_biz = CreateDynamicPickup ( 1318, 23, b_interior [ bis_int ] [ i_position ] [ 0 ], b_interior [ bis_int ] [ i_position ] [ 1 ], b_interior [ bis_int ] [ i_position ] [ 2 ], b_info [ t ] [ b_id ] + 1000, b_interior [ bis_int ] [ i_interior ] ) ;
                pick_info [ pickup_biz ] [ pick_type ] = pick_type_bexit ;

            }
            if ( b_info [ t ] [ b_type ] == bizz_type_ammo )
            {
                if ( b_info [ t ] [ b_owner_inc ] == -1 )
                {
                    new label_string [ 228 ] ;
                    format ( label_string, sizeof ( label_string ), ""c_server"%s (№%d)\n"c_grey"Цена: "c_white"%dр\n"c_grey"Семья: "c_white"%s\n"c_grey"Бизнес продаётся",
                    b_types [ b_info [ t ] [ b_type ] ], b_info [ t ] [ b_id ], b_info [ t ] [ b_price ], family_info [ b_info [ t ] [ b_family ] - 1 ] [ fam_name ] ) ;
                    b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1,  b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;
                }
                else
                {
                    new label_string [ 228 ] ;
                    format ( label_string, sizeof ( label_string ), ""c_server"%s (№%d)\n"c_grey"Владелец: "c_white"%s\n"c_grey"Цена: "c_white"%dр\n"c_grey"Семья: "c_white"%s\n"c_grey"Состояние: "c_white"%s",
                    b_types [ b_info [ t ] [ b_type ] ], b_info [ t ] [ b_id ], b_info [ t ] [ b_owner_name ], b_info [ t ] [ b_price ], family_info [ b_info [ t ] [ b_family ] - 1 ] [ fam_name ], ( ! b_info [ t ] [ b_close ]) ? ("{1a9616}Открыт") : ("{e11010}Закрыт") ) ;

                    b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1,  b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;

                }
                b_info [ t ] [ b_pickup ] = CreateDynamicPickup ( 1318, 23, b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ], 0, 0 ) ;
                pick_info [ b_info [ t ] [ b_pickup ] ] [ pick_type ] = pick_type_bentrance ;
                b_info [ t ] [ b_int ] --;
                new bis_int = b_info [ t ][ b_int ] ;

                new pickup_biz = CreateDynamicPickup ( 1318, 23, b_interior [ bis_int ] [ i_position ] [ 0 ], b_interior [ bis_int ] [ i_position ] [ 1 ], b_interior [ bis_int ] [ i_position ] [ 2 ], b_info [ t ] [ b_id ] + 1000, b_interior [ bis_int ] [ i_interior ] ) ;
                pick_info [ pickup_biz ] [ pick_type ] = pick_type_bexit ;


                new actorid = CreateActor( 179, 296.4053,-40.2153,1001.5156,1.6147 ) ;
                SetActorVirtualWorld ( actorid, b_info [ t ] [ b_id ] + 1000 ) ;


            }
            else if ( b_info [ t ] [ b_type ] == bizz_type_gas )
            {
                if ( b_info [ t ] [ b_owner_inc ] == -1 )
                {
                    new label_string [ 228 ] ;
                    format ( label_string, sizeof ( label_string ), ""c_server"%s (№%d)\n"c_grey"Стоимость: "c_white"%dр\n"c_grey"Контроль: "c_white"%s\n"c_grey"Бизнес продаётся (/buygas)", b_types [ b_info [ t ] [ b_type ] ], b_info [ t ] [ b_id ], b_info [ t ] [ b_price ], mafia_owner_name [ b_info [ t ] [ b_mafia ] - 1 ] ) ;
                    b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1,  b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;
                }
                else
                {
                    new label_string [ 228 ] ;
                    format ( label_string, sizeof ( label_string ), ""c_server"%s (№%d)\n"c_grey"Владелец: "c_white"%s\n"c_grey"Цена: "c_white"%dр\n"c_grey"Контроль:"c_white" %s\n"c_grey"Состояние: "c_white"%s",
                    b_types [ b_info [ t ] [ b_type ] ], b_info [ t ] [ b_id ], b_info [ t ] [ b_owner_name ], b_info [ t ] [ b_price ], mafia_owner_name [ b_info [ t ] [ b_mafia ] - 1 ], ( ! b_info [ t ] [ b_close ]) ? ("{1a9616}Открыт") : ("{e11010}Закрыт") ) ;

                    b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1,  b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;
                }
            }
            else if ( b_info [ t ] [ b_type ] == bizz_type_tune )
            {
                if ( b_info [ t ] [ b_owner_inc ] == -1 )
                {
                    new label_string [ 228 ] ;
                    format ( label_string, sizeof ( label_string ), ""c_server"%s (№%d)\n"c_grey"Стоимость: "c_white"%dр\n"c_grey"Контроль: "c_white"%s\n"c_grey"Автостанция продаётся (/buytune)", b_types [ b_info [ t ] [ b_type ] ], b_info [ t ] [ b_id ], b_info [ t ] [ b_price ] ) ;
                    b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1,  b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;
                }
                else
                {
                    new label_string [ 228 ] ;
                    format ( label_string, sizeof ( label_string ), ""c_server"%s (№%d)\n"c_grey"Владелец: "c_white"%s\n"c_grey"Контроль: "c_white"%s\n"c_grey"Состояние: "c_white"%s",
                    b_types [ b_info [ t ] [ b_type ] ], b_info [ t ] [ b_id ], b_info [ t ] [ b_owner_name ], mafia_owner_name [ b_info [ t ] [ b_mafia ] - 1 ], ( ! b_info [ t ] [ b_close ]) ? ("{1a9616}Открыт") : ("{e11010}Закрыт") ) ;

                    b_info [ t ] [ b_label ] = CreateDynamic3DTextLabel ( label_string, -1,  b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ] + 0.7, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, 0, 0 ) ;
                }
                new actorid = CreateActor( 50, 944.6522, -1747.3267, 1013.5334, 358.0577 ) ;
                SetActorVirtualWorld ( actorid, b_info [ t ] [ b_id ] + 1000 ) ;
            }
            if ( b_info [ t ] [ b_int ] >= 0 && b_info [ t ] [ b_type ] != bizz_type_tune && b_info [ t ] [ b_type ] != bizz_type_gas )
            {
                new bis_int = b_info [ t ][ b_int ] ;
                CreateDynamicMapIcon ( b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ], b_interior [ bis_int ] [ i_map_icon ], 0, 0, 0, -1, 300.0 ) ;
            }
            else
            {
                switch ( b_info [ t ] [ b_type ] )
                {
                    case bizz_type_tune:CreateDynamicMapIcon ( b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ], 27, 0, 0, 0, -1, 300.0 ) ;
                    case bizz_type_gas:CreateDynamicMapIcon ( b_info [ t ] [ b_position ] [ 0 ], b_info [ t ] [ b_position ] [ 1 ], b_info [ t ] [ b_position ] [ 2 ], 47, 0, 0, 0, -1, 300.0 ) ;
                }
            }
        }
    }
    printf ( "[SERVER] Загружено %d бизнесов.", b_count ) ;
    return 1;
}
Мод Everest RP.
Сам я почему то не понял, в чем проблема.
 
Последнее редактирование модератором:
Сверху Снизу