Jump to content

Recommended Posts

Posted

Deci, ieri cand am adaugat stock ul de TotalUp la vehicule a mers gamemode-ul, acum azi a picat sv u, i-am dat restart si acum zice ca /v nu exista.

 

[18:11:35] [debug] Run time error 4: "Array index out of bounds"
[18:11:35] [debug]  Accessing element at negative index -400
[18:11:35] [debug] AMX backtrace:
[18:11:35] [debug] #0 00153450 in ?? (0) from wa-rpg.amx
[18:11:35] [debug] #1 0014c67c in public cmd_v (0, 175076972) from wa-rpg.amx
[18:11:35] [debug] #2 native CallLocalFunction () from samp03svr
[18:11:35] [debug] #3 00012e40 in public OnPlayerCommandText (0, 175076960) from wa-rpg.amx
[18:11:37] [debug] Run time error 4: "Array index out of bounds"
[18:11:37] [debug]  Accessing element at negative index -400
[18:11:37] [debug] AMX backtrace:
[18:11:37] [debug] #0 00153450 in ?? (0) from wa-rpg.amx
[18:11:37] [debug] #1 0014c67c in public cmd_v (0, 175076972) from wa-rpg.amx
[18:11:37] [debug] #2 native CallLocalFunction () from samp03svr
[18:11:37] [debug] #3 00012e40 in public OnPlayerCommandText (0, 175076960) from wa-rpg.amx
Posted
Just now, Smokey20_official said:

Deci, ieri cand am adaugat stock ul de TotalUp la vehicule a mers gamemode-ul, acum azi a picat sv u, i-am dat restart si acum zice ca /v nu exista.

 

[18:11:35] [debug] Run time error 4: "Array index out of bounds"
[18:11:35] [debug]  Accessing element at negative index -400
[18:11:35] [debug] AMX backtrace:
[18:11:35] [debug] #0 00153450 in ?? (0) from wa-rpg.amx
[18:11:35] [debug] #1 0014c67c in public cmd_v (0, 175076972) from wa-rpg.amx
[18:11:35] [debug] #2 native CallLocalFunction () from samp03svr
[18:11:35] [debug] #3 00012e40 in public OnPlayerCommandText (0, 175076960) from wa-rpg.amx
[18:11:37] [debug] Run time error 4: "Array index out of bounds"
[18:11:37] [debug]  Accessing element at negative index -400
[18:11:37] [debug] AMX backtrace:
[18:11:37] [debug] #0 00153450 in ?? (0) from wa-rpg.amx
[18:11:37] [debug] #1 0014c67c in public cmd_v (0, 175076972) from wa-rpg.amx
[18:11:37] [debug] #2 native CallLocalFunction () from samp03svr
[18:11:37] [debug] #3 00012e40 in public OnPlayerCommandText (0, 175076960) from wa-rpg.amx

[18:11:35] [debug] Run time error 4: "Array index out of bounds" [18:11:35] [debug] Accessing element at negative index -400 [18:11:35] [debug] AMX backtrace: [18:11:35] [debug] #0 00153450 in ?? (0) from wa-rpg.amx [18:11:35] [debug] #1 0014c67c in public cmd_v (0, 175076972) from wa-rpg.amx [18:11:35] [debug] #2 native CallLocalFunction () from samp03svr [18:11:35] [debug] #3 00012e40 in public OnPlayerCommandText (0, 175076960) from wa-rpg.amx [18:11:37] [debug] Run time error 4: "Array index out of bounds" [18:11:37] [debug] Accessing element at negative index -400 [18:11:37] [debug] AMX backtrace: [18:11:37] [debug] #0 00153450 in ?? (0) from wa-rpg.amx [18:11:37] [debug] #1 0014c67c in public cmd_v (0, 175076972) from wa-rpg.amx [18:11:37] [debug] #2 native CallLocalFunction () from samp03svr [18:11:37] [debug] #3 00012e40 in public OnPlayerCommandText (0, 175076960) from wa-rpg.amx

Posted

Cred ca a mai fost problema asta, vezi unde folosesti cModel sau ceva de genu ca nu se incarca modelul bine sau nu se incarca deloc ca ramane pe 0

asgood.ro

 

 

 

Posted
Just now, ASGOOD said:

