Проблема с личным авто - Форум Cheat-Master.ru

  • Страница 1 из 1
  • 1
Модератор форума: Artem_Buero, PasqualeQQ, tumkin  
Форум » Pawno программирование » Вопросы | Проблемы » Проблема с личным авто
Проблема с личным авто
[CM]NodДата: Понедельник, 16.04.2018, 14:32 | Сообщение # 1
Боец
Сообщений: 109
Статус: Offline
Приветствую, в общем такая проблема, вхожу в гараж, беру мопед, выезжаю, ввожу /fixcar мопед спавнится, но в логах такая ошибка:
Код
[18:20:12] [debug] Run time error 4: "Array index out of bounds"
[18:20:12] [debug]  Accessing element at negative index -1
[18:20:12] [debug] AMX backtrace:
[18:20:12] [debug] #0 00311c38 in public OnVehicleSpawn (653) from ****-rp.amx
[18:20:12] [debug] #1 native SetVehicleToRespawn () from samp03svr
[18:20:12] [debug] #2 002d5d2c in public cmd_fixcar (0, 19254596) from *****-rp.amx
[18:20:12] [debug] #3 native DC_CMD () from dc_cmd.so
[18:20:12] [debug] #4 0000639c in public OnPlayerCommandText (0, 19254564) from *****-rp.amx
[18:20:12] [debug] Run time error 4: "Array index out of bounds"
[18:20:12] [debug]  Accessing element at negative index -1
[18:20:12] [debug] AMX backtrace:
[18:20:12] [debug] #0 0036ffe0 in ?? (0, 653, -1) from *****-rp.amx
[18:20:12] [debug] #1 002d6210 in public cmd_fixcar (0, 19254596) from *****-rp.amx
[18:20:12] [debug] #2 native DC_CMD () from dc_cmd.so
[18:20:12] [debug] #3 0000639c in public OnPlayerCommandText (0, 19254564) from *****-rp.amx


Ну это мало того, еще заезжаю в автомагазин, покупаю авто, ввожу /fixcar купленное авто появляется в гараже, но после рестарта, выхода с игры или ввода /fixcar авто пропадает и на его месте снова мопед, заглянул в логи, и все тоже самое.

