dau comanda /v si iau eroarea asta:
[debug] Accessing element at negative index -400
[debug] AMX backtrace:
[debug] #0 00143eec in ?? (0) from Crown-RPG.amx
[debug] #1 0013deb4 in public cmd_v (0, 195300828) from Crown-RPG.amx
[debug] #2 native CallLocalFunction () from samp-server.exe
[debug] #3 000179e0 in ?? (0, 195300816) from Crown-RPG.amx
[debug] #4 0000622c in public OnPlayerCommandText (0, 195300816) from Crown-RPG.amx
comanda returneaza functia showplayervehicle:
stock ShowPlayerVehicle(playerid) {
new szTitle[60], szDialog[3000], szDialog2[3000], x = 0;
if(GetVehicles(playerid) == 0) return SendClientMessage(playerid, COLOR_LGREEN, "Eroare: Nu ai un vehicul personal!");
format(szTitle, sizeof(szTitle), "Your Vehicles {E3DE31}%d/%d", GetVehicles(playerid), GetSlots(playerid));
strcat(szDialog, "Vehicul\tStatus");
for(new i = 0; i < 10; i++) {
if(i < 5) {
if(i < 3) {
new car = PlayerInfo[playerid][pCarKey][i];
format(szDialog, sizeof szDialog, "%s%s\t%s\n", szDialog, aVehicleNames[CarInfo[car][cModel]-400], CarInfo[car][Spawned] != 0 ? IsVehicleOccupied(CarInfo[car][Spawned]) ? ("{FFFF00}[occupied]") : ("{26B309}[spawned]") : ("{FF0000}[despawned]"));
strcat(szDialog2, szDialog);
PlayerInfo[playerid][pCarKey][x] = CarInfo[car][cModel];
x++;
}
else strcat(szDialog2, "{FFD857}<slot liber>\n"), sVehicle[i][playerid] = 0;
}
else {
new car = PlayerInfo[playerid][pCarKey][i];
format(szDialog, sizeof szDialog, "%s%s\t%s\n", szDialog, aVehicleNames[CarInfo[car][cModel]-400], CarInfo[car][Spawned] != 0 ? IsVehicleOccupied(CarInfo[car][Spawned]) ? ("{FFFF00}[occupied]") : ("{26B309}[spawned]") : ("{FF0000}[despawned]"));
strcat(szDialog2, szDialog);
PlayerInfo[playerid][pCarKey][x] = CarInfo[car][cModel];
x++;
}
}
ShowPlayerDialog(playerid, DIALOG_GARAGE, DIALOG_STYLE_TABLIST_HEADERS, szTitle, szDialog, "Ok", "Exit");
return true;
}