11.09.2017, 06:48
This is an error message from server.log
Here is the error code
Who helped me fix, I thank you very much!
PHP код:
[12:34:03] [debug] Run time error 4: "Array index out of bounds"
[12:34:03] [debug] Attempted to read/write array element at index 6 in array of size 6
[12:34:03] [debug] AMX backtrace:
[12:34:03] [debug] #0 006a26a8 in public S@@_OnDialogResponse (playerid=0, dialogid=3919, response=1, listitem=-1, inputtext[]=@01b38ba4 "500") at ./includes/LS-PRO.pwn:126647
[12:34:06] [part] Anh_Tuan has left the server (0:1)
PHP код:
else if(dialogid == DIALOG_RESTAURANT2)
{
if(PlayerInfo[playerid][pBusiness] != GetPVarInt(playerid, "EditingBusiness") || (GetPVarInt(playerid, "EditingBusiness") != InBusiness(playerid)) || PlayerInfo[playerid][pBusinessRank] != 5)
{
DeletePVar(playerid, "EditingStoreItem");
DeletePVar(playerid, "EditingBusiness");
return 1;
}
new business = PlayerInfo[playerid][pBusiness];
if (response)
{
new price = strval(inputtext), item = GetPVarInt(playerid, "EditingStoreItem");
if (price < 0 || price > 500000)
{
format(string, sizeof(string), "{FF0000}Error: {DDDDDD}Gia vuot qua pham vi{FFFFFF}\n\nNhap gia ban moi cho %s", RestaurantItems[item]);
ShowPlayerDialog(playerid, DIALOG_RESTAURANT2, DIALOG_STYLE_INPUT, "Chinh gia", string, "Dong y", "Huy bo");
return 1;
}
format(string,sizeof(string), "%s da duoc thiet lap gia den $%s!", RestaurantItems[item], number_format(price));
Businesses[business][bItemPrices][item] = price;
SaveBusiness(business);
SendClientMessageEx(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "%s %s (IP: %s) da thiet lap gia %s den %s trong %s ($%d)", GetBusinessRankName(PlayerInfo[playerid][pBusinessRank]), GetPlayerNameEx(playerid), GetPlayerIpEx(playerid), RestaurantItems[item], number_format(price), Businesses[business][bName], business);
new szDialog[302];
for (new i = 0; i <= 13; i++) format(szDialog, sizeof(szDialog), "%s%s ($%s)\n", szDialog, RestaurantItems[i], number_format(Businesses[business][bItemPrices][i]));
ShowPlayerDialog(playerid, DIALOG_RESTAURANT, DIALOG_STYLE_LIST, "Chih gia cua hang", szDialog, "Dong y", "Huy bo");
Log("logs/business.log", string);
}
DeletePVar(playerid, "EditingStoreItem");
return 1;
}