Jump to content
Welcome Guest

Problema sellcar


Zorzonel

Recommended Posts

Salut, sunt nou in in scripting si am si eu o problema la sellcar pentru ds cand vand o masina si o cumpar eu sau alt cineva unele sisteme raman salvate cum ar fi stage rainbow vip plus neon, dar in mare parte am vazut ca ramane salvat doar vip plus si neon-ul. Nu stiu cum sa rezolv, ma poate ajuta cineva va rog frumos din suflet?

Am lasat mai jos codul, am uitat sa precizez dar folosesc gamemode hpq123

 

        case DIALOG_SELLCAR: {
            if(!response) return true;
            new vsid = PlayerSellCar[playerid];
            if(CarInfo[vsid][Spawned] == 0) return true;
                        
            new value;
            if(CarInfo[vsid][cSpecial] != 1) value = CarInfo[vsid][cValue] / 2;
            else value = CarInfo[vsid][cValue];

            GivePlayerCash(playerid, 1, value);
            format(string, sizeof(string), "Ai primit $%s pentru ca ti-ai vandut vehiculul!",FormatNumber(value), "%%");
            SCM(playerid,COLOR_MONEY,string);
                        
            format(string, sizeof(string), "%s si-a vandut vehiculul %s[%d] (la stat) si a primit $%s.", GetName(playerid), aVehicleNames[CarInfo[vsid][cModel]-400], vsid, FormatNumber(value));
            SendAdminMessage(COLOR_YELLOW, string, 1); 
            InsertLog(playerid, string, LOG_CAR);    
            DestroyPlayerCar(vsid);
            Iter_Remove(MyVehicle[playerid], vsid);
            Iter_Remove(PersonalVehicles, vsid);
            mysql_format(SQL, gQuery, sizeof(gQuery), "DELETE FROM `cars` WHERE `ID`='%d' LIMIT 1", CarInfo[vsid][cID]);
            mysql_tquery(SQL, gQuery, "", "");
            foreach(Player, i) {
                if(IsPlayerConnected(i) && IsPlayerLogged[i] == 1) {
                    if(GetPVarInt(i, "OfferBy") == playerid) {
                        SCM(playerid, -1, "Afacerea a fost anulata!");
                        SCM(i, -1, "Afacerea a fost anulata!");
                        SetPVarInt(i, "OfferBy", -1);        
                    }
                    if(TradePlayer[i] == playerid) {
                        SCM(playerid, -1, "Afacerea a fost anulata!");
                        SCM(i, -1, "Afacerea a fost anulata!");                
                        TradePlayer[i] = -1;
                    }
                }
            }            
        }

si inca codul asta

                case 5: {
                    if(TradeID[playerid] != -1) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti folosi aceasta comanda atata timp cat esti implicat intr-o afacere!");
                    if(CarInfo[vsid][Spawned] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Vehiculul tau nu este spawnat!");
                    if(!PlayerToPoint(5,playerid, 1487.0498,-2287.2930,13.7529)) return SCM(playerid, COLOR_WHITE, "Trebuie sa fii la dealership. Foloseste /gps pentru a afla unde este.");
                    if(IsAttached(CarInfo[vsid][Spawned])) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu poti folosi aceasta functie momentan!");
                    new value;
                    if(CarInfo[vsid][cSpecial] != 1) value = CarInfo[vsid][cValue] / 2;
                    else value = CarInfo[vsid][cValue];
                    format(string, sizeof(string), "You're sure you want to sell your %s for %s?",aVehicleNames[CarInfo[vsid][cModel]-400],FormatNumber(value));
                    ShowPlayerDialog(playerid, DIALOG_SELLCAR, DIALOG_STYLE_MSGBOX, "Dealership", string, "Select", "Cancel");
                    PlayerSellCar[playerid] = vsid;
                    if(CP[playerid] == 43 || CP[playerid] == 53) { CP[playerid] = 0; DisablePlayerCheckpointEx(playerid); }
                }

Va rog sa ma ajutati ca sunt nou aici si vreau sa invat cat mai multe dar bug-ul acesta nu il pot rezolva. Multumesc mult!

Edited by Zorzonel
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
Reply to this topic...

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

About Us ABOUT US

L2P.RO este un site web dedicat comunității de gaming din România, care oferă resurse și informații utile pentru dezvoltatorii de jocuri și jucătorii de jocuri precum SAMP (San Andreas Multiplayer) și alte jocuri.

General IMPORTANT LINKS

Colors Chose your color

Header Backgrounds Chose your background

Styles Chose your style

Index Options Chose index options

2
3
Subforum Columns You can choose how many columns to display your subforums

Overall Options Chose overall options

Header Style Choose between a colored or black/white header
Header Position Choose between a relative or sticky header position
Sidebar Visibility You can hide or unhide your sidebar whenever you want
Back To Top Position You can choose where the back to top button should appear, left or right

×
×
  • Create New...