[debug] Run time error 4: "Array index out of bounds"
#5

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
You haven't compiled with debug info (-d3 flag) correctly. Follow this step by step (https://github.com/Zeex/samp-plugin-...ith-debug-info) and try again.

About the problem now, you have posted the wrong code. The problem is in /myvehicles command.

I apologize, sir, my english is not good,I hope this time I can do the right thing;

Код:
[19:10:06] [debug] Run time error 4: "Array index out of bounds"
[19:10:06] [debug]  Accessing element at negative index -399
[19:10:06] [debug] AMX backtrace:
[19:10:06] [debug] #0 0026ecbc in public cmd_myvehicles (playerid=0, params[]=@0021506c "") at C:\Users\HP\Desktop\LV-MP\pawno\include\cnr/command.inc:678
[19:10:06] [debug] #1 native CallLocalFunction () from samp-server.exe
[19:10:06] [debug] #2 0004c14c in public OnPlayerCommandText (playerid=0, cmdtext[]=@0021503c "/myvehicles") at C:\Users\HP\Desktop\LV-MP\pawno\include\required/zcmd.inc:102
[19:10:15] [pause] Veoper is now AFK.
myvehicle Command Code;
Код:
COMMAND:myvehicles(playerid, params[])
{
	new bool:found = false, msg[256];
	for(new i = 0; i < MAX_VEH; i++)
	{
		if(!Vehicles[i][vehStatus]) continue;
		
		if(Vehicles[i][vehOwner] == Player[playerid][pID])
		{
			found = true;
			format(msg, sizeof(msg), "%s%s ID : "CHAT_YELLOW"%d"CHAT_WHITE"\n", msg, vehicleNames[Vehicles[i][vehModel] - 400], Vehicles[i][vehID]);
		}
	}
	if(found)
	{
		if(Player[playerid][english])
			ShowPlayerDialog(playerid, DIALOG_MYVEHICLES, DIALOG_STYLE_LIST, "My Vehicles", msg, "Choose", "Cancel");
		else
			ShowPlayerDialog(playerid, DIALOG_MYVEHICLES, DIALOG_STYLE_LIST, "Mobil Saya", msg, "Pilih", "Batal");
	}
	else
	{
		if(Player[playerid][english])
			Server(playerid, "You didn't have any vehicles.");
		else
			Server(playerid, "Kamu tidak memiliki kendaraan.");
	}
	return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)