Jump to content

Question

Posted

salut, am facut rentcar pe dialog si cand dau rentcar aleg o masina pica sv, de ce?

6 answers to this question

Recommended Posts

  • 0
Posted

aici codul 

CMD:rentcar(playerid,params[]){

    if(!PlayerToPoint(10.0, playerid,542.3743,-1282.0509,17.2422)) return 1;
             if(RentVehicle[playerid] != 0) return SCM(playerid,-1,"Ai deja un vehicul inchiriat");

             ShowPlayerDialog(playerid, DIALOG_RENT, DIALOG_STYLE_LIST, "Rent Car","Infernus\nSultan\nCheetah\nBuffalo\nBanshee\nVoodo" , "Select","Cancel");


return 1;

}

 

  • 0
Posted
Acum 1 minut, Waller669 a spus:

aici codul 

CMD:rentcar(playerid,params[]){

    if(!PlayerToPoint(10.0, playerid,542.3743,-1282.0509,17.2422)) return 1;
             if(RentVehicle[playerid] != 0) return SCM(playerid,-1,"Ai deja un vehicul inchiriat");

             ShowPlayerDialog(playerid, DIALOG_RENT, DIALOG_STYLE_LIST, "Rent Car","Infernus\nSultan\nCheetah\nBuffalo\nBanshee\nVoodo" , "Select","Cancel");


return 1;

}

 

Ai zis cand dai pe masina iti pica sv nu cand dai /rentcar iti pica, deci am nevoie doar de DIALOG_RENT.

  • 0
Posted

asta ? 


         case DIALOG_RENT: {
        if(!response) return 1;
        SetPVarInt(playerid, "listitem", listitem);
        new string[64];
        format(string,sizeof(string),"Pentru cate minute vrei sa inchiriezi un vehicul?\nPret;$%d/minut",RENT_PRICE);
        ShowPlayerDialog(playerid, DIALOG_RENT+1, DIALOG_STYLE_INPUT, "Rent Car", string, "Select", "Cancel");
    }

    case DIALOG_RENT+1:{
    if(!response) return 1;
    listitem = GetPVarInt(playerid, "listitem");
        new minutes  = strval(inputtext),string[128],carid;
    if(minutes < 1 || minutes > 30) return SCM(playerid,-1,"Poti inchiria un vehicul intre 1 si 30 de minute");
    if(GetPlayerMoney(playerid) < minutes  * RENT_PRICE) return SCM(playerid,-1,"Nu detii suma necesara de bani");
        GivePlayerCash(playerid,- minutes*RENT_PRICE);
                Update(pCashx);
       switch(listitem){
              case 0:{
                  format(string,sizeof(string),"Ai inchiriat un infernus pentru %d minute si ai platit $%d",minutes,minutes*RENT_PRICE);
                  RentVehicle[playerid] = CreateVehicle(411, 542.3743,-1282.0509,17.2422, 90, -1, -1,300);


              }

              case 1:{
                  format(string,sizeof(string),"Ai inchiriat un sultan pentru %d minute si ai platit $%d",minutes,minutes*RENT_PRICE);
                  RentVehicle[playerid] = CreateVehicle(560, 542.3743,-1282.0509,17.2422, 90, -1, -1,300);


              }

                 case 2:{
                  format(string,sizeof(string),"Ai inchiriat un cheetah pentru %d minute si ai platit $%d",minutes,minutes*RENT_PRICE);
                  RentVehicle[playerid] = CreateVehicle(415, 542.3743,-1282.0509,17.2422, 90, -1, -1,300);


              }


                 case 3:{
                  format(string,sizeof(string),"Ai inchiriat un buffalo pentru %d minute si ai platit $%d",minutes,minutes*RENT_PRICE);
                  RentVehicle[playerid] = CreateVehicle(402, 542.3743,-1282.0509,17.2422, 90, -1, -1,300);


              }

                    case 4:{
                  format(string,sizeof(string),"Ai inchiriat un banshee pentru %d minute si ai platit $%d",minutes,minutes*RENT_PRICE);
                  RentVehicle[playerid] = CreateVehicle(429, 542.3743,-1282.0509,17.2422, 90, -1, -1,300);


              }

                            case 5:{
                  format(string,sizeof(string),"Ai inchiriat un voodo pentru %d minute si ai platit $%d",minutes,minutes*RENT_PRICE);
                  RentVehicle[playerid] = CreateVehicle(412, 542.3743,-1282.0509,17.2422, 90, -1, -1,300);

              }

       }
       RentVehicle[playerid] = 1;
       PlayerTimer[playerid] = SetTimer("RentCar", 60000 * minutes, false,"%d",playerid);
       SCM(playerid, -1 ,string);
    }
 

  • 0
Posted

Nu pare a fi nimic aiurea in codul ala, cand dai pe rentcar la masina acolo, du-te in server.log si fa o poza 

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.