Jump to content
  • 0

Problema masini ds


marius11

Question

Problema intalnita (descriere):Am o problema destul de complicata dupa parerea mea , am in ds pe 3 categori prima ieftine normale si scumpe iar la cele scumpe imi apare un bug la nume apare infernus si cand dau sa cumpar infernus apare sultan iar masina zr-350 este dublata apare de 2 ori iar pe baza de date o data
Ero(area / rile) / warning-(ul / urile):
Liniile de cod / sursa / script-ul(obligatoriu):
Imagini / Video (optional):http://imgur.com/a/fYfcA
Ati incercat sa rezolvati singur?: Da am incercat sa sterg sa inlocuiesc si tot se face dupa ce dau un nou restart

        case DIALOG_CARBUY5:
        {
            if(response)
            {
                new numb = sCar[playerid];
                if(playerVariables[playerid][pMoney] >= dealerVariables[numb][dCarPrice])
                {
                       if(dealerVariables[numb][dCarStock] >= 1)
                    {
                        PurchaseVehicleFromDealer(playerid, dealerVariables[numb][dCarID], dealerVariables[numb][dCarPrice]);
                        if(bought[playerid] == 1)
                        {
                            dealerVariables[numb][dCarStock] -= 1;
                        }
                        saveCar(numb);
                    }
                    else
                    {
                        new stringg[MAX_STRING];
                        format(stringg,sizeof(stringg),"Aceasta masina numai este disponibila in Dealership. Stoc epuizat.\nYou can't buy this vehicle from the dealership. Out of stock.");
                         ShowPlayerDialog(playerid, DIALOG_NOSTOCK, DIALOG_STYLE_MSGBOX, "Out of stock", stringg, "Close","");
                    }
                }
                else return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to purchase this vehicle.");
            }
            return 1;
        }
        case DIALOG_CARBUY2:
        {
            if(response)
            {
                new numb = listitem + 1;
                sCar[playerid] = numb;
                new string33[256], stringtitle[256];
                format(stringtitle, sizeof(stringtitle), "%s ($%s) - %d available", dealerVariables[numb][dCarName], NumberFormat(dealerVariables[numb][dCarPrice]), dealerVariables[numb][dCarStock]);
                format(string33, sizeof(string33), "Vehicle name: %s\nVehicle price: %s\nNumber of cars available: %d", dealerVariables[numb][dCarName], NumberFormat(dealerVariables[numb][dCarPrice]), dealerVariables[numb][dCarStock]);
                ShowPlayerDialog(playerid, DIALOG_CARBUY5, DIALOG_STYLE_MSGBOX, stringtitle, string33, "Buy car", "Back");
            }
            return 1;
        }
        case DIALOG_CARBUY3:
        {
            if(response)
            {
                new cheapcars;
                for(new xf = 43; xf < MAX_DEALERSHIP_CARS; xf++)
                {
                    if(dealerVariables[xf][dCarPrice] > 0 && dealerVariables[xf][dCarPrice] <= 7000000)
                    {
                        cheapcars = xf;
                    }
                }
                  new numb = listitem + cheapcars + 1;
                 sCar[playerid] = numb;
                new string33[256], stringtitle[256];
                format(stringtitle, sizeof(stringtitle), "%s ($%s) - %d available", dealerVariables[numb][dCarName], NumberFormat(dealerVariables[numb][dCarPrice]), dealerVariables[numb][dCarStock]);
                format(string33, sizeof(string33), "Vehicle name: %s\nVehicle price: %s\nNumber of cars available: %d", dealerVariables[numb][dCarName], NumberFormat(dealerVariables[numb][dCarPrice]), dealerVariables[numb][dCarStock]);
                ShowPlayerDialog(playerid, DIALOG_CARBUY5, DIALOG_STYLE_MSGBOX, stringtitle, string33, "Buy car", "Back");
            }
            return 1;
        }
        case DIALOG_CARBUY4:
        {
            if(response)
            {
                new regcheapcars;
                for(new xf = 61; xf < MAX_DEALERSHIP_CARS; xf++)
                {
                    if(dealerVariables[xf][dCarPrice] > 7000000 && dealerVariables[xf][dCarPrice] <= 24999999)
                    {
                           regcheapcars = xf;
                    }
                }
                  new numb = listitem + regcheapcars + 1;
                   sCar[playerid] = numb;
                new string33[256], stringtitle[256];
                format(stringtitle, sizeof(stringtitle), "%s ($%s) - %d available", dealerVariables[numb][dCarName], NumberFormat(dealerVariables[numb][dCarPrice]), dealerVariables[numb][dCarStock]);
                format(string33, sizeof(string33), "Vehicle name: %s\nVehicle price: %s\nNumber of cars available: %d", dealerVariables[numb][dCarName], NumberFormat(dealerVariables[numb][dCarPrice]), dealerVariables[numb][dCarStock]);
                ShowPlayerDialog(playerid, DIALOG_CARBUY5, DIALOG_STYLE_MSGBOX, stringtitle, string33, "Buy car", "Back");
            }
            return 1;
        }

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

La OnDialogResponse , la dialogul pentru masini scumpe , cauta cazul pentru infernus .  De exemplu , daca infernus este al  treilea in lista , cauta la masini  scumpe case 3: , modifici id-ul de acolo . Apoi , masina dublata, la fel , o cauti dupa case si o modifici . Tine doar de OnDialogResponse.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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.