Добро пожаловать!

Зарегистрировавшись у нас, вы сможете обсуждать, делиться и отправлять личные сообщения другим участникам нашего сообщества.

Зарегистрироваться!
  • Если Вы желаете помогать развитию проекта, готовы заполнять раздел(-ы) и подсказывать другим пользователям на портале, есть возможность попасть в команду редакторов. Для этого следует обратиться в техническую поддержку
Статус
В этой теме нельзя размещать новые ответы.
Пользователь
Регистрация
30 Мар 2022
Сообщения
20
Такая проблема.
Я могу спавнить несколько раз личные машины.

Мод Desmond.
Вот сам код спавна машины:

Код:
CMD:car(playerid, params[])
{
    if(GetPlayerOwnableCar(playerid) != INVALID_VEHICLE_ID)
    {
        Dialog
        (
            playerid, DIALOG_OWNABLE_CAR, DIALOG_STYLE_LIST,
            "{"#cGold"}Óïðàâëåíèå òðàíñïîðòîì",
            "{"#cW"}1. Îòêðûòü / çàêðûòü òðàíñïîðò\n"\
            "{"#cW"}2. Âñòàâèòü / âûòàùèòü êëþ÷è\n"\
            "{"#cW"}3. Îòìåòèòü òðàíñïîðò íà {"#cGold"}GPS {"#cW"}(300 ðóá)\n"\
            "{"#cW"}4. Äîêóìåíòû íà òðàíñïîðò\n"\
            "{"#cW"}5. Ïðèïàðêîâàòü òðàíñïîðò\n"\
            "{FF6600}Âûãðóçèòü òðàíñïîðò ñ ñåðâåðà",
            "Âûáðàòü", "Çàêðûòü"
        );
    }
    else
    {
        new fmt_text[640],
            Cache: result,
            id;

        mysql_format(mysql, fmt_text, sizeof fmt_text, "SELECT * FROM ownable_cars WHERE owner_id='%d'", GetPlayerAccountID(playerid));
        result = mysql_query(mysql, fmt_text, true);

        new rows = cache_num_rows();

        if(!rows)
            SendClientMessage(playerid, 0xFF6600FF, "Ó Âàñ íåò ëè÷íîãî òðàíñïîðòà");

        else
        {
            if(rows == 1)
            {
                id = cache_get_field_content_int(0, "id");

                ShowOwnableCarLoadDialog(playerid, id);
            }
            else
            {
                new query[60],
                    model_id,
                    car_number[7];

                format(fmt_text, sizeof fmt_text, "{"#cW"}Òðàíñïîðò\t\t{"#cW"}Íîìåðíîé çíàê\n");

                for(new i = 0; i < rows; i ++)
                {
                    id = cache_get_field_content_int(i, "id");
                    model_id = cache_get_field_content_int(i, "model_id") - 400;
                    cache_get_field_content(i, "number", car_number);

                    format(query, sizeof query, "{"#cW"}%d. %s\t\t{"#cGold"}%s\n", i + 1, GetVehicleInfo(model_id, VI_NAME), car_number);
                    strcat(fmt_text, query);
                    SetPlayerListitemValue(playerid, i, id);
                }

                Dialog
                (
                    playerid, DIALOG_OWNABLE_CAR_LIST, DIALOG_STYLE_TABLIST_HEADERS,
                    "{"#cGold"}Ëè÷íûé òðàíñïîðò",
                    fmt_text,
                    "Âûáðàòü", "Çàêðûòü"
                );
            }
        }

        cache_delete(result);
    }

    return 1;
}

Код:
stock ShowOwnableCarLoadDialog(playerid, id, bool: show_menu = false)
{
    SetPVarInt(playerid, "ownablecar_id", id);

    if(show_menu)
        SetPVarInt(playerid, "show_menu", 1);

    Dialog
    (
        playerid, DIALOG_OWNABLE_CAR_LOAD, DIALOG_STYLE_LIST,
        "{FFD83D}Ñèñòåìà óïðàâëåíèÿ òðàíñïîðòîì",
        "1. Îòìåòèòü òðàíñïîðò íà GPS {FF6600}(300 ðóá)\n"\
        "{888888}2. Çàãðóçèòü òðàíñïîðò",
        "Âûáðàòü", "Çàêðûòü"
    );
}
Код:
case DIALOG_OWNABLE_CAR_LOAD:
            {
                if(response)
                {
                    new idx = GetPVarInt(playerid, "ownablecar_id"),
                        Float: x,
                        Float: y,
                        Float: z,
                        Cache: result,
                        query[100];

                    mysql_format(mysql, query, sizeof query, "SELECT pos_x, pos_y, pos_z FROM ownable_cars WHERE id='%d'", idx);
                    result = mysql_query(mysql, query, true);

                    if(cache_num_rows())
                    {
                        x = cache_get_row_float(0, 0);
                        y = cache_get_row_float(0, 1);
                        z = cache_get_row_float(0, 2);
                    }

                    cache_delete(result);

                    switch(listitem + 1)
                    {
                        case 1:
                        {
                            if(GetPlayerGPSInfo(playerid, G_ENABLED) == GPS_STATUS_OFF)
                            {
                                if(GetPlayerMoneyEx(playerid) >= 300)
                                {
                                    GivePlayerMoneyEx(playerid, -300, "Ìåòêà ÒÑ íà GPS", true, true);

                                    EnablePlayerGPS(playerid, 55, x, y, z, "Ìåñòîïîëîæåíèå Âàøåãî òðàíñïîðòà îòìå÷åíî íà GPS");
                                    return 1;
                                }
                                else SendClientMessage(playerid, 0xFF6600FF, "Íåäîñòàòî÷íî äåíåã");
                            }
                            else SendClientMessage(playerid, 0xFF6600FF, "Íà Âàøåì GPS óæå îòìå÷åíî ìåñòî");
                        }
                        case 2:
                        {
                            if(GetPlayerOwnableCar(playerid) != INVALID_VEHICLE_ID)
                            {
                                SendClientMessage(playerid, 0xFF6600FF, "Ñèñòåìíàÿ îøèáêà. Òðàíñïîðò óæå çàãðóæåí.");
                                return 1;
                            }

                            if(!IsPlayerInRangeOfPoint(playerid, 45.0, x, y, z))
                            {
                                SendClientMessage(playerid, 0xFF6600FF, "Âû ñëèøêîì äàëåêî îò ìåñòà, ãäå ïðèïàðêîâàí Âàø òðàíñïîðò");
                            }
                            else
                            {
                                if(LoadOwnableCar(idx) != -1)
                                {
                                    PlayerOwnableCarInit(playerid);
                                    SendClientMessage(playerid, 0x66CC33FF, "Âàø òðàíñïîðò óñïåøíî çàãðóæåí!");
                                }
                                else SendClientMessage(playerid, 0xFF6600FF, "Îøèáêà ïðè çàãðóçêå ëè÷íîãî òðàíñïîðòà");
                            }
                        }
                    }
                }
                else
                {
                    if(GetPVarInt(playerid, "show_menu"))
                    {
                        DeletePVar(playerid, "show_menu");
                        callcmd::car(playerid, "");
                    }
                }
            }
Код:
public: PlayerOwnableCarInit(playerid)
{
    new index;
    new vehicleid = -1;

    while(vehicleid < MAX_VEHICLES-1)
    {
        vehicleid ++;
        index = GetVehicleData(vehicleid, V_ACTION_ID);

        if(GetVehicleData(vehicleid, V_ACTION_TYPE) != VEHICLE_ACTION_TYPE_OWNABLE_CAR) continue;
        if(GetOwnableCarData(index, OC_OWNER_ID) != GetPlayerAccountID(playerid)) continue;

        SetPlayerData(playerid, P_OWNABLE_CAR, vehicleid);
        break;
    }
}
 
Пользователь
Регистрация
30 Мар 2022
Сообщения
20
Код:
[19:22:07] [debug] AMX backtrace:
[19:22:07] [debug] #0 000e5f28 in public LoadOwnableCar (oc_id=5) at C:\Users\Draga\Desktop\Netfix\gamemodes\desmond.pwn:30704
[19:22:07] [debug] #1 00097dc0 in public OnDialogResponse (playerid=0, dialogid=261, response=1, listitem=1, inputtext[]=@0047bc30 "2. ") at C:\Users\Draga\Desktop\Netfix\gamemodes\desmond.pwn:21868
[19:22:08] Devel[0] used command: car
[19:22:08] [debug] Run time error 4: "Array index out of bounds"
[19:22:08] [debug]  Attempted to read/write array element at index 119 in array of size 4
[19:22:08] [debug] AMX backtrace:
[19:22:08] [debug] #0 000e5f28 in public LoadOwnableCar (oc_id=5) at C:\Users\Draga\Desktop\Netfix\gamemodes\desmond.pwn:30704
[19:22:08] [debug] #1 00097dc0 in public OnDialogResponse (playerid=0, dialogid=261, response=1, listitem=1, inputtext[]=@0047bc30 "2. ") at C:\Users\Draga\Desktop\Netfix\gamemodes\desmond.pwn:21868
[19:22:10] Devel[0] used command: car
[19:22:11] [debug] Run time error 4: "Array index out of bounds"
[19:22:11] [debug]  Attempted to read/write array element at negative index -1
[19:22:11] [debug] AMX backtrace:
[19:22:11] [debug] #0 000e5010 in public LoadOwnableCar (oc_id=5) at C:\Users\Draga\Desktop\Netfix\gamemodes\desmond.pwn:30649
[19:22:11] [debug] #1 00097dc0 in public OnDialogResponse (playerid=0, dialogid=261, response=1, listitem=1, inputtext[]=@0047bc30 "2. ") at C:\Users\Draga\Desktop\Netfix\gamemodes\desmond.pwn:21868
Ток это пишет.
21868 срока: if(LoadOwnableCar(idx) != -1)
 
Команда форума
Администратор
Регистрация
1 Апр 2022
Сообщения
489
Код:
[19:22:07] [debug] AMX backtrace:
[19:22:07] [debug] #0 000e5f28 in public LoadOwnableCar (oc_id=5) at C:\Users\Draga\Desktop\Netfix\gamemodes\desmond.pwn:30704
[19:22:07] [debug] #1 00097dc0 in public OnDialogResponse (playerid=0, dialogid=261, response=1, listitem=1, inputtext[]=@0047bc30 "2. ") at C:\Users\Draga\Desktop\Netfix\gamemodes\desmond.pwn:21868
[19:22:08] Devel[0] used command: car
[19:22:08] [debug] Run time error 4: "Array index out of bounds"
[19:22:08] [debug]  Attempted to read/write array element at index 119 in array of size 4
[19:22:08] [debug] AMX backtrace:
[19:22:08] [debug] #0 000e5f28 in public LoadOwnableCar (oc_id=5) at C:\Users\Draga\Desktop\Netfix\gamemodes\desmond.pwn:30704
[19:22:08] [debug] #1 00097dc0 in public OnDialogResponse (playerid=0, dialogid=261, response=1, listitem=1, inputtext[]=@0047bc30 "2. ") at C:\Users\Draga\Desktop\Netfix\gamemodes\desmond.pwn:21868
[19:22:10] Devel[0] used command: car
[19:22:11] [debug] Run time error 4: "Array index out of bounds"
[19:22:11] [debug]  Attempted to read/write array element at negative index -1
[19:22:11] [debug] AMX backtrace:
[19:22:11] [debug] #0 000e5010 in public LoadOwnableCar (oc_id=5) at C:\Users\Draga\Desktop\Netfix\gamemodes\desmond.pwn:30649
[19:22:11] [debug] #1 00097dc0 in public OnDialogResponse (playerid=0, dialogid=261, response=1, listitem=1, inputtext[]=@0047bc30 "2. ") at C:\Users\Draga\Desktop\Netfix\gamemodes\desmond.pwn:21868
Ток это пишет.
21868 срока: if(LoadOwnableCar(idx) != -1)

mysql_log покажите
 
Пользователь
Регистрация
30 Мар 2022
Сообщения
20
Код:
[16:20:27 08/15/22] [WARNING] cache_get_row_count - no active cache
[16:20:27 08/15/22] [ERROR] cache_delete - invalid connection handle (id: 1)
[16:32:20 08/15/22] [ERROR] mysql_query - invalid connection handle (id: 0)
[16:32:20 08/15/22] [WARNING] cache_get_row_count - no active cache
[16:32:20 08/15/22] [ERROR] cache_delete - invalid connection handle (id: 1)
[17:57:03 08/15/22] [ERROR] mysql_query - invalid connection handle (id: 0)
[17:57:03 08/15/22] [WARNING] cache_get_row_count - no active cache
[17:57:03 08/15/22] [ERROR] cache_delete - invalid connection handle (id: 1)
[18:00:05 08/15/22] [ERROR] mysql_query - invalid connection handle (id: 0)
[18:00:05 08/15/22] [WARNING] cache_get_row_count - no active cache
[18:00:05 08/15/22] [ERROR] cache_delete - invalid connection handle (id: 1)
[18:20:05 08/15/22] [ERROR] mysql_query - invalid connection handle (id: 0)
[18:20:05 08/15/22] [WARNING] cache_get_row_count - no active cache
[18:20:05 08/15/22] [ERROR] cache_delete - invalid connection handle (id: 1)
[18:33:22 08/15/22] [ERROR] mysql_query - invalid connection handle (id: 0)
[18:33:22 08/15/22] [WARNING] cache_get_row_count - no active cache
[18:33:22 08/15/22] [ERROR] cache_delete - invalid connection handle (id: 1)
[19:20:58 08/15/22] [ERROR] mysql_query - invalid connection handle (id: 0)
[19:20:58 08/15/22] [WARNING] cache_get_row_count - no active cache
[19:20:58 08/15/22] [ERROR] cache_delete - invalid connection handle (id: 1)
[20:00:27 08/15/22] [ERROR] mysql_query - invalid connection handle (id: 0)
[20:00:27 08/15/22] [WARNING] cache_get_row_count - no active cache
[20:00:27 08/15/22] [ERROR] cache_delete - invalid connection handle (id: 1)
 
Команда форума
Администратор
Регистрация
1 Апр 2022
Сообщения
489
Код:
[16:20:27 08/15/22] [WARNING] cache_get_row_count - no active cache
[16:20:27 08/15/22] [ERROR] cache_delete - invalid connection handle (id: 1)
[16:32:20 08/15/22] [ERROR] mysql_query - invalid connection handle (id: 0)
[16:32:20 08/15/22] [WARNING] cache_get_row_count - no active cache
[16:32:20 08/15/22] [ERROR] cache_delete - invalid connection handle (id: 1)
[17:57:03 08/15/22] [ERROR] mysql_query - invalid connection handle (id: 0)
[17:57:03 08/15/22] [WARNING] cache_get_row_count - no active cache
[17:57:03 08/15/22] [ERROR] cache_delete - invalid connection handle (id: 1)
[18:00:05 08/15/22] [ERROR] mysql_query - invalid connection handle (id: 0)
[18:00:05 08/15/22] [WARNING] cache_get_row_count - no active cache
[18:00:05 08/15/22] [ERROR] cache_delete - invalid connection handle (id: 1)
[18:20:05 08/15/22] [ERROR] mysql_query - invalid connection handle (id: 0)
[18:20:05 08/15/22] [WARNING] cache_get_row_count - no active cache
[18:20:05 08/15/22] [ERROR] cache_delete - invalid connection handle (id: 1)
[18:33:22 08/15/22] [ERROR] mysql_query - invalid connection handle (id: 0)
[18:33:22 08/15/22] [WARNING] cache_get_row_count - no active cache
[18:33:22 08/15/22] [ERROR] cache_delete - invalid connection handle (id: 1)
[19:20:58 08/15/22] [ERROR] mysql_query - invalid connection handle (id: 0)
[19:20:58 08/15/22] [WARNING] cache_get_row_count - no active cache
[19:20:58 08/15/22] [ERROR] cache_delete - invalid connection handle (id: 1)
[20:00:27 08/15/22] [ERROR] mysql_query - invalid connection handle (id: 0)
[20:00:27 08/15/22] [WARNING] cache_get_row_count - no active cache
[20:00:27 08/15/22] [ERROR] cache_delete - invalid connection handle (id: 1)
База точно правильно подключена?
 
Пользователь
Регистрация
30 Мар 2022
Сообщения
20
В подключении базы.
а если точнее можно пожалуйста???? Она подключена.
Загрузка бизнесов из базы, домов и тд. А так же сохранение в базу данных работает.
 
Команда форума
Администратор
Регистрация
1 Апр 2022
Сообщения
489
Пользователь
Регистрация
30 Мар 2022
Сообщения
20
Команда форума
Администратор
Регистрация
1 Апр 2022
Сообщения
489
Заполните все данные поля и пробуйте. Перед запуском, удалите файлы server_log и mysql_log на хостинге. Если ничего не
изменится, прикрепите два данных файла.
Screenshot_49.png
 
Пользователь
Регистрация
30 Мар 2022
Сообщения
20
Пользователь
Регистрация
30 Мар 2022
Сообщения
20

Вложения

  • mysql_log.txt
    224 байт · Просмотры: 2
  • server_log.txt
    3.6 KB · Просмотры: 3
Статус
В этой теме нельзя размещать новые ответы.
Сверху