Jump to content
  • 0

Ajutor restrictie


Extremys

Question

Spoiler

if(strcmp(cmd, "/buycar", true) == 0)


    {
        if(IsPlayerInRangeOfPoint(playerid, 6.0,329.3534,-1511.9949,36.039))//
        {
            if(PlayerInfo[playerid][pLevel] < 3) return  SCM(playerid,COLOR_WHITE,"Nu ai level 3.");
            ShowPlayerDialog(playerid, DIALOG_BUYCAR, DIALOG_STYLE_LIST,
            "SERVER: Vehicle Dealership", "Cheap Vehicles\nNormal Vehicles\nExpensive Vehicles\nLux Vehicles\nMotorcycles\nPremium Vehicles",
            "Select", "Cancel");
        }
        else return SCM(playerid,COLOR_WHITE,"Nu esti la dealership.");
 }

Problema intalnita (descriere):Vreau ca la comanda /buycar sa verifice daca are sloturile ocupate iar daca le are ocupate sa nu il lase pe player sa deschida dialogul si sa ii transmita mesajul ca are sloturile ocupate. Am incerca sa fac singur nu imi dadea erore/warning dar imi transmitea mesajul ca am toate sloturile ocupate dar nu le aveam.
Ero(area / rile) / warning-(ul / urile):-
Liniile de cod / sursa / script-ul(obligatoriu): Sus este cea "originala".
Imagini / Video (optional):
Ati incercat sa rezolvati singur?:Da am incercat aveti mai jos ce am incercat sa fac si unde nu dadea eroare/warning dar pur si simplu imi transmitea mesajul chiar daca aveam sloturi libere.

Aici e ce am incercat sa fac(jos)

Spoiler

 

    if(strcmp(cmd, "/buycar", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 6.0,329.3534,-1511.9949,36.039))//
        {
            if(PlayerInfo[playerid][pCarKey] < 999 || PlayerInfo[playerid][pCarKey2] < 999 || PlayerInfo[playerid][pCarKey3] < 999 || PlayerInfo[playerid][pCarKey4] < 999 || PlayerInfo[playerid][pCarKey5] < 999 || PlayerInfo[playerid][pCarKey6] < 999 || PlayerInfo[playerid][pCarKey] < 999) return  SCM(playerid,COLOR_WHITE,"Ai deja toate sloturile ocupate");
            if(PlayerInfo[playerid][pLevel] < 3) return  SCM(playerid,COLOR_WHITE,"Nu ai level 3.");
            ShowPlayerDialog(playerid, DIALOG_BUYCAR, DIALOG_STYLE_LIST,
            "SERVER: Vehicle Dealership", "Cheap Vehicles\nNormal Vehicles\nExpensive Vehicles\nLux Vehicles\nMotorcycles\nPremium Vehicles",
            "Select", "Cancel");
        }
        else return SCM(playerid,COLOR_WHITE,"Nu esti la dealership.");
 }

 

Stiu ca nu prea am facut bine in sensu ca, eu asa cred ca ar verifica chiar daca sloturile nu ii apar la /v adica daca nu are cont premium sa aiba sloturile deblocate, dar eu doar am incercat sa vad daca reusesc in caz ca reusam faceam pe parcurs tot, este si tarziu nu prea mai "gandesc".

 

Edited by Extremys

giphy.gif

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0
5 hours ago, Mister said:

Ai cumva functia GetVehNumber la comanda /v de exemplu?

