Jump to content
  • 0

Eroare BURNED AndreiGB


buNNy

Question

[17:23:00] [debug] Run time error 4: "Array index out of bounds"
[17:23:00] [debug]  Accessing element at negative index -400
[17:23:00] [debug] AMX backtrace:
[17:23:00] [debug] #0 0014a628 in ?? (0) from GM.amx
[17:23:00] [debug] #1 00143e98 in public @_yCv (0, 60232712, 0) from GM.amx
[17:23:00] [debug] #2 00143e44 in public @yC_v (0, 60232712, 0, 0) from GM.amx
[17:23:00] [debug] #3 native CallRemoteFunction () from samp-server.exe
[17:23:00] [debug] #4 00036ecc in ?? (0, 60232700, 0) from GM.amx
[17:23:00] [debug] #5 00036710 in ?? (0, 60232700) from GM.amx
[17:23:00] [debug] #6 000290dc in public OnPlayerCommandText (0, 60232700) from GM.amx

COMUNITATEA MEA DE RESURSE
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spacer.png
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
www.codeup.ro / www.codeup.ro/forum

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0
Quote

[17:23:00] [debug] Run time error 4: "Array index out of bounds"
 [17:23:00] [debug]  Accessing element at negative index -400

gm-ul incearca sa acceseze element-ul -400 dintr-un array, si iti da eroare pentru ca array-urile incep de la 0. Cel mai probabil e din cauza functiei care iti arata numele masinii. uitate dupa "vehicleid - 400" or something

Edited by CritteR
Link to comment
Share on other sites

  • 0
Chiar acum, CritteR a spus:

si in comanda ta /v nu accesezi o functie, sau un cod care cauta numele masinii intr-un array?

YCMD:v(playerid, params[], help) return ShowPlayerVehicle(playerid);

 

 

Spoiler

stock ShowPlayerVehicle(playerid) {
    new szTitle[180], szDialog[1300], szDialog2[1300], vstatus[1024];
    if(GetVehicles(playerid) == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu ai un vehicul personal!");
    format(szTitle, sizeof(szTitle), "Vehicles (%d/%d)", GetVehicles(playerid), TotalSlots(playerid));            
    for(new i = 0; i < 10; i++) {
        if(i < 5) {
            if(i < 3) {
                if(PlayerInfo[playerid][pCarKey] != 0) {
                    new car =  PlayerInfo[playerid][pCarKey];
                    if(IsVehicleOccupied(CarInfo[car][Spawned])) format(vstatus, sizeof(vstatus), "{FFFF00}(Occupied){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]);
                    else if(CarInfo[car][Spawned] > 0) format(vstatus, sizeof(vstatus), "{26B309}(Spawned){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]);
                    else format(vstatus, sizeof(vstatus), "{FF0000}(Despawnat){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]);
                    format(szDialog, sizeof(szDialog), "%s\n", vstatus);
                    strcat(szDialog2, szDialog);
                }
                else strcat(szDialog2, "{F3FF73}[ empty ]\n"), sVehicle[playerid] = 0;
            }
            else {
                if(PlayerInfo[playerid][pCarKey] != 0) {
                    new car =  PlayerInfo[playerid][pCarKey];
                    if(IsVehicleOccupied(CarInfo[car][Spawned])) format(vstatus, sizeof(vstatus), "{FFFF00}(Occupied){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]);
                    else if(CarInfo[car][Spawned] > 0) format(vstatus, sizeof(vstatus), "{26B309}(Spawned){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]);
                    else format(vstatus, sizeof(vstatus), "{FF0000}(Despawnat){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]);
                    format(szDialog, sizeof(szDialog), "%s\n", vstatus);
                    strcat(szDialog2, szDialog);
                }
                else if(PlayerInfo[playerid][pPremiumAccount] == 1) strcat(szDialog2, "{F3FF73}[ empty ]\n"), sVehicle[playerid] = 0;            
            }
        }
        else {
            if(PlayerInfo[playerid][pCarKey] != 0) {
                new car =  PlayerInfo[playerid][pCarKey];
                if(IsVehicleOccupied(CarInfo[car][Spawned])) format(vstatus, sizeof(vstatus), "{FFFF00}(Occupied){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]);
                else if(CarInfo[car][Spawned] > 0) format(vstatus, sizeof(vstatus), "{26B309}(Spawned){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]);
                else format(vstatus, sizeof(vstatus), "{FF0000}(Despawnat){FFFFFF} %s", aVehicleNames[CarInfo[car][cModel]-400]);
                format(szDialog, sizeof(szDialog), "%s\n", vstatus);
                strcat(szDialog2, szDialog);
            }
            else if(PlayerInfo[playerid][pSlot][i-5] == 1) strcat(szDialog2, "{F3FF73}[ empty ]\n"), sVehicle[playerid] = 0;        
        }
    }
    ShowPlayerDialog(playerid, DIALOG_GARAGE, DIALOG_STYLE_LIST, szTitle, szDialog2, "Ok", "Exit");
    return 1;
}

 

COMUNITATEA MEA DE RESURSE
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spacer.png
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
www.codeup.ro / www.codeup.ro/forum

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.