Вот с павно:
Код
  {
   if(!r)
   {
       for(new i = 0; i < 5; i++)
    {
     mysql_format(DATABASE, QUERY, sizeof(QUERY), "INSERT INTO `"TABLE_CARS"` (`owner`,`id`,`model`,`fuel`,`color_one`,`color_two`) VALUES ('%s','%i','462','100','1','1')" ,PTEMP[playerid][pName],i);
     mysql_function_query(DATABASE,QUERY,false,"","");
    }
    /*mysql_format(DATABASE, QUERY, sizeof(QUERY), "INSERT INTO `"TABLE_CARS"` (`owner`,`id`) VALUES ('%s','0')" ,PTEMP[playerid][pName]);
    mysql_function_query(DATABASE,QUERY,false,"","");
    mysql_format(DATABASE, QUERY, sizeof(QUERY), "INSERT INTO `"TABLE_CARS"` (`owner`,`id`) VALUES ('%s','1')" ,PTEMP[playerid][pName]);
    mysql_function_query(DATABASE,QUERY,false,"","");
    mysql_format(DATABASE, QUERY, sizeof(QUERY), "INSERT INTO `"TABLE_CARS"` (`owner`,`id`) VALUES ('%s','2')" ,PTEMP[playerid][pName]);
    mysql_function_query(DATABASE,QUERY,false,"","");
    mysql_format(DATABASE, QUERY, sizeof(QUERY), "INSERT INTO `"TABLE_CARS"` (`owner`,`id`) VALUES ('%s','3')" ,PTEMP[playerid][pName]);
    mysql_function_query(DATABASE,QUERY,false,"","");
    mysql_format(DATABASE, QUERY, sizeof(QUERY), "INSERT INTO `"TABLE_CARS"` (`owner`,`id`) VALUES ('%s','4')" ,PTEMP[playerid][pName]);
    mysql_function_query(DATABASE,QUERY,false,"","");*/
    return SCM(playerid,COLOR_GREY," Информация о ваших автомобилях не была найдена. Перезайдите на сервер!");
   }
   for(x = 0; x < r; x++)
   {
    CarInfo[playerid][carID][x] =           cache_get_row_int(x,0, DATABASE);
    cache_get_row(x,1,    string, DATABASE, MAX_PLAYER_NAME);
    CarInfo[playerid][carModel][x] =        cache_get_row_int(x,2, DATABASE);
    CarInfo[playerid][carColor_one][x] =    cache_get_row_int(x,3, DATABASE);
    CarInfo[playerid][carColor_two][x] =    cache_get_row_int(x,4, DATABASE);
    CarInfo[playerid][carPercent][x] =    cache_get_row_int(x,5, DATABASE);
    CarInfo[playerid][carFuel][x] =     cache_get_row_float(x,6, DATABASE);
    CarInfo[playerid][carVehcom_1][x] =     cache_get_row_int(x,7, DATABASE);
    CarInfo[playerid][carVehcom_2][x] =     cache_get_row_int(x,8, DATABASE);
    CarInfo[playerid][carVehcom_3][x] =     cache_get_row_int(x,9, DATABASE);
    CarInfo[playerid][carVehcom_4][x] =     cache_get_row_int(x,10, DATABASE);
    CarInfo[playerid][carVehcom_5][x] =     cache_get_row_int(x,11, DATABASE);
    CarInfo[playerid][carVehcom_6][x] =     cache_get_row_int(x,12, DATABASE);
    CarInfo[playerid][carVehcom_7][x] =     cache_get_row_int(x,13, DATABASE);
    CarInfo[playerid][carVehcom_8][x] =     cache_get_row_int(x,14, DATABASE);
    CarInfo[playerid][carVehcom_9][x] =     cache_get_row_int(x,15, DATABASE);
    CarInfo[playerid][carVehcom_10][x] =     cache_get_row_int(x,16, DATABASE);
    CarInfo[playerid][carVehcom_11][x] =     cache_get_row_int(x,17, DATABASE);
    CarInfo[playerid][carVehcom_12][x] =     cache_get_row_int(x,18, DATABASE);
    CarInfo[playerid][carVehcom_13][x] =     cache_get_row_int(x,19, DATABASE);
    CarInfo[playerid][carVehcom_14][x] =     cache_get_row_int(x,20, DATABASE);
   }
   if(CarInfo[playerid][carModel][0] == 0 || CarInfo[playerid][carModel][1] == 0 || CarInfo[playerid][carModel][2] == 0
   || CarInfo[playerid][carModel][3] == 0 || CarInfo[playerid][carModel][4] == 0)
   {
       for(new i = 0; i < 5; i++)
       {
           CarInfo[playerid][carModel][i] = 462;
           CarInfo[playerid][carColor_one][i] = 1;
           CarInfo[playerid][carColor_two][i] = 1;
           CarInfo[playerid][carPercent][i] = 100;
       }
   }
   printf("[Загрузка ...] Автомобили игрока %s были загружены: %i, %i, %i, %i, %i",Name(playerid), CarInfo[playerid][carModel][0],CarInfo[playerid][carModel][1],CarInfo[playerid][carModel][2],CarInfo[playerid][carModel][3],CarInfo[playerid][carModel][4]);
   if(HGet(playerid))
   {
       new house = PTEMP[playerid][pPHouseKey];
       switch(HouseInfo[house][hKlass])
       {
           case 0..1:
           {
            garage_car[playerid][0] = CreateVehicle(CarInfo[playerid][carModel][0], HouseInfo[house][hCarx], HouseInfo[house][hCary], HouseInfo[house][hCarz], HouseInfo[house][hCarc] , CarInfo[playerid][carColor_one][0] ,CarInfo[playerid][carColor_two][0], 86400);
      SetVehicleParamsEx(garage_car[playerid][0],false,false,false,true,false,false,false);
      CarHealth[garage_car[playerid][0]] = float(1000);
      createdcar ++;
      Fuell[garage_car[playerid][0]] = CarInfo[playerid][carFuel][0];
      LoadTuning(playerid,garage_car[playerid][0],0);
      house_car[playerid] = garage_car[playerid][0];
     }
     case 2: // house C Class
     {
      SpawnCarOne(playerid, 248.1234,-110.5993,1003.6578,90.6935); // Load car #2
         LinkVehicleToInterior(garage_car[playerid][0], 19);
      SetVehicleVirtualWorld(garage_car[playerid][0], house+100);
      //----------------------
         SpawnCarTwo(playerid, 248.3368,-104.4114,1003.6582,86.1593); // Load car #1
         LinkVehicleToInterior(garage_car[playerid][1], 19);
      SetVehicleVirtualWorld(garage_car[playerid][1], house+100);
     }
     case 3: // house B Class
     {
         SpawnCarOne(playerid, 435.5904,468.6050,1002.6595,358.6705); // Load car #1
         LinkVehicleToInterior(garage_car[playerid][0], 19);
      SetVehicleVirtualWorld(garage_car[playerid][0], house+100);
         //----------------------
         SpawnCarTwo(playerid, 441.7249,468.3962,1002.6600,360.0000); // Load car #2
         LinkVehicleToInterior(garage_car[playerid][1], 19);
      SetVehicleVirtualWorld(garage_car[playerid][1], house+100);
         //----------------------
         SpawnCarThree(playerid, 447.4809,468.1860,1002.6586,358.1951); // Load car #3
         LinkVehicleToInterior(garage_car[playerid][2], 19);
      SetVehicleVirtualWorld(garage_car[playerid][2], house+100);
     }
     case 4: // house A Class
     {
         SpawnCarOne(playerid, 893.5298,31.7400,1004.1795,333.8575); // Load car #1
         LinkVehicleToInterior(garage_car[playerid][0], 19);
      SetVehicleVirtualWorld(garage_car[playerid][0], house+100);
         //----------------------
         SpawnCarTwo(playerid, 897.6765,31.8136,1004.1783,0.9835); // Load car #2
         LinkVehicleToInterior(garage_car[playerid][1], 19);
      SetVehicleVirtualWorld(garage_car[playerid][1], house+100);
         //----------------------
         SpawnCarThree(playerid, 902.9612,31.9576,1004.1783,1.5516); // Load car #3
         LinkVehicleToInterior(garage_car[playerid][2], 19);
      SetVehicleVirtualWorld(garage_car[playerid][2], house+100);
         //----------------------
         SpawnCarFour(playerid, 907.1154,32.3961,1004.1783,30.6716); // Load car #4
         LinkVehicleToInterior(garage_car[playerid][3], 19);
      SetVehicleVirtualWorld(garage_car[playerid][3], house+100);
     }
     case 5: // house S Class
     {
         SpawnCarOne(playerid, 511.2867,505.0032,1002.3588,47.6021); // Load car #1
         LinkVehicleToInterior(garage_car[playerid][0], 19);
      SetVehicleVirtualWorld(garage_car[playerid][0], house+100);
         //----------------------
         SpawnCarTwo(playerid, 504.8487,503.1697,1002.3583,90.2742); // Load car #3
         LinkVehicleToInterior(garage_car[playerid][1], 19);
      SetVehicleVirtualWorld(garage_car[playerid][1], house+100);
         //----------------------
         SpawnCarThree(playerid, 504.5507,512.3398,1002.3583,91.0430); // Load car #4
         LinkVehicleToInterior(garage_car[playerid][2], 19);
      SetVehicleVirtualWorld(garage_car[playerid][2], house+100);
      //----------------------
      SpawnCarFour(playerid, 504.7199,521.3282,1002.3588,90.3364); // Load car #5
         LinkVehicleToInterior(garage_car[playerid][3], 19);
      SetVehicleVirtualWorld(garage_car[playerid][3], house+100);
      //----------------------
         SpawnCarFive(playerid, 511.4334,518.2543,1002.3597,126.6747); // Load car #2
         LinkVehicleToInterior(garage_car[playerid][4], 19);
      SetVehicleVirtualWorld(garage_car[playerid][4], house+100);
     }
    }
//    SetPVarInt(playerid,"chosencar",0);
   }
  }
  case 37:
  {
   if(!r)
   {
    return printf("[Error] Информация о машинах игрока в бд не найдена");
   }
   new temp[0x9e];
   for(x = 0; x < r; x++)
   {
    mysql_format(DATABASE, QUERY, sizeof(QUERY), "UPDATE `"TABLE_CARS"` SET ");
    format(temp,sizeof(temp),"`model`= '%i',",CarInfo[playerid][carModel][x]),      strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`color_one`= '%i',",CarInfo[playerid][carColor_one][x]),    strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`color_two`= '%i',",CarInfo[playerid][carColor_two][x]),    strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`percent`= '%i',",CarInfo[playerid][carPercent][x]),     strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`fuel`= '%f',",CarInfo[playerid][carFuel][x]),      strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`vehcom_1`= '%i',",CarInfo[playerid][carVehcom_1][x]),    strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`vehcom_2`= '%i',",CarInfo[playerid][carVehcom_2][x]),    strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`vehcom_3`= '%i',",CarInfo[playerid][carVehcom_3][x]),    strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`vehcom_4`= '%i',",CarInfo[playerid][carVehcom_4][x]),    strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`vehcom_5`= '%i',",CarInfo[playerid][carVehcom_5][x]),    strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`vehcom_6`= '%i',",CarInfo[playerid][carVehcom_6][x]),    strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`vehcom_7`= '%i',",CarInfo[playerid][carVehcom_7][x]),    strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`vehcom_8`= '%i',",CarInfo[playerid][carVehcom_8][x]),    strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`vehcom_9`= '%i',",CarInfo[playerid][carVehcom_9][x]),    strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`vehcom_10`= '%i',",CarInfo[playerid][carVehcom_10][x]),    strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`vehcom_11`= '%i',",CarInfo[playerid][carVehcom_11][x]),    strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`vehcom_12`= '%i',",CarInfo[playerid][carVehcom_12][x]),    strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`vehcom_13`= '%i',",CarInfo[playerid][carVehcom_13][x]),    strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp),"`vehcom_14`= '%i'",CarInfo[playerid][carVehcom_14][x]),    strcat(QUERY,temp,sizeof(QUERY));
    format(temp,sizeof(temp)," WHERE id = '%i'",CarInfo[playerid][carID][x]),  strcat(QUERY,temp,sizeof(QUERY));
    mysql_function_query(DATABASE, QUERY, true, "", "");
   }
   printf("[Сохранение] Автомобили %s | %i,%i,%i,%i,%i сохранены",PTEMP[playerid][pName],CarInfo[playerid][carModel][0],CarInfo[playerid][carModel][1],CarInfo[playerid][carModel][2],CarInfo[playerid][carModel][3],CarInfo[playerid][carModel][4]);
  }


