Просмотр полной версии : [Вопрос] Crash в логах и на сервере
В сервер логе:
[18:32:09] [debug] Run time error 4: "Array index out of bounds"
[18:32:09] [debug] Accessing element at negative index -400
[18:32:09] [debug] AMX backtrace:
[18:32:09] [debug] #0 00134194 in public UpdateSpeedometr (playerid=0) at C:\Documents and Settings\Admin\lol.pwn:19891
Сам код:
public UpdateSpeedometr(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(!vehicleid) return true;
new strr[20];
format(strr,sizeof(strr),"SPEED:~g~ %i KM/H",SpeedVehicle(playerid));
TextDrawSetString(VehicleSpeedometr[playerid],strr);
format(strr,sizeof(strr),"FUEL:~g~ %i",Vehicle[vehicle][Fuel]);
TextDrawSetString(IndicatorVehicle2[playerid],strr);
format(strr,sizeof(strr),"NAME:~r~ %s",VehicleNames[GetVehicleModel(vehicleid)-400]); // строка 19891
TextDrawSetString(IndicatorVehicle4[playerid],strr);
format(strr, sizeof(strr),"ENGINE: %s", Vehicle[vehicle][Engine] == false ? ("~r~OFF") : ("~g~ON"));
TextDrawSetString(IndicatorVehicle3[playerid],strr);
format(strr, sizeof(strr),"STATUS: %s", Vehicle[vehicle][CarLock] == false ? ("~g~UNLOCK") : ("~r~LOCK"));
TextDrawSetString(IndicatorVehicle[playerid],strr);
return 0;
}
И когда я выбираю интерьер для дома, я тп в него и у меня почти в каждом интерьере нет обстановки и в чат выводит данный текст:
[18:30:54] Warning(s007): Exception 0xC0000005 at 0x593C6F
В какой момент выдаёт сообщение в лог?
public TestDrive(playerid)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
VehTest[playerid] = CreateVehicle(426, X,Y,Z, 0.0, random(10), 0, 10000);
RepairVehicleAC(VehTest[playerid]);
Vehicle[VehTest[playerid]][ServerVehicle] = false;
Vehicle[VehTest[playerid]][CarLock] = false;
Vehicle[VehTest[playerid]][TimeFuel] = 0;
Vehicle[VehTest[playerid]][Fuel] = 100;
Vehicle[VehTest[playerid]][Engine] = false;
PutPlayerInVehicles(playerid, VehTest[playerid], 0);
Test[playerid] = true;
return true;
}
Когда персонаж уже в кар тп-хнулся
Ну залогируй
public UpdateSpeedometr(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(!vehicleid) return true;
new strr[20];
format(strr,sizeof(strr),"SPEED:~g~ %i KM/H",SpeedVehicle(playerid));
TextDrawSetString(VehicleSpeedometr[playerid],strr);
format(strr,sizeof(strr),"FUEL:~g~ %i",Vehicle[vehicle][Fuel]);
TextDrawSetString(IndicatorVehicle2[playerid],strr);
format(strr,sizeof(strr),"NAME:~r~ %s",VehicleNames[GetVehicleModel(vehicleid)-400]); // строка 19891
printf("%d | %d", vehicleid, GetVehicleModel(vehicleid));
TextDrawSetString(IndicatorVehicle4[playerid],strr);
format(strr, sizeof(strr),"ENGINE: %s", Vehicle[vehicle][Engine] == false ? ("~r~OFF") : ("~g~ON"));
TextDrawSetString(IndicatorVehicle3[playerid],strr);
format(strr, sizeof(strr),"STATUS: %s", Vehicle[vehicle][CarLock] == false ? ("~g~UNLOCK") : ("~r~LOCK"));
TextDrawSetString(IndicatorVehicle[playerid],strr);
return 0;
}
[20:21:20] [debug] Run time error 4: "Array index out of bounds"
[20:21:20] [debug] Accessing element at negative index -400
[20:21:20] [debug] AMX backtrace:
[20:21:20] [debug] #0 00134540 in public UpdateSpeedometr (playerid=0) at C:\Documents and Settings\lol.pwn 19914
[20:23:15] 309 | 426
[20:23:15] 309 | 426
[20:23:15] 309 | 426
[20:23:16] 309 | 426
[20:23:16] 309 | 426
[20:23:16] 309 | 426
[20:23:16] 309 | 426
[20:23:17] 309 | 426
[20:23:17] 309 | 426
[20:23:17] 309 | 426
[20:23:17] 309 | 426
[20:23:17] 309 | 426
[20:23:18] 309 | 426
[20:23:18] 309 | 426
[20:23:18] 309 | 426
[20:23:18] 309 | 426
[20:23:19] 309 | 426
[20:23:19] 309 | 426
[20:23:19] 309 | 426
[20:23:19] 309 | 426
[20:23:19] 309 | 426
[20:23:20] 309 | 426
[20:23:20] 309 | 426
[20:23:20] 309 | 426
[20:23:20] 309 | 426
[20:23:21] 309 | 426
[20:23:21] 309 | 426
[20:23:21] 309 | 426
[20:23:21] 309 | 426
[20:23:22] 309 | 426
[20:23:22] 309 | 426
[20:23:22] 309 | 426
[20:23:22] 309 | 426
[20:23:23] 309 | 426
[20:23:23] 309 | 426
[20:23:23] 309 | 426
[20:23:23] 309 | 426
[20:23:24] 309 | 426
[20:23:24] 309 | 426
[20:23:24] 309 | 426
[20:23:24] 309 | 426
[20:23:24] 309 | 426
[20:23:25] 309 | 426
[20:23:25] 309 | 426
[20:23:25] 309 | 426
[20:23:25] 309 | 426
[20:23:26] 309 | 426
[20:23:26] 309 | 426
[20:23:26] 309 | 426
[20:23:26] 309 | 426
[20:23:27] 309 | 426
[20:23:27] 309 | 426
[20:23:27] 309 | 426
[20:23:27] 309 | 426
[20:23:27] 309 | 426
[20:23:28] 309 | 426
[20:23:28] 309 | 426
[20:23:28] 309 | 426
[20:23:28] 309 | 426
[20:23:29] 309 | 426
[20:23:29] 309 | 426
[20:23:29] 309 | 426
Выше
[20:21:20] [debug] Run time error 4: "Array index out of bounds"
строк нет?
нету
- - - Добавлено - - -
Вот весь лог
----------
Loaded log file: "server_log.txt".
----------
SA-MP Dedicated Server
----------------------
v0.3z, (C)2005-2014 SA-MP Team
[20:15:31] password = "" (string)
[20:15:31] hostname = "SA-MP Server" (string)
[20:15:31] weburl = "www.sa-mp.com" (string)
[20:15:31]
[20:15:31] Server Plugins
[20:15:31] --------------
[20:15:31] Loading plugin: crashdetect
[20:15:31] crashdetect v4.8.5 is OK.
[20:15:31] Loaded.
[20:15:31] Loading plugin: streamer
[20:15:31]
*** Streamer Plugin v2.6.1 by Incognito loaded ***
[20:15:31] Loaded.
[20:15:31] Loading plugin: mysql
[20:15:32]
> MySQL plugin R6 successfully loaded.
[20:15:32] Loaded.
[20:15:32] Loading plugin: sscanf
[20:15:32]
[20:15:32] ===============================
[20:15:32] sscanf plugin loaded.
[20:15:32] Version: 2.8.1
[20:15:32] (c) 2012 Alex "Y_Less" Cole
[20:15:32] ===============================
[20:15:32] Loaded.
[20:15:32] Loading plugin: FileFunctions
[20:15:32] Loaded.
[20:15:32] Loaded 5 plugins.
[20:15:32]
[20:15:32] Ban list
[20:15:32] --------
[20:15:32] Loaded: samp.ban
[20:15:32]
[20:15:32]
[20:15:32] Filterscripts
[20:15:32] ---------------
[20:15:32] Loading filterscript 'pizda.amx'...
[20:15:32] Loaded 1 filterscripts.
[20:15:34] Статус подключения к MySql: успешно.
[20:15:42] Number of vehicle models: 64
[20:16:22] Incoming connection: 11.11.111.201:3189
[20:16:22] [join] LOL has joined the server (0:11.11.111.201)
[20:21:20] [debug] Run time error 4: "Array index out of bounds"
[20:21:20] [debug] Accessing element at negative index -400
[20:21:20] [debug] AMX backtrace:
[20:21:20] [debug] #0 00134540 in public UpdateSpeedometr (playerid=0) at C:\Documents and Settings\Admin\Рабочий стол\Advantage Rp\gamemodes\ARP.pwn:19914
[20:21:24] [chat] [LOL_LOL]: g
[20:23:15] 309 | 426
[20:23:15] 309 | 426
[20:23:15] 309 | 426
[20:23:16] 309 | 426
[20:23:16] 309 | 426
[20:23:16] 309 | 426
[20:23:16] 309 | 426
[20:23:17] 309 | 426
[20:23:17] 309 | 426
[20:23:17] 309 | 426
[20:23:17] 309 | 426
[20:23:17] 309 | 426
[20:23:18] 309 | 426
[20:23:18] 309 | 426
[20:23:18] 309 | 426
[20:23:18] 309 | 426
[20:23:19] 309 | 426
[20:23:19] 309 | 426
[20:23:19] 309 | 426
[20:23:19] 309 | 426
[20:23:19] 309 | 426
[20:23:20] 309 | 426
[20:23:20] 309 | 426
[20:23:20] 309 | 426
[20:23:20] 309 | 426
[20:23:21] 309 | 426
[20:23:21] 309 | 426
[20:23:21] 309 | 426
[20:23:21] 309 | 426
[20:23:22] 309 | 426
[20:23:22] 309 | 426
[20:23:22] 309 | 426
[20:23:22] 309 | 426
[20:23:23] 309 | 426
[20:23:23] 309 | 426
[20:23:23] 309 | 426
[20:23:23] 309 | 426
[20:23:24] 309 | 426
[20:23:24] 309 | 426
[20:23:24] 309 | 426
[20:23:24] 309 | 426
[20:23:24] 309 | 426
[20:23:25] 309 | 426
[20:23:25] 309 | 426
[20:23:25] 309 | 426
[20:23:25] 309 | 426
[20:23:26] 309 | 426
[20:23:26] 309 | 426
[20:23:26] 309 | 426
[20:23:26] 309 | 426
[20:23:27] 309 | 426
[20:23:27] 309 | 426
[20:23:27] 309 | 426
[20:23:27] 309 | 426
[20:23:27] 309 | 426
[20:23:28] 309 | 426
[20:23:28] 309 | 426
[20:23:28] 309 | 426
[20:23:28] 309 | 426
[20:23:29] 309 | 426
[20:23:29] 309 | 426
[20:23:29] 309 | 426
[20:23:29] 309 | 426
[20:23:29] 309 | 426
[20:23:30] 309 | 426
[20:23:30] 309 | 426
[20:23:30] 309 | 426
[20:23:30] 309 | 426
[20:23:31] 309 | 426
[20:23:31] 309 | 426
[20:23:31] 309 | 426
[20:23:31] 309 | 426
[20:23:32] 309 | 426
[20:23:32] 309 | 426
[20:23:32] 309 | 426
[20:23:32] 309 | 426
[20:23:32] 309 | 426
[20:23:33] 309 | 426
[20:23:33] 309 | 426
[20:23:33] 309 | 426
[20:23:33] 309 | 426
[20:23:34] 309 | 426
[20:23:34] 309 | 426
[20:23:34] 309 | 426
[20:23:34] 309 | 426
[20:23:34] 309 | 426
[20:23:35] 309 | 426
[20:23:35] 309 | 426
[20:23:35] 309 | 426
[20:23:35] 309 | 426
[20:23:36] 309 | 426
[20:23:36] 309 | 426
[20:23:36] 309 | 426
[20:23:36] 309 | 426
[20:23:36] 309 | 426
[20:23:37] 309 | 426
[20:23:37] 309 | 426
[20:23:37] 309 | 426
[20:23:37] 309 | 426
[20:23:38] 309 | 426
[20:23:38] 309 | 426
[20:23:38] 309 | 426
[20:23:38] 309 | 426
[20:23:38] 309 | 426
[20:23:39] 309 | 426
[20:23:39] 309 | 426
[20:23:39] 309 | 426
[20:23:39] 309 | 426
[20:23:40] 309 | 426
[20:23:40] 309 | 426
[20:23:40] 309 | 426
[20:23:40] 309 | 426
[20:23:41] 309 | 426
[20:23:41] 309 | 426
[20:23:41] 309 | 426
[20:23:41] 309 | 426
[20:23:41] 309 | 426
[20:23:42] 309 | 426
[20:23:42] 309 | 426
[20:23:42] 309 | 426
[20:23:42] 309 | 426
[20:23:43] 309 | 426
[20:23:43] 309 | 426
[20:23:43] 309 | 426
[20:23:43] 309 | 426
[20:23:43] 309 | 426
[20:23:44] 309 | 426
[20:23:44] 309 | 426
[20:23:44] 309 | 426
[20:23:44] 309 | 426
[20:23:45] 309 | 426
[20:23:45] 309 | 426
[20:23:45] 309 | 426
[20:23:45] 309 | 426
[20:23:46] 309 | 426
[20:23:46] 309 | 426
[20:23:46] 309 | 426
[20:23:46] 309 | 426
[20:23:46] 309 | 426
[20:23:47] 309 | 426
[20:23:47] 309 | 426
[20:23:47] 309 | 426
[20:23:47] 309 | 426
[20:23:48] 309 | 426
[20:23:48] 309 | 426
[20:23:48] 309 | 426
[20:23:48] 309 | 426
[20:23:49] 309 | 426
[20:23:49] 309 | 426
[20:23:49] 309 | 426
[20:23:49] 309 | 426
[20:23:50] 309 | 426
[20:23:50] 309 | 426
[20:23:50] 309 | 426
[20:23:50] 309 | 426
[20:23:50] 309 | 426
[20:23:51] 309 | 426
[20:23:51] 309 | 426
[20:23:51] 309 | 426
[20:23:51] 309 | 426
[20:23:52] 309 | 426
[20:23:52] 309 | 426
[20:23:52] 309 | 426
[20:23:52] 309 | 426
[20:23:53] 309 | 426
[20:23:53] 309 | 426
[20:23:53] 309 | 426
[20:23:53] 309 | 426
[20:23:53] 309 | 426
[20:23:54] 309 | 426
[20:23:54] 309 | 426
[20:23:54] 309 | 426
[20:23:54] 309 | 426
[20:23:55] 309 | 426
[20:23:55] 309 | 426
[20:23:55] 309 | 426
[20:23:55] 309 | 426
[20:23:56] 309 | 426
[20:23:56] 309 | 426
[20:23:56] 309 | 426
[20:23:56] 309 | 426
[20:23:56] 309 | 426
[20:23:57] 309 | 426
[20:23:57] 309 | 426
[20:23:57] 309 | 426
[20:23:57] 309 | 426
[20:23:58] 309 | 426
[20:23:58] 309 | 426
[20:23:58] 309 | 426
[20:23:58] 309 | 426
[20:23:59] 309 | 426
[20:23:59] 309 | 426
[20:23:59] 309 | 426
[20:23:59] 309 | 426
[20:23:59] 309 | 426
[20:24:00] 309 | 426
[20:24:00] 309 | 426
[20:24:00] 309 | 426
[20:24:00] 309 | 426
[20:24:01] 309 | 426
[20:24:01] 309 | 426
[20:24:01] 309 | 426
[20:24:01] 309 | 426
[20:24:01] 309 | 426
[20:24:02] 309 | 426
[20:24:02] 309 | 426
[20:24:02] 309 | 426
[20:24:02] 309 | 426
[20:24:03] 309 | 426
[20:24:03] 309 | 426
[20:24:03] 309 | 426
[20:24:03] 309 | 426
[20:24:04] 309 | 426
[20:24:04] 309 | 426
[20:24:04] 309 | 426
[20:24:04] 309 | 426
[20:24:04] 309 | 426
[20:24:05] 309 | 426
[20:24:05] 309 | 426
[20:24:05] 309 | 426
[20:24:05] 309 | 426
[20:24:06] 309 | 426
[20:24:06] 309 | 426
[20:24:06] 309 | 426
[20:24:06] 309 | 426
[20:24:07] 309 | 426
[20:24:07] 309 | 426
[20:24:07] 309 | 426
[20:24:07] 309 | 426
[20:24:07] 309 | 426
[20:24:08] 309 | 426
[20:24:08] 309 | 426
[20:24:08] 309 | 426
[20:24:08] 309 | 426
[20:24:09] 309 | 426
[20:24:09] 309 | 426
[20:24:09] 309 | 426
[20:24:09] 309 | 426
[20:24:10] 309 | 426
[20:24:10] 309 | 426
[20:24:10] 309 | 426
[20:24:10] 309 | 426
[20:24:10] 309 | 426
[20:24:11] 309 | 426
[20:24:11] 309 | 426
[20:24:11] 309 | 426
[20:24:11] 309 | 426
[20:24:12] 309 | 426
[20:24:12] 309 | 426
[20:24:12] 309 | 426
[20:24:12] 309 | 426
[20:24:13] 309 | 426
[20:24:13] 309 | 426
[20:24:13] 309 | 426
[20:24:13] 309 | 426
[20:24:14] 309 | 426
[20:24:14] 309 | 426
[20:24:14] 309 | 426
[20:24:14] 309 | 426
[20:24:15] 309 | 426
[20:24:15] 309 | 426
[20:24:15] 309 | 426
[20:24:15] 309 | 426
[20:24:16] 309 | 426
[20:24:16] 309 | 426
[20:24:16] 309 | 426
[20:24:16] 309 | 426
[20:24:17] 309 | 426
[20:24:17] 309 | 426
[20:24:17] 309 | 426
[20:24:17] 309 | 426
[20:24:18] 309 | 426
[20:24:18] 309 | 426
[20:24:18] 309 | 426
[20:24:18] 309 | 426
[20:24:18] 309 | 426
[20:24:19] 309 | 426
[20:24:19] 309 | 426
[20:24:19] 309 | 426
[20:24:19] 309 | 426
[20:24:20] 309 | 426
[20:24:20] 309 | 426
[20:24:20] 309 | 426
[20:24:20] 309 | 426
[20:24:21] 309 | 426
[20:24:21] 309 | 426
[20:24:21] 309 | 426
[20:24:21] 309 | 426
[20:24:22] 309 | 426
[20:24:22] 309 | 426
[20:24:22] 309 | 426
[20:24:22] 309 | 426
[20:24:22] 309 | 426
[20:24:23] 309 | 426
[20:24:23] 309 | 426
[20:24:23] 309 | 426
[20:24:23] 309 | 426
[20:24:24] 309 | 426
[20:24:24] 309 | 426
[20:24:24] 309 | 426
[20:24:24] 309 | 426
[20:24:25] 309 | 426
[20:24:25] 309 | 426
[20:24:25] 309 | 426
[20:24:25] 309 | 426
[20:24:25] 309 | 426
[20:24:26] 309 | 426
[20:24:26] 309 | 426
[20:24:26] 309 | 426
[20:24:26] 309 | 426
[20:24:27] 309 | 426
[20:24:27] 309 | 426
[20:24:27] 309 | 426
[20:24:27] 309 | 426
[20:24:28] 309 | 426
[20:24:28] 309 | 426
[20:24:28] 309 | 426
[20:24:28] 309 | 426
[20:24:29] 309 | 426
[20:24:29] 309 | 426
[20:24:29] 309 | 426
[20:24:29] 309 | 426
[20:24:29] 309 | 426
[20:24:30] 309 | 426
[20:24:30] 309 | 426
[20:24:30] 309 | 426
[20:24:30] 309 | 426
[20:24:31] 309 | 426
[20:24:31] 309 | 426
[20:24:31] 309 | 426
[20:24:31] 309 | 426
[20:24:31] 309 | 426
[20:24:32] 309 | 426
[20:24:32] 309 | 426
[20:24:32] 309 | 426
[20:24:32] 309 | 426
[20:24:33] 309 | 426
[20:24:33] 309 | 426
[20:24:33] 309 | 426
[20:24:33] 309 | 426
[20:24:34] 309 | 426
[20:24:34] 309 | 426
[20:24:34] 309 | 426
[20:24:34] 309 | 426
[20:24:34] 309 | 426
[20:24:35] 309 | 426
[20:24:35] 309 | 426
[20:24:35] 309 | 426
[20:24:35] 309 | 426
[20:24:36] 309 | 426
[20:24:36] 309 | 426
[20:24:36] 309 | 426
[20:24:36] 309 | 426
[20:24:37] 309 | 426
[20:24:37] 309 | 426
[20:24:37] 309 | 426
[20:24:37] 309 | 426
[20:24:37] 309 | 426
[20:24:38] 309 | 426
[20:24:38] 309 | 426
[20:24:38] 309 | 426
[20:24:38] 309 | 426
[20:24:39] 309 | 426
[20:24:39] 309 | 426
[20:24:39] 309 | 426
[20:24:39] 309 | 426
[20:24:39] 309 | 426
[20:24:40] 309 | 426
[20:24:40] 309 | 426
[20:24:40] 309 | 426
[20:24:40] 309 | 426
[20:24:41] 309 | 426
[20:24:41] 309 | 426
[20:24:41] 309 | 426
[20:24:41] 309 | 426
[20:24:41] 309 | 426
[20:24:42] 309 | 426
[20:24:42] 309 | 426
[20:24:42] 309 | 426
[20:24:42] 309 | 426
[20:24:43] 309 | 426
[20:24:43] 309 | 426
[20:24:43] 309 | 426
[20:24:43] 309 | 426
[20:24:43] 309 | 426
[20:24:44] 309 | 426
[20:24:44] 309 | 426
[20:24:44] 309 | 426
[20:24:44] 309 | 426
[20:24:45] 309 | 426
[20:24:45] 309 | 426
[20:24:45] 309 | 426
[20:24:45] 309 | 426
[20:24:46] 309 | 426
[20:24:46] 309 | 426
[20:24:46] 309 | 426
[20:24:46] 309 | 426
[20:24:46] 309 | 426
[20:24:47] 309 | 426
[20:24:47] 309 | 426
[20:24:47] 309 | 426
[20:24:47] 309 | 426
[20:24:48] 309 | 426
[20:24:48] 309 | 426
[20:24:48] 309 | 426
[20:24:48] 309 | 426
[20:24:48] 309 | 426
Странно... Скорее всего информация не успевает обновится... Сделай так:
public UpdateSpeedometr(playerid)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(!vehicleid) return true;
new strr[20];
format(strr,sizeof(strr),"SPEED:~g~ %i KM/H",SpeedVehicle(playerid));
TextDrawSetString(VehicleSpeedometr[playerid],strr);
format(strr,sizeof(strr),"FUEL:~g~ %i",Vehicle[vehicle][Fuel]);
TextDrawSetString(IndicatorVehicle2[playerid],strr);
if((strr[1] = GetVehicleModel(vehicleid)-400) > -1)
{
format(strr,sizeof(strr),"NAME:~r~ %s", VehicleNames[strr[1]); // строка 19891
TextDrawSetString(IndicatorVehicle4[playerid],strr);
}
format(strr, sizeof(strr),"ENGINE: %s", Vehicle[vehicle][Engine] == false ? ("~r~OFF") : ("~g~ON"));
TextDrawSetString(IndicatorVehicle3[playerid],strr);
format(strr, sizeof(strr),"STATUS: %s", Vehicle[vehicle][CarLock] == false ? ("~g~UNLOCK") : ("~r~LOCK"));
TextDrawSetString(IndicatorVehicle[playerid],strr);
return 0;
}
Powered by vBulletin® Version 4.2.0 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. Перевод: zCarot