Uite aici si comanda /v nu am gasit nici un getvehnumber

    if(strcmp(cmd, "/cars", true) == 0 || strcmp(cmd,"/v", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pCarKey] == 999 && PlayerInfo[playerid][pCarKey2] == 999 && PlayerInfo[playerid][pCarKey3] == 999 && PlayerInfo[playerid][pCarKey4] == 999)
                return SCM(playerid, COLOR_WHITE, "Nu ai o masina personala.");

            new dtext[555];
            new
                carkey1 = PlayerInfo[playerid][pCarKey],
                carkey2 = PlayerInfo[playerid][pCarKey2],
                carkey3 = PlayerInfo[playerid][pCarKey3],
                carkey4 = PlayerInfo[playerid][pCarKey4],
                carkey5 = PlayerInfo[playerid][pCarKey5],
                carkey6 = PlayerInfo[playerid][pCarKey6],
                carkey7 = PlayerInfo[playerid][pCarKey7];

            if(carkey1 < 999) {
                format(string, 256, "{ECC962}(Slot 1) >> {00FF00}%s\n", VehicleNames[GetVehicleModel(carkey1)-400]);
                strcat(dtext, string);
            }
            else strcat(dtext, "{FF0000}<slot liber>\n");

            if(carkey2 < 999) {
                format(string, 256, "{ECC962}(Slot 2) >> {00FF00}%s\n", VehicleNames[GetVehicleModel(carkey2)-400]);
                strcat(dtext, string);
            }
            else strcat(dtext, "{FF0000}<slot liber>\n");

            if(carkey3 < 999) {
                format(string, 256, "{ECC962}(Slot 3) >> {00FF00}%s\n", VehicleNames[GetVehicleModel(carkey3)-400]);
                strcat(dtext, string);
            }
            else strcat(dtext, "{FF0000}<slot liber>\n");

            if(PlayerInfo[playerid][pPremium] >= 1)
            {
                if(carkey4 < 999) {
                    format(string, 256, "{ECC962}(Slot 4) >> {00FF00}%s\n", VehicleNames[GetVehicleModel(carkey4)-400]);
                    strcat(dtext, string);
                }
                else strcat(dtext, "{FF0000}<slot liber>\n");

                if(carkey5 < 999) {
                    format(string, 256, "{ECC962}(Slot 5) >> {00FF00}%s\n", VehicleNames[GetVehicleModel(carkey5)-400]);
                    strcat(dtext, string);
                }
                else strcat(dtext, "{FF0000}<slot liber>\n");
            }

            if(PlayerInfo[playerid][pPremium] == 2)
            {
                if(carkey6 < 999) {
                    format(string, 256, "{ECC962}(Slot 6) >> {00FF00}%s\n", VehicleNames[GetVehicleModel(carkey6)-400]);
                    strcat(dtext, string);
                }
                else strcat(dtext, "{FF0000}<slot liber>\n");

                if(carkey7 < 999) {
                    format(string, 256, "{ECC962}(Slot 7) >> {00FF00}%s\n", VehicleNames[GetVehicleModel(carkey7)-400]);
                    strcat(dtext, string);
                }
                else strcat(dtext, "{FF0000}<slot liber>\n");
            }
            ShowPlayerDialog(playerid, 252, DIALOG_STYLE_LIST, "{ECC962} Masini Personale", dtext, "Selecteaza", "Iesire");
        }
        return 1;
    }

giphy.gif

Link to comment
Share on other sites

  • 0

In comanda ta /buycar la cpdul acesta

if(PlayerInfo[playerid][pCarKey] < 999 || PlayerInfo[playerid][pCarKey2] < 999 || PlayerInfo[playerid][pCarKey3] < 999 || PlayerInfo[playerid][pCarKey4] < 999 || PlayerInfo[playerid][pCarKey5] < 999 || PlayerInfo[playerid][pCarKey6] < 999 || PlayerInfo[playerid][pCarKey] < 999) return  SCM(playerid,COLOR_WHITE,"Ai deja toate sloturile ocupate");

 

Inlouiste ast ||  cu &&  ai de 6ori || deci inlocuiesti compilezi si vezi daca merge

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
24 minutes ago, Mister said:

In comanda ta /buycar la cpdul acesta

if(PlayerInfo[playerid][pCarKey] < 999 || PlayerInfo[playerid][pCarKey2] < 999 || PlayerInfo[playerid][pCarKey3] < 999 || PlayerInfo[playerid][pCarKey4] < 999 || PlayerInfo[playerid][pCarKey5] < 999 || PlayerInfo[playerid][pCarKey6] < 999 || PlayerInfo[playerid][pCarKey] < 999) return  SCM(playerid,COLOR_WHITE,"Ai deja toate sloturile ocupate");

 

Inlouiste ast ||  cu &&  ai de 6ori || deci inlocuiesti compilezi si vezi daca merge

