Who help me fix the bug with?
#1

This is an error message from server.log
PHP код:
[12:34:03] [debugRun 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] [debugAMX 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] [partAnh_Tuan has left the server (0:1
Here is the error code

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 || price 500000)
            {
                
format(stringsizeof(string), "{FF0000}Error: {DDDDDD}Gia vuot qua pham vi{FFFFFF}\n\nNhap gia ban moi cho %s"RestaurantItems[item]);
                
ShowPlayerDialog(playeridDIALOG_RESTAURANT2DIALOG_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(playeridCOLOR_WHITEstring);
            
format(stringsizeof(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 
0<= 13i++) format(szDialogsizeof(szDialog), "%s%s  ($%s)\n"szDialogRestaurantItems[i], number_format(Businesses[business][bItemPrices][i]));
            
ShowPlayerDialog(playeridDIALOG_RESTAURANTDIALOG_STYLE_LIST"Chih gia cua hang"szDialog"Dong y""Huy bo");
            
Log("logs/business.log"string);
        }
        
DeletePVar(playerid"EditingStoreItem");
        return 
1;
    } 
Who helped me fix, I thank you very much!
Reply


Messages In This Thread
Who help me fix the bug with? - by NguyenPhanAnhTuan - 11.09.2017, 06:48
Re: Who help me fix the bug with? - by buburuzu19 - 11.09.2017, 06:54
Re: Who help me fix the bug with? - by NguyenPhanAnhTuan - 11.09.2017, 07:10
Re: Who help me fix the bug with? - by Vince - 11.09.2017, 08:15
Re: Who help me fix the bug with? - by NguyenPhanAnhTuan - 12.09.2017, 08:29

Forum Jump:


Users browsing this thread: 1 Guest(s)