Убирал это:
Код
                        {
                            for(new i = 0; i < 5; i++)
                            {
                    CarInfo[playerid][carModel][i] = 462;
                    CarInfo[playerid][carColor_one][i] = 1;
                    CarInfo[playerid][carColor_two][i] = 1;
                    CarInfo[playerid][carPercent][i] = 100;
                            }
                        }

, в гараже появлялся только один мопед.


;)
Последние товары с игрового магазина:
Найти еще что-нибудь в магазине:
Yura_AppleДата: Пятница, 20.04.2018, 20:52 | Сообщение # 2
Новичок
Сообщений: 4
Статус: Offline
Насчет первых ошибок, я так понял, что у тебя инклуд DC_CMD стоит, а ты пользуешься OnPlayerCommandText. Возможно из-за этого.
Последние товары с игрового магазина:
Найти еще что-нибудь в магазине:
Форум » Pawno программирование » Вопросы | Проблемы » Проблема с личным авто
  • Страница 1 из 1
  • 1
Поиск:
Статистика Форума
Последнии темы Читаемые темы Лучшие пользователи Новые пользователи
Как легко пробить информа... [wenifr]

Личный акк .15 прем танко... [Moro1712]

1913725, DevS, Невалид [Medvedprofessor]

Как легко пробить информа... [Daddy_McTawer]

