Fast_Stone
Умник
Server log :
Помогите исправить.
---------- Сообщение добавлено в 20:50 ---------- Предыдущее сообщение добавлено в 20:07 ----------
LoadBizz:
LoadSBizz:
PHP:
[17:43:26] [debug] Run time error 4: "Array index out of bounds"
[17:43:26] [debug] Accessing element at index 30 past array upper bound 29
[17:43:26] [debug] AMX backtrace:
[17:43:26] [debug] #0 000dc354 in public LoadSBizz () HeadLine.amx
[17:43:26] [debug] Run time error 4: "Array index out of bounds"
[17:43:26] [debug] Accessing element at index 16 past array upper bound 15
[17:43:26] [debug] AMX backtrace:
[17:43:26] [debug] #0 000d91bc in public LoadBizz () from HeadLine.amx
---------- Сообщение добавлено в 20:50 ---------- Предыдущее сообщение добавлено в 20:07 ----------
LoadBizz:
PHP:
publics: LoadBizz()
{
static rows, fields;
cache_get_data(rows, fields);
new temp[64],string2[300],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);
i++;
if(BizzInfo[he][bOwned] == 0)
{
format(string2, sizeof(string2), "{00FF32}Цена:{FEFEFE} %d\n{F5FF00}Бизнес продаётся",BizzInfo[he][bBuyPrice]);
BizzInfo[he][bLocked] = 1;
Create3DTextLabel("~~~~~~~~~~~~~~~~~\nИспользуте команду\nв данном месте\n~~~~~~~~~~~~~~~~~",COLOR_YELLOW,BizzInfo[he][bBarX],BizzInfo[he][bBarY],BizzInfo[he][bBarZ],20.0,0,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)
{
format(string2,sizeof(string2), "{F0F0F0}%s\nВладелец:\n {00A5FF}%s", BizzInfo[he][bMessage], 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;
format(string2,sizeof(string2), "{F0F0F0}%s\nВладелец:\n {00A5FF}%s", BizzInfo[he][bMessage], 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]);
}
}
printf("[Загрузкa] \tLoadBizz\t\t|\tЗагружено %d",i);
}
else printf("Бизнесов не загружены.");
return true;
}
LoadSBizz:
PHP:
publics: LoadSBizz()
{
static rows, fields;
cache_get_data(rows, fields);
new temp[64],string2[360],i=0;
if(rows)
{
for(new he = 0;he < rows; he++)
{
cache_get_row(he, 0, temp), SBizzInfo[he][sID] = strval(temp);
cache_get_row(he, 1, temp), SBizzInfo[he][sOwned] = strval(temp);
cache_get_row(he, 2, temp), strmid(SBizzInfo[he][sOwner], temp, 0, strlen(temp), 255);
cache_get_row(he, 3, temp), strmid(SBizzInfo[he][sMessage], temp, 0, strlen(temp), 255);
cache_get_row(he, 4, temp), SBizzInfo[he][sEntranceX] = floatstr(temp);
cache_get_row(he, 5, temp), SBizzInfo[he][sEntranceY] = floatstr(temp);
cache_get_row(he, 6, temp), SBizzInfo[he][sEntranceZ] = floatstr(temp);
cache_get_row(he, 7, temp), SBizzInfo[he][sBuyPrice] = strval(temp);
cache_get_row(he, 8, temp), SBizzInfo[he][sLocked] = strval(temp);
cache_get_row(he, 9, temp), SBizzInfo[he][sPrice] = strval(temp);
cache_get_row(he, 10, temp), SBizzInfo[he][sBenz] = strval(temp);
cache_get_row(he, 11, temp), SBizzInfo[he][sPriceBenz] = strval(temp);
cache_get_row(he, 11, temp), SBizzInfo[he][sTill] = strval(temp);
i++;
if(SBizzInfo[he][sOwned] == 0)
{
//
SBizzInfo[he][sBuyPrice] = 1000000;
SBizzInfo[he][sOwned] = 0;
SBizzInfo[he][sLocked] = 1;
SBizzInfo[he][sPrice] = 2500;
SBizzInfo[he][sBenz] = 2500;
SBizzInfo[he][sPriceBenz] = 2500;
SBizzInfo[he][sTill] = 100000;
//
format(string2, sizeof(string2), "[id %d]\n\nзаправка\n''%s''\nпродается\n\nцена %d вирт\n\n[введите /buyfuel для покупки]",SBizzInfo[he][sID],SBizzInfo[he][sMessage],SBizzInfo[he][sBuyPrice]);
}
else
{
if(SBizzInfo[he][sLocked] == 0) format(string2, sizeof(string2), "{FFFF00}%s\n{FFFFFF}Владелец: {32CD32}%s\nБензин: %d/10000\nСтоимость: %d вирт.\n\n{FFFFFF}[{32CD32}Заправка работает{FFFFFF}]",SBizzInfo[he][sMessage],SBizzInfo[he][sOwner],SBizzInfo[he][sBenz],SBizzInfo[he][sPriceBenz]);
else format(string2, sizeof(string2), "{FFFF00}%s\n{FFFFFF}Владелец: {32CD32}%s\nБензин: %d/10000\nСтоимость: %d вирт.\n\n{FFFFFF}[{FF0000}Заправка не работает{FFFFFF}]",SBizzInfo[he][sMessage],SBizzInfo[he][sOwner],SBizzInfo[he][sBenz],SBizzInfo[he][sPriceBenz]);
}
SBizzInfo[he][sLabel] = Create3DTextLabel(string2,COLOR_YELLOW,SBizzInfo[he][sEntranceX], SBizzInfo[he][sEntranceY], SBizzInfo[he][sEntranceZ],20.0,0,1);
SBizzInfo[he][sIcon] = CreateDynamicMapIcon(SBizzInfo[he][sEntranceX], SBizzInfo[he][sEntranceY], SBizzInfo[he][sEntranceZ], 42, COLOR_WHITE, 0, -1, -1, 50.0);
}
printf("===============================================================================");
printf("[Загрузкa]\tLoadSBizz\t\t|\tЗагружено %d",i);
}
else printf("сБизнесов не загружены.");
return true;
}
