Jump to content

Recommended Posts

Posted

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;
}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.