Stefa
Новичок
Ув. пользователи pawno-info.
Помогите с ошибкой. Раньше такого не было а потом внезапно появилось.
[14:53:47] [debug] Run time error 4: "Array index out of bounds"
[14:53:47] [debug] Accessing element at index 31 past array upper bound 30
[14:53:47] [debug] AMX backtrace:
[14:53:47] [debug] #0 001107a4 in public LoadBizz () from lolmod.amx
[14:53:47] [V] Gang stores loaded
[14:53:47] [debug] Run time error 4: "Array index out of bounds"
[14:53:47] [debug] Accessing element at index 1266 past array upper bound 1265
[14:53:47] [debug] AMX backtrace:
[14:53:47] [debug] #0 0010e9a0 in public LoadProperty () from lolmod.amx
Вот publics: LoadProperty ()
А вот publics: LoadBizz():
Буду очень благодарен за помощь 
Помогите с ошибкой. Раньше такого не было а потом внезапно появилось.
[14:53:47] [debug] Run time error 4: "Array index out of bounds"
[14:53:47] [debug] Accessing element at index 31 past array upper bound 30
[14:53:47] [debug] AMX backtrace:
[14:53:47] [debug] #0 001107a4 in public LoadBizz () from lolmod.amx
[14:53:47] [V] Gang stores loaded
[14:53:47] [debug] Run time error 4: "Array index out of bounds"
[14:53:47] [debug] Accessing element at index 1266 past array upper bound 1265
[14:53:47] [debug] AMX backtrace:
[14:53:47] [debug] #0 0010e9a0 in public LoadProperty () from lolmod.amx
Вот publics: LoadProperty ()
PHP:
publics: LoadProperty()
{
static rows, fields;
cache_get_data(rows, fields);
new temp[64],i=0;
if(rows)
{
for(new he = 0;he < rows; he++)
{
cache_get_row(he, 0, temp), HouseInfo[he][hID] = strval(temp);
cache_get_row(he, 1, temp), HouseInfo[he][hEntrancex] = floatstr(temp);
cache_get_row(he, 2, temp), HouseInfo[he][hEntrancey] = floatstr(temp);
cache_get_row(he, 3, temp), HouseInfo[he][hEntrancez] = floatstr(temp);
cache_get_row(he, 4, temp), HouseInfo[he][hExitx] = floatstr(temp);
cache_get_row(he, 5, temp), HouseInfo[he][hExity] = floatstr(temp);
cache_get_row(he, 6, temp), HouseInfo[he][hExitz] = floatstr(temp);
cache_get_row(he, 7, temp), strmid(HouseInfo[he][hOwner], temp, 0, strlen(temp), 255);
cache_get_row(he, 8, temp), HouseInfo[he][hValue] = strval(temp);
cache_get_row(he, 9, temp), HouseInfo[he][hHel] = strval(temp);
cache_get_row(he, 10, temp), HouseInfo[he][hInt] = strval(temp);
cache_get_row(he, 11, temp), HouseInfo[he][hLock] = strval(temp);
cache_get_row(he, 12, temp), HouseInfo[he][hOwned] = strval(temp);
cache_get_row(he, 13, temp), HouseInfo[he][hTakings] = strval(temp);
cache_get_row(he, 14, temp), HouseInfo[he][hVec] = strval(temp);
cache_get_row(he, 15, temp), HouseInfo[he][hVcol1] = strval(temp);
cache_get_row(he, 16, temp), HouseInfo[he][hVcol2] = strval(temp);
cache_get_row(he, 17, temp), HouseInfo[he][hKlass] = strval(temp);
cache_get_row(he, 18, temp), HouseInfo[he][hVehSost] = strval(temp);
cache_get_row(he, 19, temp), HouseInfo[he][hCarx] = floatstr(temp);
cache_get_row(he, 20, temp), HouseInfo[he][hCary] = floatstr(temp);
cache_get_row(he, 21, temp), HouseInfo[he][hCarz] = floatstr(temp);
cache_get_row(he, 22, temp), HouseInfo[he][hCarc] = floatstr(temp);
cache_get_row(he, 23, temp), HouseInfo[he][hMats] = strval(temp);
cache_get_row(he, 24, temp), HouseInfo[he][hStyle] = strval(temp);
cache_get_row(he, 25, temp), HouseInfo[he][hSost] = strval(temp);
i++;
if(HouseInfo[he][hOwned] == 0)
{
HouseInfo[he][hPickup] = CreatePickup(1273, 23, HouseInfo[he][hEntrancex], HouseInfo[he][hEntrancey], HouseInfo[he][hEntrancez],-1);
HouseInfo[he][hMIcon] = CreateDynamicMapIcon(HouseInfo[he][hEntrancex], HouseInfo[he][hEntrancey], HouseInfo[he][hEntrancez], 31, COLOR_WHITE, 0, -1, -1, 50.0);
}
if(HouseInfo[he][hOwned] == 1)
{
HouseInfo[he][hPickup] = CreatePickup(1272, 23, HouseInfo[he][hEntrancex], HouseInfo[he][hEntrancey], HouseInfo[he][hEntrancez],-1);
HouseInfo[he][hMIcon] = CreateDynamicMapIcon(HouseInfo[he][hEntrancex], HouseInfo[he][hEntrancey], HouseInfo[he][hEntrancez], 32, COLOR_WHITE, 0, -1, -1, 50.0);
}
}
printf("[V] Loaded %d houses",i);
}
else printf("[X] Houses not loaded");
return true;
}
PHP:
publics: LoadBizz()
{
static rows, fields;
cache_get_data(rows, fields);
new temp[64],string2[256],i=0;
if(rows)
{
for(new he = 0;he < rows; he++)
{
cache_get_row(he, 0, temp), BizzInfo[he][bID] = strval(temp);
cache_get_row(he, 1, temp), BizzInfo[he][bOwned] = strval(temp);
cache_get_row(he, 2, temp), strmid(BizzInfo[he][bOwner], temp, 0, strlen(temp), 255);
cache_get_row(he, 3, temp), strmid(BizzInfo[he][bMessage], temp, 0, strlen(temp), 255);
cache_get_row(he, 4, temp), strmid(BizzInfo[he][bExtortion], temp, 0, strlen(temp), 255);
cache_get_row(he, 5, temp), BizzInfo[he][bEntranceX] = floatstr(temp);
cache_get_row(he, 6, temp), BizzInfo[he][bEntranceY] = floatstr(temp);
cache_get_row(he, 7, temp), BizzInfo[he][bEntranceZ] = floatstr(temp);
cache_get_row(he, 8, temp), BizzInfo[he][bExitX] = floatstr(temp);
cache_get_row(he, 9, temp), BizzInfo[he][bExitY] = floatstr(temp);
cache_get_row(he, 10, temp), BizzInfo[he][bExitZ] = floatstr(temp);
cache_get_row(he, 11, temp), BizzInfo[he][bBuyPrice] = strval(temp);
cache_get_row(he, 12, temp), BizzInfo[he][bEntranceCost] = strval(temp);
cache_get_row(he, 13, temp), BizzInfo[he][bTill] = strval(temp);
cache_get_row(he, 14, temp), BizzInfo[he][bLocked] = strval(temp);
cache_get_row(he, 15, temp), BizzInfo[he][bInterior] = strval(temp);
cache_get_row(he, 16, temp), BizzInfo[he][bProducts] = strval(temp);
cache_get_row(he, 17, temp), BizzInfo[he][bMaxProducts] = strval(temp);
cache_get_row(he, 18, temp), BizzInfo[he][bPriceProd] = strval(temp);
cache_get_row(he, 19, temp), BizzInfo[he][b2Till] = strval(temp);
cache_get_row(he, 20, temp), BizzInfo[he][bCena] = strval(temp);
cache_get_row(he, 21, temp), BizzInfo[he][bBarX] = floatstr(temp);
cache_get_row(he, 22, temp), BizzInfo[he][bBarY] = floatstr(temp);
cache_get_row(he, 23, temp), BizzInfo[he][bBarZ] = floatstr(temp);
cache_get_row(he, 24, temp), BizzInfo[he][bMafia] = strval(temp);
cache_get_row(he, 25, temp), BizzInfo[he][bVirtual] = strval(temp);
cache_get_row(he, 26, temp), BizzInfo[he][bType] = strval(temp);
i++;
new typeofbiz[128];
new bicon;
if(BizzInfo[he][bType] == 1) format(typeofbiz, sizeof(typeofbiz), "{FFA500}Клуб \"%s\"", BizzInfo[he][bMessage]), bicon = 48;
else if(BizzInfo[he][bType] == 2) format(typeofbiz, sizeof(typeofbiz), "{FFA500}Бар \"%s\"", BizzInfo[he][bMessage]), bicon = 49;
else if(BizzInfo[he][bType] == 3) format(typeofbiz, sizeof(typeofbiz), "{FFA500}Магазин 24/7"), bicon = 17;
else if(BizzInfo[he][bType] == 4) format(typeofbiz, sizeof(typeofbiz), "{FFA500}Магазин игрушек"), bicon = 44;
else if(BizzInfo[he][bType] == 5) format(typeofbiz, sizeof(typeofbiz), "{FFA500}Закусочная \"%s\"", BizzInfo[he][bMessage]), bicon = 10;
else if(BizzInfo[he][bType] == 6) format(typeofbiz, sizeof(typeofbiz), "{FFA500}Ресторан"), bicon = 50;
//
if(BizzInfo[he][bOwned] == 0)
{
format(string2, sizeof(string2), "%s\n{FFFF00}Бизнес продается\n{00FF00}Цена: %d$",typeofbiz,BizzInfo[he][bBuyPrice]);
BizzInfo[he][bLocked] = 1;
BizzInfo[he][bLabel] = Create3DTextLabel(string2,COLOR_YELLOW,BizzInfo[he][bEntranceX], BizzInfo[he][bEntranceY], BizzInfo[he][bEntranceZ],20.0,0,1);
BizzInfo[he][bPickupV] = AddStaticPickup(19132, 23, BizzInfo[he][bEntranceX], BizzInfo[he][bEntranceY], BizzInfo[he][bEntranceZ]);
BizzInfo[he][bPickupE] = AddStaticPickup(1318, 23, BizzInfo[he][bExitX], BizzInfo[he][bExitY], BizzInfo[he][bExitZ], BizzInfo[he][bVirtual]);
}
else if(BizzInfo[he][bOwned] == 1)
{
if(BizzInfo[he][bLocked] == 0) format(string2,sizeof(string2), "%s\n{FFFFFF}Владелец: {00FF00}%s\n{FF4500}Закрыто",typeofbiz, BizzInfo[he][bOwner]);
else if(BizzInfo[he][bEntranceCost] != 0) format(string2,sizeof(string2), "%s\n{FFFFFF}Владелец: {00FF00}%s\n{FF4500}Плата за вход: %d$",typeofbiz, BizzInfo[he][bOwner], BizzInfo[he][bEntranceCost]);
else format(string2,sizeof(string2), "%s\n{FFFFFF}Владелец: {00FF00}%s",typeofbiz, BizzInfo[he][bOwner]);
BizzInfo[he][bLabel] = Create3DTextLabel(string2,TEAM_GROVE_COLOR,BizzInfo[he][bEntranceX], BizzInfo[he][bEntranceY], BizzInfo[he][bEntranceZ],20.0,0,1);
BizzInfo[he][bPickupV] = AddStaticPickup(19132, 23, BizzInfo[he][bEntranceX], BizzInfo[he][bEntranceY], BizzInfo[he][bEntranceZ]);
BizzInfo[he][bPickupE] = AddStaticPickup(1318, 23, BizzInfo[he][bExitX], BizzInfo[he][bExitY], BizzInfo[he][bExitZ], BizzInfo[he][bVirtual]);
}
else
{
BizzInfo[he][bOwned] = 1;
if(BizzInfo[he][bLocked] == 0) format(string2,sizeof(string2), "%s\n{FFFFFF}Владелец: {00FF00}%s\n{FF4500}Закрыто",typeofbiz, BizzInfo[he][bOwner]);
else if(BizzInfo[he][bEntranceCost] != 0) format(string2,sizeof(string2), "%s\n{FFFFFF}Владелец: {00FF00}%s\n{FF4500}Плата за вход: %d$",typeofbiz, BizzInfo[he][bOwner], BizzInfo[he][bEntranceCost]);
else format(string2,sizeof(string2), "%s\n{FFFFFF}Владелец: {00FF00}%s",typeofbiz, BizzInfo[he][bOwner]);
BizzInfo[he][bLabel] = Create3DTextLabel(string2,TEAM_GROVE_COLOR,BizzInfo[he][bEntranceX], BizzInfo[he][bEntranceY], BizzInfo[he][bEntranceZ],20.0,0,1);
BizzInfo[he][bPickupV] = AddStaticPickup(19132, 23, BizzInfo[he][bEntranceX], BizzInfo[he][bEntranceY], BizzInfo[he][bEntranceZ]);
BizzInfo[he][bPickupE] = AddStaticPickup(1318, 23, BizzInfo[he][bExitX], BizzInfo[he][bExitY], BizzInfo[he][bExitZ], BizzInfo[he][bVirtual]);
}
BizzInfo[he][bMIcon] = CreateDynamicMapIcon(BizzInfo[he][bEntranceX], BizzInfo[he][bEntranceY], BizzInfo[he][bEntranceZ], bicon, COLOR_WHITE, 0, -1, -1, 50.0);
}
printf("[V] %d businesses loaded",i);
}
else printf("[X] Businesses not loaded");
return true;
}
