02.12.2017, 10:54
(
Последний раз редактировалось BrainDamaged; 02.12.2017 в 15:20.
)
Hi guys! Can somebody help me to detect the problem from this script? REP++
myvehicle Command Code;
Код:
[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.
Код:
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; }