Рекомендованные сообщения



Не найдено.

1 post in this topic

помогите с ошибкой пожалуйста
Спойлер

case D_AutoSalon:
		{
			if(response)
			{
				switch(listitem)
				{
					case 0:
					{
						if(pInfo[playerid][cModel][0] != 0)
						    return SendClientMessage(playerid, COLOR_DARKORANGE, "У Вас уже есть транспорт, продайте его - /sellcar");

					    new select_car = buy_car_select_car[playerid];

						if(pInfo[playerid][pCash] < car_market_data[select_car][car_cost])
						    return SendClientMessage(playerid, COLOR_DARKORANGE, "У Вас недостаточно денег для покупки этого транспорта");

						TogglePlayerControllable(playerid, true);
						TransferMoney(playerid, -1, car_market_data[select_car][car_cost]);

						for(new i = 0; i < autosalon_td_size; i++)
								PlayerTextDrawHide(playerid, autosalon_td[playerid][i]);

						CancelSelectTextDraw(playerid);

						SetPlayerPosEx(playerid, 2475.6575,-730.6911,12.3000);
						SetPlayerFacingAngle(playerid, 180.1674);
						SetPlayerInterior(playerid, 0);
						SetPlayerVirtualWorld(playerid, 0);
						SetCameraBehindPlayer(playerid);

						for(new i = 0; i < 14; i++)
						{
						    pInfo[playerid][cVehcoms_1][i] = 0;
						}
						format(pInfo[playerid][cVehcom_1], 64, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
						pInfo[playerid][cVehcoms_1][0],pInfo[playerid][cVehcoms_1][1],pInfo[playerid][cVehcoms_1][2],
						pInfo[playerid][cVehcoms_1][3],pInfo[playerid][cVehcoms_1][4],pInfo[playerid][cVehcoms_1][5],
						pInfo[playerid][cVehcoms_1][6],pInfo[playerid][cVehcoms_1][7],pInfo[playerid][cVehcoms_1][8],
						pInfo[playerid][cVehcoms_1][9],pInfo[playerid][cVehcoms_1][10],pInfo[playerid][cVehcoms_1][11],
						pInfo[playerid][cVehcoms_1][12],pInfo[playerid][cVehcoms_1][13]);

						pInfo[playerid][cModel][0] = car_market_data[select_car][car_id];
						pInfo[playerid][cCost][0] = car_market_data[select_car][car_cost];

						new max_fuel_in_car = GetVehicleModel(player_buy_car[playerid]);
						pInfo[playerid][cFuel][0] = VehStats[max_fuel_in_car-400][vMaxFuel];

						pInfo[playerid][cMileage][0] = 0.0;
						pInfo[playerid][cColor_1][0] = buy_car_select_color[playerid];
						pInfo[playerid][cColor_1][1] = 0;
						pInfo[playerid][cPaintjob][0] = 3;

						if(player_buy_car[playerid] != INVALID_VEHICLE_ID)
						{
						    DestroyVehicle(player_buy_car[playerid]);
						    player_buy_car[playerid] = INVALID_VEHICLE_ID;
						}

						buy_car_select_color[playerid] =
						player_buy_car[playerid] = -1;

					    LoadPlayerVehicle(playerid, 0);

   						new Float:X, Float:Y, Float:Z, locname[15];
						locname = "Ваш автомобиль";
						GetVehiclePos(pTemp[playerid][pCarPlayerID][0], X, Y, Z);
						SetPlayerGPS(playerid, X, Y, Z, locname);

						new fmt_query[300];
						format
						(
							fmt_query, sizeof fmt_query,
							"UPDATE `accounts` SET `cModel_1` = '%d',\
							`cFuel_1` = '%.0f',\
							`cColor1_1` = '%d',\
							`cColor1_2` = '%d',\
							`cCost_1` = '%d',\
							`cVehcom_1` = '%s',\
							`cPaintjob_1` = '%d'\
							 WHERE `id` = '%d'",
							pInfo[playerid][cModel][0],
							pInfo[playerid][cFuel][0],
							pInfo[playerid][cColor_1][0],
							pInfo[playerid][cColor_1][1],
							pInfo[playerid][cCost][0],
							pInfo[playerid][cVehcom_1],
							pInfo[playerid][cPaintjob][0],
							pInfo[playerid][pID]

						);
						mysql_query(dbHandle, fmt_query);

						new format_message[128];
						format(format_message, sizeof(format_message), "Игрок %s купил транспорт %s[%i] в слот №1 за %d рублей", GetName(playerid), VehStats[pInfo[playerid][cModel]-400][vName], pInfo[playerid][cModel], car_market_data[select_car][car_cost]);
						WriteLog("BuyCar", format_message);

						SendClientMessage(playerid, COLOR_LIGHTGREEN, "Поздравляем с приобретением автомобиля!");
						SendClientMessage(playerid, COLOR_BLUE, "Автомобиль помещен в слот #1, пожалуйста, не забудьте припарковать его (/park)");
						SendClientMessage(playerid, COLOR_WHITE, "Ваш автомобиль помечен красной меткой!");
					}
				}
			}
		}

 

Строка

new Float:X, Float:Y, Float:Z, locname[15];

ошибка

 

[12:26:55] [debug] Run time error 4: "Array index out of bounds"
[12:26:55] [debug] Accessing element at index 11 past array upper bound 8
[12:26:55] [debug] AMX backtrace:
[12:26:55] [debug] #1 000ce318 in public OnDialogResponse (playerid=0, dialogid=283, response=1, listitem=0, inputtext[]=@006f58e4 "")

 

Edited by DEST

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • AndreyBoy
      By AndreyBoy
      У меня появилась постоянная проблема при перезаходе на сервер именно при админке. Я пробовал перезаходить без админки и всё успешно. Но когда я перезахожу с админкой то у меня не перекидывает на авторизацию и тому подобное а просто стрелочки снизу и "Spawn". Пробовал тыкать и ничего не выходит. Помогите решить проблему