Jump to content

[REZOLVAT] Probleme loadcar burned


Confirmatul
 Share

Recommended Posts

  • Username:Confirmatul
  • Problema întălnită:cand folosesc comanda /v imi da asta in baza de date Log("00:27:33","cache_get_row_count",2,"no active cache",0);
  • Detalii despre problemă:Cand folosesc /v imi da asta Log("00:27:33","cache_get_row_count",2,"no active cache",0);
  • Ce ai încercat să faci înainte să postezi?:Da sa pun for(new i sa zicem dar pica sv :((
  • Cod sursă (recomandat pastebin.com) :https://pastebin.com/RRHb0yaQ
  • Alte detalii:va rog sa lasati si un pastbin cu functia corecta sa o pun in gm direct ca nu ma pricep ????
Link to comment
Share on other sites

sau poate e de la asta uitati 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, "{FFD857}<slot liber>\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, "{FFD857}<slot liber>\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, "{FFD857}<slot liber>\n"), sVehicle[playerid] = 0;        
        }
    }
    ShowPlayerDialog(playerid, DIALOG_GARAGE, DIALOG_STYLE_LIST, szTitle, szDialog2, "Ok", "Exit");
    return 1;
}

Link to comment
Share on other sites

Din pastebin-ul de la tine e problema, incearca:

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);
	if(cache_get_row_count() > 0) {
      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);
      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");
      cache_delete(db);
	}
    return 1;
}

 

Respecta si vei fi respectat.

 

BigInt Pawn:

Pacman C++: 

Snake C++:

Minesweeper C++:

 

mattbb.cash

leaks.ro

Link to comment
Share on other sites

2 hours ago, Matt said:

Din pastebin-ul de la tine e problema, incearca:


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);
	if(cache_get_row_count() > 0) {
      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);
      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");
      cache_delete(db);
	}
    return 1;
}

 

nu merge imatt tot asa da Log("14:41:23","cache_get_row_count",2,"no active cache",0);

Link to comment
Share on other sites

Verifica in sistemul tau pe unde mai ai SELECT-uri fara sa verifici numarul de randuri rezultate si fa cum am facut eu mai sus.

Respecta si vei fi respectat.

 

BigInt Pawn:

Pacman C++: 

Snake C++:

Minesweeper C++:

 

mattbb.cash

leaks.ro

Link to comment
Share on other sites

Acum 1 minut, Confirmatul a spus:

nu inteleg ce vrei sa spui

............

Inainte sa iei valori din rezultatele query-ului ar trebui sa verifici DACA sunt randuri extrase. Adaugi if(cache_get_row_count() > 0) ca sa verifici daca sunt.

Respecta si vei fi respectat.

 

BigInt Pawn:

Pacman C++: 

Snake C++:

Minesweeper C++:

 

mattbb.cash

leaks.ro

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...