Miguel Carter
Ученик
Доброго времени суток ребят помогите пожалуйста с проблемой
Код .pwn
Старый код до переписи на MYSQL R41-4
PHP:
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 20 in array of size 20
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2ba8 in public LoadRoutesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8488
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 20 in array of size 20
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2ad8 in public LoadRoutesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8485
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 30 in array of size 30
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2138 in public LoadRacesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8451
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 30 in array of size 30
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2084 in public LoadRacesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8448
PHP:
----------
Loaded log file: "server_log.txt".
----------
SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team
[02:29:58] filterscripts = "" (string)
[02:29:58]
[02:29:58] Server Plugins
[02:29:58] --------------
[02:29:58] Loading plugin: crashdetect.dll
[02:29:58] CrashDetect plugin 4.19
[02:29:58] Loaded.
[02:29:58] Loading plugin: streamer.dll
[02:29:58]
*** Streamer Plugin v2.9.3 by Incognito loaded ***
[02:29:58] Loaded.
[02:29:58] Loading plugin: sscanf.dll
[02:29:58]
[02:29:58] ===============================
[02:29:58] sscanf plugin loaded.
[02:29:58] Version: 2.8.2
[02:29:58] (c) 2012 Alex "Y_Less" Cole
[02:29:58] ===============================
[02:29:58] Loaded.
[02:29:58] Loading plugin: mysql.dll
[02:29:58] >> plugin.mysql: R41-4 successfully loaded.
[02:29:58] Loaded.
[02:29:58] Loading plugin: dc_cmd.dll
[02:29:58] Daniel's CMD plugin v2.8
[02:29:58] (c) 2014 Daniel_Cortez
[02:29:58] www.*********.ru
[02:29:58] Loaded.
[02:29:58] Loaded 5 plugins.
[02:29:58]
[02:29:58] Filterscripts
[02:29:58] ---------------
[02:29:58] Loaded 0 filterscripts.
[02:29:58]
[02:29:58] --------------------------------------
[02:29:58] Античит Nex-AC загружен!
[02:29:58] Версия античита: 1.9.6
[02:29:58] Автор: Nexius
[02:29:58] --------------------------------------
[02:29:58]
[02:29:58]
[02:29:58]
[02:29:58] =======================================
[02:29:58] | |
[02:29:58] | YSI version 3.09.0684 |
[02:29:58] | By Alex "Y_Less" Cole |
[02:29:58] | |
[02:29:58] =======================================
[02:29:58]
[02:29:58] MapFix by Nexius v2.5.8 loaded.
[02:29:58] [R41-4]: Подключение к базе успешно.
[02:29:58] Number of vehicle models: 47
[02:29:58] [R41-4][0001МС]: Загружено ''остальное''.
[02:29:58] [R41-4][0000МС]: Загружено ''Пикапы мэрии''.
[02:29:59] [R41-4][0171МС]: Загружено домов: 0999.
[02:29:59] [R41-4][0001МС]: Загружено отелей: 0016.
[02:29:59] [R41-4][0019МС]: Загружено бизнесов: 0106.
[02:29:59] [R41-4][WARNING]: Дом. автомобили не найдены.
[02:29:59] [R41-4][0001МС]: Загружено маршрутов: 0009.
[02:29:59] [R41-4][0001МС]: Загружено гонок: 0013.
[02:29:59] [R41-4][0015МС]: Загружено входов/выходов: 0155.
[02:29:59] [R41-4][0006МС]: Загружено гангзон: 0141.
[02:29:59] [R41-4][0000МС]: Загружено мафий: 0004.
[02:29:59] [R41-4][0002МС]: Загружено GPS: 0064.
[02:29:59] [R41-4][0004МС]: Загружено банкоматов: 0073.
[02:29:59] [R41-4][0004МС]: Загружено фракций: 0029.
[02:29:59] [R41-4][WARNING]: Надписей не найдено.
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 20 in array of size 20
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2ba8 in public LoadRoutesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8488
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 20 in array of size 20
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2ad8 in public LoadRoutesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8485
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 20 in array of size 20
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2ad8 in public LoadRoutesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8485
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 20 in array of size 20
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2ad8 in public LoadRoutesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8485
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 20 in array of size 20
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2ad8 in public LoadRoutesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8485
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 20 in array of size 20
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2ad8 in public LoadRoutesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8485
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 20 in array of size 20
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2ad8 in public LoadRoutesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8485
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 20 in array of size 20
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2ad8 in public LoadRoutesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8485
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 20 in array of size 20
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2ad8 in public LoadRoutesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8485
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 30 in array of size 30
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2138 in public LoadRacesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8451
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 30 in array of size 30
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2084 in public LoadRacesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8448
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 30 in array of size 30
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2084 in public LoadRacesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8448
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 30 in array of size 30
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2084 in public LoadRacesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8448
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 30 in array of size 30
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2084 in public LoadRacesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8448
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 30 in array of size 30
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2084 in public LoadRacesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8448
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 30 in array of size 30
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2084 in public LoadRacesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8448
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 30 in array of size 30
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2084 in public LoadRacesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8448
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 30 in array of size 30
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2084 in public LoadRacesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8448
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 30 in array of size 30
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2084 in public LoadRacesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8448
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 30 in array of size 30
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2084 in public LoadRacesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8448
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 30 in array of size 30
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2084 in public LoadRacesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8448
[02:29:59] [debug] Run time error 4: "Array index out of bounds"
[02:29:59] [debug] Attempted to read/write array element at index 30 in array of size 30
[02:29:59] [debug] AMX backtrace:
[02:29:59] [debug] #0 000b2084 in public LoadRacesDB () at C:\Users\mazilaslg\Desktop\cw-rp.ru\gamemodes\newmode3.pwn:8448
Код .pwn
ache_get_value_name_float(idx, "PX", RoutePoint[TOTALROUTEPOINT][rPosX][idx]); //8488
Routes[TOTALROUTEPOINT][rEnd] = r - 1; //8485
cache_get_value_name_float(idx, "PX", RacePoint[TOTALRACEPOINT][raPosX][idx]); //8451
endCheck[TOTALRACEPOINT] = r - 1; //8448
Routes[TOTALROUTEPOINT][rEnd] = r - 1; //8485
PHP:
void LoadRoutesDB()
{
new time = GetTickCount(), r;
cache_get_row_count(r);
if(!r) return print("["SQL_VER"][WARNING]: Ìàðøðóòû íå íàéäåíû.");
Routes[TOTALROUTEPOINT][rEnd] = r - 1; //8485
for(new idx; idx < r; idx++)
{
cache_get_value_name_float(idx, "PX", RoutePoint[TOTALROUTEPOINT][rPosX][idx]); //8488
cache_get_value_name_float(idx, "PY", RoutePoint[TOTALROUTEPOINT][rPosY][idx]);
cache_get_value_name_float(idx, "PZ", RoutePoint[TOTALROUTEPOINT][rPosZ][idx]);
cache_get_value_name_int(idx, "POst", RoutePoint[TOTALROUTEPOINT][rOst][idx]);
TOTALROUTEPOINT++;
}
printf("["SQL_VER"][%04dÌÑ]: Çàãðóæåíî òî÷åê ìàðøðóòîâ: %04d.", GetTickCount() - time, r);
return 1;
}
void LoadRaces() // Ãîíêè
{
new time = GetTickCount(), r;
cache_get_row_count(r);
if(!r) return print("["SQL_VER"][WARNING]: Ãîíêè íå íàéäåíû.");
for(new idx; idx < r; idx++)
{
cache_get_value_name_int(idx, "RId", Races[idx][raID]);
cache_get_value_name(idx, "RName", Races[idx][raName], 32);
cache_get_value_name_float(idx, "RStartX", Races[idx][raStartPosX]);
cache_get_value_name_float(idx, "RStartY", Races[idx][raStartPosY]);
cache_get_value_name_float(idx, "RStartZ", Races[idx][raStartPosZ]);
cache_get_value_name_float(idx, "RStartAngle", Races[idx][raStartPosAngle]);
m_f(query, "SELECT * FROM racespoints WHERE `RId` = %d", Races[idx][raID]);
m_tq(query, "LoadRacesDB");
TOTALRACES++;
}
printf("["SQL_VER"][%04dÌÑ]: Çàãðóæåíî ãîíîê: %04d.", GetTickCount() - time, r);
return 1;
}
endCheck[TOTALRACEPOINT] = r - 1; //8448
PHP:
void LoadRacesDB()
{
new time = GetTickCount(), r;
cache_get_row_count(r);
if(!r) print("["SQL_VER"][WARNING]: Ìàðøðóò íå íàéäåí.");
endCheck[TOTALRACEPOINT] = r - 1; //8448
for(new idx; idx < r; idx++)
{
cache_get_value_name_float(idx, "PX", RacePoint[TOTALRACEPOINT][raPosX][idx]); //8451
cache_get_value_name_float(idx, "PY", RacePoint[TOTALRACEPOINT][raPosY][idx]);
cache_get_value_name_float(idx, "PZ", RacePoint[TOTALRACEPOINT][raPosZ][idx]);
cache_get_value_name_int(idx, "PInt", RacePoint[TOTALRACEPOINT][raInterior][idx]);
TOTALRACEPOINT++;
}
printf("["SQL_VER"][%04dÌÑ]: Çàãðóæåíî òî÷åê ãîíîê: %04d.", GetTickCount() - time, r);
return 1;
}
void LoadRoutes() // Ìàðøðóòû
{
new time = GetTickCount(), r;
cache_get_row_count(r);
if(!r) return print("["SQL_VER"][WARNING]: Ìàðøðóòû íå íàéäåíû.");
for(new idx; idx < r; idx++)
{
cache_get_value_name_int(idx, "RId", Routes[idx][rID]);
cache_get_value_name(idx, "RName", Routes[idx][rName], 64);
cache_get_value_name_float(idx, "RStartX", Routes[idx][rStartPosX]);
cache_get_value_name_float(idx, "RStartY", Routes[idx][rStartPosY]);
cache_get_value_name_float(idx, "RStartZ", Routes[idx][rStartPosZ]);
cache_get_value_name_float(idx, "RStartAngle", Routes[idx][rStartPosAngle]);
m_f(query, "SELECT * FROM routepoints WHERE `RId` = %d", Routes[idx][rID]);
m_tq(query, "LoadRoutesDB");
TOTALROUTES++;
}
printf("["SQL_VER"][%04dÌÑ]: Çàãðóæåíî ìàðøðóòîâ: %04d.", GetTickCount() - time, r);
return 1;
}
Старый код до переписи на MYSQL R41-4
PHP:
forward LoadRacesDB();
public LoadRacesDB()
{
new time = GetTickCount();
new rows, fields;
cache_get_data(rows, fields);
if(rows)
{
endCheck[TOTALRACEPOINT] = rows - 1;
for(new b; b<rows; b++)
{
RacePoint[TOTALRACEPOINT][raPosX][b] = cache_get_row_float(b, 0);
RacePoint[TOTALRACEPOINT][raPosY][b] = cache_get_row_float(b, 1);
RacePoint[TOTALRACEPOINT][raPosZ][b] = cache_get_row_float(b, 2);
RacePoint[TOTALRACEPOINT][raInterior][b] = cache_get_row_int(b, 3);
//RoutePoint[TOTALRACEPOINT][raOst][b] = cache_get_row_int(b, 3);
//printf("%d (%d) : %f , %f , %f", TOTALROUTEPOINT, Routes[TOTALROUTEPOINT][rEnd], RoutePoint[TOTALROUTEPOINT][rPosX][b],RoutePoint[TOTALROUTEPOINT][rPosY][b],RoutePoint[TOTALROUTEPOINT][rPosZ][b]);
}
TOTALRACEPOINT++;
}
printf(" [Çàãðóçêà òî÷åê ãîíîê]: Áûëî çàãðóæåíî - %d ïîòðà÷åíî %d (ms)", rows,GetTickCount() - time);
return 1;
}
LoadRaces() // Ãîíêè
{
new time = GetTickCount();
new Cache:result = mysql_query(dbHandle, "SELECT `RName`, `RStartX`, `RStartY`, `RStartZ`, `RStartAngle`, `RId` FROM `racesinfo`");
new rows, fields;
cache_get_data(rows, fields);
for(new i; i<rows; i++)
{
new rname[32];
cache_get_row(i, 0, rname);
Races[i][raName] = rname;
Races[i][raStartPosX] = cache_get_row_float(i,1);
Races[i][raStartPosY] = cache_get_row_float(i,2);
Races[i][raStartPosZ] = cache_get_row_float(i,3);
Races[i][raStartPosAngle] = cache_get_row_float(i,4);
format(query, sizeof(query), "SELECT `PX`, `PY`, `PZ`, `PInt` FROM racespoints WHERE `RId` = %d", cache_get_row_int(i,5));
mysql_function_query(dbHandle, query, true, "LoadRacesDB", "");
TOTALRACES++;
}
cache_delete(result);
printf(" [Çàãðóçêà ãîíîê]: Áûëî çàãðóæåíî - %d ïîòðà÷åíî %d (ms)", TOTALRACES,GetTickCount() - time);
return 1;
}
PHP:
forward LoadRoutesDB();
public LoadRoutesDB()
{
new time = GetTickCount();
new rows, fields;
cache_get_data(rows, fields);
if(rows)
{
Routes[TOTALROUTEPOINT][rEnd] = rows - 1;
for(new b; b<rows; b++)
{
RoutePoint[TOTALROUTEPOINT][rPosX][b] = cache_get_row_float(b, 0);
RoutePoint[TOTALROUTEPOINT][rPosY][b] = cache_get_row_float(b, 1);
RoutePoint[TOTALROUTEPOINT][rPosZ][b] = cache_get_row_float(b, 2);
RoutePoint[TOTALROUTEPOINT][rOst][b] = cache_get_row_int(b, 3);
//printf("%d (%d) : %f , %f , %f", TOTALROUTEPOINT, Routes[TOTALROUTEPOINT][rEnd], RoutePoint[TOTALROUTEPOINT][rPosX][b],RoutePoint[TOTALROUTEPOINT][rPosY][b],RoutePoint[TOTALROUTEPOINT][rPosZ][b]);
}
TOTALROUTEPOINT++;
}
printf(" [Çàãðóçêà òî÷åê ìàðøðóòîâ]: Áûëî çàãðóæåíî - %d ïîòðà÷åíî %d (ms)", rows,GetTickCount() - time);
return 1;
}
LoadRoutes() // Ìàðøðóòû
{
new time = GetTickCount();
new Cache:result = mysql_query(dbHandle, "SELECT `RName`, `RStartX`, `RStartY`, `RStartZ`, `RStartAngle`, `RId` FROM `routeinfo`");
new rows, fields;
cache_get_data(rows, fields);
for(new i; i<rows; i++)
{
new rname[64];
cache_get_row(i, 0, rname);
Routes[i][rName] = rname;
Routes[i][rStartPosX] = cache_get_row_float(i,1);
Routes[i][rStartPosY] = cache_get_row_float(i,2);
Routes[i][rStartPosZ] = cache_get_row_float(i,3);
Routes[i][rStartPosAngle] = cache_get_row_float(i,4);
format(query, sizeof(query), "SELECT `PX`, `PY`, `PZ`, `POst` FROM routepoints WHERE `RId` = %d", cache_get_row_int(i,5));
mysql_function_query(dbHandle, query, true, "LoadRoutesDB", "");
TOTALROUTES++;
}
cache_delete(result);
printf(" [Çàãðóçêà ìàðøðóòîâ]: Áûëî çàãðóæåíî - %d ïîòðà÷åíî %d (ms)", TOTALROUTES,GetTickCount() - time);
return 1;
}
Последнее редактирование:
