[debug] Run time error 4: "Array index out of bounds" [READ FOR MORE INFO]
#1

Hello, I added this

Код:
        new cdveh = GetPlayerVehicleID(MAX_PLAYERS);
		if(GetCarDealershipVehicleId(cdveh) != -1 && GetCarDealershipVehicleId(cdveh) == GetPVarInt(playerid, "editingcdveh")) return 1;
		if(GetCarDealershipVehicleId(cdveh) != -1)
		{
		    new string[128];
			//new string[57 + 20 + 4];
			format(string, sizeof(string),"Would you like to buy this %s? This vehicle costs $%d.", GetVehicleName(cdveh), CarDealershipInfo[GetCarDealershipId(cdveh)][cdVehicleCost][GetCarDealershipVehicleId(cdveh)]);
			//ShowPlayerDialogEx(playerid,DIALOG_CDBUY,DIALOG_STYLE_MSGBOX,"Warning:",string,"Buy","Cancel");
			SendClientMessage(playerid, COLOR_REALRED, string);
			SendClientMessage(playerid, COLOR_YELLOW, "Type /buyvehicle to buy the car");
			TogglePlayerControllable(playerid, false);
			return 1;
		}
And those messages doesnt appear. I tried to add the crashdetect plugin and i figure out the problem. Is caming from that line (im very sure)

How do i fix it Thanks

Full Debug Error
Код:
[15/05/2014 15:14:07] [debug] Run time error 4: "Array index out of bounds"
[15/05/2014 15:14:07] [debug]  Accessing element at negative index -400
[15/05/2014 15:14:07] [debug] AMX backtrace:
[15/05/2014 15:14:07] [debug] #0 002641b4 in public OnPlayerStateChange (0x00000000, 0x00000002, 0x00000001) from PHRP_1.5.amx
Just a note: Before i add that everything is fine no debug errors after i add it appears.

Respectfully yours,
Reply


Messages In This Thread
[debug] Run time error 4: "Array index out of bounds" [READ FOR MORE INFO] - by Trynda - 15.05.2014, 07:00
Re: [debug] Run time error 4: "Array index out of bounds" [READ FOR MORE INFO] - by VishvaJeet - 15.05.2014, 07:44
Re: [debug] Run time error 4: "Array index out of bounds" [READ FOR MORE INFO] - by Vince - 15.05.2014, 08:23
Re: [debug] Run time error 4: "Array index out of bounds" [READ FOR MORE INFO] - by Konstantinos - 15.05.2014, 10:28

Forum Jump:


Users browsing this thread: 1 Guest(s)