pune codu de la /v

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

 

stock TotalUp(carid) {
    new up, stage[20], neon[20];
    gString[0] = EOS;

    if(CarInfo[carid][cText] > 3) up ++;
    if(CarInfo[carid][cStage] > 0) up ++;
    if(CarInfo[carid][cRainBow]) up ++;
    
    format(stage, sizeof(stage), "{509AE4}[S: %d/2] ", CarInfo[carid][cStage]);

    format(gString, 100, "%s%s", strlen(CarInfo[carid][cText]) > 3 ? ("{E3DE31}[V] ") : (""), CarInfo[carid][cRainBow] ? ("{791DD5}[R] ") : (""), CarInfo[carid][cStage] ? stage : (""));
    return up != 0 ? gString : ("none");
}

stock ShowPlayerVehicle(playerid) {
    new szTitle[180], szDialog[1300], szDialog2[1300], vstatus[1024];
    if(GetVehicles(playerid) == 0) return SendClientMessage(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][i] != 0) {
                    new car =  PlayerInfo[playerid][pCarKey][i];
                    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, "{FFD857}<slot liber>\n"), sVehicle[i][playerid] = 0;
            }
            else {
                if(PlayerInfo[playerid][pCarKey][i] != 0) {
                    new car =  PlayerInfo[playerid][pCarKey][i];
                    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, "{FFD857}<slot liber>\n"), sVehicle[i][playerid] = 0;            
            }
        }
        else {
            if(PlayerInfo[playerid][pCarKey][i] != 0) {
                new car =  PlayerInfo[playerid][pCarKey][i];
                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, "{FFD857}<slot liber>\n"), sVehicle[i][playerid] = 0;        
        }
    }
    ShowPlayerDialog(playerid, DIALOG_GARAGE, DIALOG_STYLE_LIST, szTitle, szDialog2, "Ok", "Exit");
    return 1;
}

Posted