Бот для приложение клевер [Talib_Afgan]

(МОДЕРАТОР) ПРОДАЖА CS:GO... [forse]

[Arizona Role-Play] [NEW]... [Koteika13372]

Заказ № 1913749, Продавец... [YouCan-201]

Продам 1.000.000 на Diamo... [Balanda2]

Автоматический сервис про... [m1ntol]

Раздача ключей STEAM [lucovica]

[AHK] AutoRP для ДРП. [sativka]

[1]>[0.3z][RUS] S0beit modified by MishaN [10001]

[2]>Курилка [10000]

[3]>Поиск CLEO скриптов | Вопросы по клео скриптам [9988]

[4]>Флудильная [9936]

[5]>Курилка [9688]

[6]>Курилка [9614]

[7]>RakBot - Качай аккаунты не напрягаясь! [9579]

[8]>Общение читеров [CM] [9546]

[9]>S0beit - pr9n project for samp 0.3.7 [9490]

[10]>Часто задаваемые вопросы... [8224]

[11]>Скуплю Advance по 300р за 1кк и DIamond по 250р [7624]

[12]>Вопросы и ответы [6466]

[1]>АК_47 [30825]

[2]>GеNius [7000]

[3]>romka619 [5400]

[4]>[CM]Russel [5192]

[5]>[CM]AGRESSOR [4653]

[6]>Сэс [4430]

[7]>Snake_Firm [4371]

[8]>Artem_Buero [4177]

[9]>[CM]Durman [3271]

[10]>sky_Woker [2997]

[11]>iMaddy [2871]

[12]>[CM]Рафаэль [2767]

[13]>Sa1nteD [2693]

[14]>Ch0c0Cube [2453]

[15]>BY [2327]

noobason11 [23.04.2018|08:59]

[CM]SpeedShop [23.04.2018|08:54]

вфвфвф [23.04.2018|08:47]

Kusiko [23.04.2018|08:44]

arta5554 [23.04.2018|07:16]

Romaroma15 [23.04.2018|07:14]

xxxEVExxx [23.04.2018|06:29]

jeka101m1 [23.04.2018|05:40]

demontronpc [23.04.2018|05:06]

DAsssada [23.04.2018|04:09]

nikitaavira2 [23.04.2018|03:32]

ubiystvenniy [23.04.2018|01:22]

Rolli228228228 [23.04.2018|01:21]

Carsen_ [23.04.2018|00:35]

mindel [23.04.2018|00:27]


CM Team © 2009-2018 Администрация не несёт ответственности за размещённые материалы. Условия пользования
Все материалы предоставлены в ознакомительных целях и администрация предлагает удалить их после ознакомления.

Положение о защите персональных данных на сайте, Пользовательское соглашение, Договор оказания услуг.