[CM]Nod |
Дата: Понедельник, 16.04.2018, 14:32 | Сообщение # 1
|
Боец
Сообщений: 119
Статус: 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; } } , в гараже появлялся только один мопед.
;)
|
|
|
|