Am incercat si tot nu merge, oare din cauza ca le verifica chiar daca nu imi apar toate la /v? adica nu am cont premium

 

giphy.gif

Link to comment
Share on other sites

  • 0

Acum daca am 7 sloturi imi apare mesaju dar daca am 3/3 merge sa cumpar in continuare si inca ceva daca am toate sloturile 7 avand cont premium vand 5 masini iar dupaia la /v zice ca nu mai am masini dar eu am

sa-mp-238.png

sa-mp-239.png

giphy.gif

Link to comment
Share on other sites

  • 0

Pentru ca nu ai sistemul bine facut, nu vezi ca sunt buguite variabilele, nu iti seteaza pcarkey cand trebuie, si de acea merge prpst cand ai 3masini cand vinzi masini si cand ai vip sau nu

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
3 hours ago, Mister said:

Pentru ca nu ai sistemul bine facut, nu vezi ca sunt buguite variabilele, nu iti seteaza pcarkey cand trebuie, si de acea merge prpst cand ai 3masini cand vinzi masini si cand ai vip sau nu

Mda, tu ai facut DealerShip-ul.....

giphy.gif

Link to comment
Share on other sites

  • 0
29 minutes ago, Extremys said:

Mda, tu ai facut DealerShip-ul.....

Sa inteleg ca tie ti-am facut dealershipul, ti-am facut Dealershipul adica comanda buycar cumparatul ei salvatul ei pe ini sistemul de stock price salvat pe ini si comenzile dealerului, nu am umblat la sistemul de masini.

Inainte sa iti fac dealershipul aveai problema asta?

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
23 hours ago, Mister said:

Sa inteleg ca tie ti-am facut dealershipul, ti-am facut Dealershipul adica comanda buycar cumparatul ei salvatul ei pe ini sistemul de stock price salvat pe ini si comenzile dealerului, nu am umblat la sistemul de masini.

Inainte sa iti fac dealershipul aveai problema asta?

Nu nu o aveam

 

giphy.gif

Link to comment
Share on other sites

  • 0

Deci,tu daca nu pCarKey1 sau altele,modifici cu variabilele tale.Tu trebuie sa adaugi aceasta chestie la inceputul comenzi:

Quote

if(IsPlayerInRangeOfPoint(playerid, 4.5, 328.9831,-1513.6188,36.0391))
    {
        if(PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_ERROR, "You need at least level 3 !");
        if(PlayerInfo[playerid][pCarKey] >= 1 && PlayerInfo[playerid][pCarKey1] >= 1 && PlayerInfo[playerid][pPremiumAccount] == 0) return SendClientMessage(playerid, COLOR_ERROR, "* Ai deja 2 masini! (Pentru a detine mai mult de 2 masini ai nevoie de cont premium)");
        if(PlayerInfo[playerid][pCarKey] >= 1 && PlayerInfo[playerid][pCarKey1] >= 1 && PlayerInfo[playerid][pPremiumAccount] == 1)

Dupa ce ai adaugat,mergi unde se termina comanda si adaugi:

Quote

   }
    }
    else SendClientMessage(playerid, COLOR_ERROR, "Nu te aflii la Dealership!");
    return 1;
}

 

 

 

REPET! MODIFICI CU VARIABILELE TALE!

Link to comment
Share on other sites

  • 0
5 hours ago, zNx. said:

Deci,tu daca nu pCarKey1 sau altele,modifici cu variabilele tale.Tu trebuie sa adaugi aceasta chestie la inceputul comenzi:

Dupa ce ai adaugat,mergi unde se termina comanda si adaugi:

 

 

 

REPET! MODIFICI CU VARIABILELE TALE!

Trebuia sa fac o verificare pentru toate sloturile in fiecare caz vam zis ca era seara nu gandeam da uite ce a iesit

Quote