Adauga o modificare   for(new i = 0; i < 10; i++) { aici inlocuieste cu  for(new i = 0; i < 10; i++) if(cInfo[PlayerInfo[playerid][pCarKey][i]][cModel] != 0) {

 

nu ti se incarca o masina cum trebuie sau e o alta verificare proasta, da asta totusi ar trebui sa rezolve problema masinii incarcate prost

asgood.ro

 

 

 

Posted (edited)
2 minutes ago, ASGOOD said:

Adauga o modificare   for(new i = 0; i < 10; i++) { aici inlocuieste cu  for(new i = 0; i < 10; i++) if(cInfo[PlayerInfo[playerid][pCarKey][i]][cModel] != 0) {

 

nu ti se incarca o masina cum trebuie sau e o alta verificare proasta, da asta totusi ar trebui sa rezolve problema masinii incarcate prost

e mai mult un petic decat o rezolvare dar nu stiu exact tot codu si unde crapa, poti sa pui tu niste debug-uri niste print(i) in foru ala si sa vezi exact la care valoare primeste crash comanda

EDIT: Ca sa faci debug asta, trebuie sa scoti verificarea cu model pe care am facut-o eu

Edited by ASGOOD

asgood.ro

 

 

 

Posted
9 minutes ago, ASGOOD said:

e mai mult un petic decat o rezolvare dar nu stiu exact tot codu si unde crapa, poti sa pui tu niste debug-uri niste print(i) in foru ala si sa vezi exact la care valoare primeste crash comanda

EDIT: Ca sa faci debug asta, trebuie sa scoti verificarea cu model pe care am facut-o eu

tot nu merge

 

Posted
32 minutes ago, Sancky said:

arata incarcarea

function LoadPlayerCars(playerid) {
    for(new i = 0; i < 10; i++) if(PlayerInfo[playerid][pCarKey][i] > 0) LoadCar(PlayerInfo[playerid][pCarKey][i]);
    return 1;
}

function LoadCar(id) {
    if(CarInfo[id][cModel] != 0) return 1;
    new query[256];
    mysql_format(SQL, query, 128, "SELECT * FROM `cars` WHERE `ID`='%d'", id);    
    new Cache: db = mysql_query(SQL, query);    
    new i = 0;
    CarInfo[id][cID] = id;
    CarInfo[id][cModel] = cache_get_field_content_int(i, "Model");
    CarInfo[id][cLocationx] = cache_get_field_content_float(i, "Locationx");
    CarInfo[id][cLocationy] = cache_get_field_content_float(i, "Locationy");
    CarInfo[id][cLocationz] = cache_get_field_content_float(i, "Locationz");
    CarInfo[id][cAngle] = cache_get_field_content_float(i, "Angle");
    CarInfo[id][cColorOne] = cache_get_field_content_int(i, "ColorOne");
    CarInfo[id][cColorTwo]  = cache_get_field_content_int(i, "ColorTwo");
    cache_get_field_content(i, "Owner", CarInfo[id][cOwner], SQL, 129);
    cache_get_field_content(i, "Text", CarInfo[id][cText], SQL, 129);
    CarInfo[id][cTextColor] = cache_get_field_content_int(i, "ColorText");
    CarInfo[id][cValue] = cache_get_field_content_int(i, "Value");
    cache_get_field_content(i, "License", CarInfo[id][cLicense], SQL, 129);
    CarInfo[id][cAlarm] = cache_get_field_content_int(i, "Alarm");
    CarInfo[id][cLock] = cache_get_field_content_int(i, "Lockk");
    CarInfo[id][mod0] = cache_get_field_content_int(i, "mod0");
    CarInfo[id][mod1] = cache_get_field_content_int(i, "mod1");
    CarInfo[id][mod2] = cache_get_field_content_int(i, "mod2");
    CarInfo[id][mod3] = cache_get_field_content_int(i, "mod3");
    CarInfo[id][mod4] = cache_get_field_content_int(i, "mod4");
    CarInfo[id][mod5] = cache_get_field_content_int(i, "mod5");
    CarInfo[id][mod6] = cache_get_field_content_int(i, "mod6");
    CarInfo[id][mod7] = cache_get_field_content_int(i, "mod7");
    CarInfo[id][mod8] = cache_get_field_content_int(i, "mod8");
    CarInfo[id][mod9] = cache_get_field_content_int(i, "mod9");
    CarInfo[id][mod10] = cache_get_field_content_int(i, "mod10");
    CarInfo[id][mod11] = cache_get_field_content_int(i, "mod11");
    CarInfo[id][mod12] = cache_get_field_content_int(i, "mod12");
    CarInfo[id][mod13] = cache_get_field_content_int(i, "mod13");
    CarInfo[id][paintjob] = cache_get_field_content_int(i, "paintjob");
    CarInfo[id][KM] = cache_get_field_content_float(i, "KM");
    CarInfo[id][Userid] = cache_get_field_content_int(i, "Userid");
    CarInfo[id][Confiscated] = cache_get_field_content_int(i, "Confiscated");
    CarInfo[id][Spawned] = 0;
    CarInfo[id][cSpecial] = cache_get_field_content_int(i, "Special");
    CarInfo[id][cTax] = cache_get_field_content_int(i, "Tax");
    CarInfo[id][cPoints] = cache_get_field_content_int(i, "Points");
    CarInfo[id][cFuel] = cache_get_field_content_int(i, "Fuel");
    CarInfo[id][cNeon] = cache_get_field_content_int(i, "Neon");
    CarInfo[id][cStage] = cache_get_field_content_int(i, "Stage");
    CarInfo[id][cMaxSpeed] = cache_get_field_content_int(i, "MaxSpeed");
    CarInfo[id][cVIP] = cache_get_field_content_int(i, "VIP");
    CarInfo[id][cTimeGoto] = cache_get_field_content_int(i, "TimeGoto");
    CarInfo[id][cRainBow] = cache_get_field_content_int(i, "RainBow");
    cache_delete(db);
    return 1;
}

Posted
15 hours ago, Smokey20_official said:

function LoadPlayerCars(playerid) {
    for(new i = 0; i < 10; i++) if(PlayerInfo[playerid][pCarKey][i] > 0) LoadCar(PlayerInfo[playerid][pCarKey][i]);
    return 1;
}

function LoadCar(id) {
    if(CarInfo[id][cModel] != 0) return 1;
    new query[256];
    mysql_format(SQL, query, 128, "SELECT * FROM `cars` WHERE `ID`='%d'", id);    
    new Cache: db = mysql_query(SQL, query);    
    new i = 0;
    CarInfo[id][cID] = id;
    CarInfo[id][cModel] = cache_get_field_content_int(i, "Model");
    CarInfo[id][cLocationx] = cache_get_field_content_float(i, "Locationx");
    CarInfo[id][cLocationy] = cache_get_field_content_float(i, "Locationy");
    CarInfo[id][cLocationz] = cache_get_field_content_float(i, "Locationz");
    CarInfo[id][cAngle] = cache_get_field_content_float(i, "Angle");
    CarInfo[id][cColorOne] = cache_get_field_content_int(i, "ColorOne");
    CarInfo[id][cColorTwo]  = cache_get_field_content_int(i, "ColorTwo");
    cache_get_field_content(i, "Owner", CarInfo[id][cOwner], SQL, 129);
    cache_get_field_content(i, "Text", CarInfo[id][cText], SQL, 129);
    CarInfo[id][cTextColor] = cache_get_field_content_int(i, "ColorText");
    CarInfo[id][cValue] = cache_get_field_content_int(i, "Value");
    cache_get_field_content(i, "License", CarInfo[id][cLicense], SQL, 129);
    CarInfo[id][cAlarm] = cache_get_field_content_int(i, "Alarm");
    CarInfo[id][cLock] = cache_get_field_content_int(i, "Lockk");
    CarInfo[id][mod0] = cache_get_field_content_int(i, "mod0");
    CarInfo[id][mod1] = cache_get_field_content_int(i, "mod1");
    CarInfo[id][mod2] = cache_get_field_content_int(i, "mod2");
    CarInfo[id][mod3] = cache_get_field_content_int(i, "mod3");
    CarInfo[id][mod4] = cache_get_field_content_int(i, "mod4");
    CarInfo[id][mod5] = cache_get_field_content_int(i, "mod5");
    CarInfo[id][mod6] = cache_get_field_content_int(i, "mod6");
    CarInfo[id][mod7] = cache_get_field_content_int(i, "mod7");
    CarInfo[id][mod8] = cache_get_field_content_int(i, "mod8");
    CarInfo[id][mod9] = cache_get_field_content_int(i, "mod9");
    CarInfo[id][mod10] = cache_get_field_content_int(i, "mod10");
    CarInfo[id][mod11] = cache_get_field_content_int(i, "mod11");
    CarInfo[id][mod12] = cache_get_field_content_int(i, "mod12");
    CarInfo[id][mod13] = cache_get_field_content_int(i, "mod13");
    CarInfo[id][paintjob] = cache_get_field_content_int(i, "paintjob");
    CarInfo[id][KM] = cache_get_field_content_float(i, "KM");
    CarInfo[id][Userid] = cache_get_field_content_int(i, "Userid");
    CarInfo[id][Confiscated] = cache_get_field_content_int(i, "Confiscated");
    CarInfo[id][Spawned] = 0;
    CarInfo[id][cSpecial] = cache_get_field_content_int(i, "Special");
    CarInfo[id][cTax] = cache_get_field_content_int(i, "Tax");
    CarInfo[id][cPoints] = cache_get_field_content_int(i, "Points");
    CarInfo[id][cFuel] = cache_get_field_content_int(i, "Fuel");
    CarInfo[id][cNeon] = cache_get_field_content_int(i, "Neon");
    CarInfo[id][cStage] = cache_get_field_content_int(i, "Stage");
    CarInfo[id][cMaxSpeed] = cache_get_field_content_int(i, "MaxSpeed");
    CarInfo[id][cVIP] = cache_get_field_content_int(i, "VIP");
    CarInfo[id][cTimeGoto] = cache_get_field_content_int(i, "TimeGoto");
    CarInfo[id][cRainBow] = cache_get_field_content_int(i, "RainBow");
    cache_delete(db);
    return 1;
}

e ok, verifica daca ai in baza randuri in care Model are valoarea 0

 

query: SELECT * FROM `personal_vehicles` WHERE `Model` = 0

Posted
2 hours ago, nobilzeus said:

modifică rând pe rând peste tot unde este cmodel cu 411 și când o să meargă și nu mai primești eroare ai găsit linia

n are trb asta

  • Haha 1

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.