if(strcmp(cmd, "/buycar", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 6.0,329.3534,-1511.9949,36.039))//
        {
            if(PlayerInfo[playerid][pAdmin] >= 6) return SCM(playerid, COLOR_WHITE, "Ai deja comanda /veh!Pentru ce mai vrei masini?");
            if(PlayerInfo[playerid][pCarKey] != 999 && PlayerInfo[playerid][pCarKey2] != 999 && PlayerInfo[playerid][pCarKey3] != 999 && PlayerInfo[playerid][pPremium] == 0) return SCM(playerid, -1, "Ai deja trei masini personale, pentru a avea mai multe masini personale, foloseste {FFFF00}/shop - Premium!");
            if(PlayerInfo[playerid][pCarKey] != 999 && PlayerInfo[playerid][pCarKey2] != 999 && PlayerInfo[playerid][pCarKey3] != 999 && PlayerInfo[playerid][pCarKey4] != 999 && PlayerInfo[playerid][pCarKey5] != 999 && PlayerInfo[playerid][pPremium] == 1)
            return SCM(playerid, -1, "Ai numarul maxim de masini (5), nu mai poti cumpara alta!");
            if(PlayerInfo[playerid][pCarKey] != 999 && PlayerInfo[playerid][pCarKey2] != 999 && PlayerInfo[playerid][pCarKey3] != 999 && PlayerInfo[playerid][pCarKey4] != 999 && PlayerInfo[playerid][pCarKey5] != 999 && PlayerInfo[playerid][pCarKey6] != 999 && PlayerInfo[playerid][pCarKey7] != 999 && PlayerInfo[playerid][pPremium] == 2)
            return SCM(playerid, -1, "Ai numarul maxim de masini (7), nu mai poti cumpara alta!");
            if(PlayerInfo[playerid][pLevel] < 3) return  SCM(playerid,COLOR_WHITE,"Nu ai level 3.");
            ShowPlayerDialog(playerid, DIALOG_BUYCAR, DIALOG_STYLE_LIST,
            "SERVER: Vehicle Dealership", "Cheap Vehicles\nNormal Vehicles\nExpensive Vehicles\nLux Vehicles\nMotorcycles\nPremium Vehicles",
            "Select", "Cancel");
                    }
        else return SCM(playerid,COLOR_WHITE,"Nu esti la dealership.");
        return 1;
    }

Vam spus ca poate fi din cauza ca imi verifica toate sloturile si da aveam dreptate acum am rezolvat

 

Edited by Extremys

giphy.gif

Link to comment
Share on other sites

  • 0
On 08.03.2016 at 13:37, Mister said:

In comanda ta /buycar la cpdul acesta

if(PlayerInfo[playerid][pCarKey] < 999 || PlayerInfo[playerid][pCarKey2] < 999 || PlayerInfo[playerid][pCarKey3] < 999 || PlayerInfo[playerid][pCarKey4] < 999 || PlayerInfo[playerid][pCarKey5] < 999 || PlayerInfo[playerid][pCarKey6] < 999 || PlayerInfo[playerid][pCarKey] < 999) return  SCM(playerid,COLOR_WHITE,"Ai deja toate sloturile ocupate");

 

Inlouiste ast ||  cu &&  ai de 6ori || deci inlocuiesti compilezi si vezi daca merge

Ai facut la fel cum am zis eu aici, ce ai facut atunci si nu ai facut acum? Ai adaugat ppremium? Nu afecta cu nimic

Probabil de la acel  < ca gmul a fost gandit, ca nu se vor crea 1000 de masini, dar tu ai depasit si probabil deaia

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
3 minutes ago, Mister said:

Ai facut la fel cum am zis eu aici, ce ai facut atunci si nu ai facut acum? Ai adaugat ppremium? Nu afecta cu nimic

Probabil de la acel  < ca gmul a fost gandit, ca nu se vor crea 1000 de masini, dar tu ai depasit si probabil deaia

Man incercasem si && si tot nu mergea daca sterg acum si fac decat sa inlocuiesc ce ai zis tu nu mg deoarece daca am doar 3 sloturi el imi verifica si celelalte sloturi pe care nu sunt masini si nu sunt activate(ca nu am cont premum)

Deci daca dau /stats imi apar taote 7 sloturile dar la /v nu imi apare decat 3(daca nu am premium) 5(daca am premium silver) si cand le scriu insirate cum ai zis tu mi le verifica pe toate chiar daca nu am cont premium si de accea imi trimite mesaju mereu sau ma alsa sa cumpar masini chiar daca le am ocupate

giphy.gif

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.