Jump to content
  • 0

car ownership


Xhizors

Question

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
  • Similar Content

    • By CristianLMAO
      Salut!
      Astazi o sa va prezint primul meu sistem pus pe acest site, si o sa va explic ce face fiecare lucru.
      Hai sa incepem.
      Sistemul arata cam asa:

      (dialogul este pozitionat mai in drapta din cauza rezolutiei mele)
      IMPORTANT:
      IN CODUL DE MAI JOS ESTE DECAT CE MAI TREBUIE ADAUGAT, NU TOT GAMEMODUL!!
      TUTORIAL:
       
      //punem include-urile care ne trebuie la acest sistem #include <zcmd>  
      //prima data facem o comanda, dar atentie, ACEASTA COMANDA O POATE FOLOSI ORICINE, daca doriti ca doar admini sa o poata folosi, folositi comanda hasurata! CMD:v(playerid, params[]){ ShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT, "Spawn car", "Write your car id: (Min. 400 / Max. 611)", "Spawn", "Close"); //cand scriem "/v" apare acest dialog return 1; } //DACA DORITI SA FIE COMANDA ASTA ACCESIBILA DOAR LA ADMIN: //CMD:v(playerid, params[]){ // // if (IsPlayerAdmin(playerid)) // daca jucatorul este admin: // { // ShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT, "Spawn car", "Write your car id: (Min. 400 / Max. 611)", "Spawn", "Close"); //cand scriem "/v" apare acest dialog // } // else{ //daca nu: // SendClientMessage(playerid, 0xFF000090, "You're not admin!"); // } // return 1; //}  
      public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){ if(dialogid == 1){ // cand raspunde la dialogul cu id-ul 1 se intampla asta: if(!response) return SendClientMessage(playerid, 0xFF000099, "You closed the menu!"); // daca apasa pe butonul de inchidere, acest meniu o sa se inchida. if(strval(inputtext) < 400) return SendClientMessage(playerid, 0xFF000099, "Your car id is under 400!"); // Daca id-ul scris este mai mic de 400 o sa scrie asta if(strval(inputtext) > 611) return SendClientMessage(playerid, 0xFF000099, "Your car id is over 611!"); // Daca id-ul scris este mai mare de 611 o sa scrie asta // inputtext inseamna ce a scris jucatorul in text-box. new Float:X; new Float:Y; new Float:Z; GetPlayerPos(playerid,X,Y,Z); // aici seteaza valoarea lui X, Y si Z in coordonatele juactorului CreateVehicle(strval(inputtext),X,Y+5,Z,1,1,1,90000); //spawneaza masina cu id-ul din textbox, la coordonatele playerului return 1; } }  
      Daca este sa fi omis ceva, sau daca doriti sa imbunatatesc acest sistem, puteti spune in comentarii.
    • By Shad0wdpbgd
      Salut, am o problema. Problema fiind ca eu chiar daca am o masina inchiriata, nu pot sa folosesc comanda /lockrent. Efectiv nu imi zice nimic si nici nu se incuie/descuie masina.
      YCMD:lockrent(playerid, params[], help)
      {
          if(PlayerInfo[playerid][pRentCar] == 0) return 1;
          new engine, lights, alarm, doors, bonnet, boot, objective;
          GetVehicleParamsEx(rentcar, engine, lights, alarm, doors, bonnet, boot, objective);
          if(doors == 0)
          {
              va_GameTextForPlayer(playerid, "~W~%s~N~~R~LOCKED", 5000, 4, getVehicleName(rentcar)); 
              SCM(playerid, -1, "locked");
              SetVehicleParamsEx(rentcar, engine, lights, alarm, VEHICLE_PARAMS_ON, bonnet, boot, objective);
          }
          if(doors == 1)
          {
              va_GameTextForPlayer(playerid, "~W~%s~N~~G~UNLOCKED", 5000, 4, getVehicleName(rentcar)); 
              SetVehicleParamsEx(rentcar, engine, lights, alarm, VEHICLE_PARAMS_OFF, bonnet, boot, objective);
          }    
          return true;
      }
       
      Dialog:DIALOG_RENTCAR(playerid, response, listitem)
      {
          if(!response) return true;
          if(!PlayerToPoint(5.0, playerid, 542.1693,-1293.2416,17.2422)) return SCM(playerid, COLOR_GREY, "You are not at the right location.");
          if(PlayerInfo[playerid][pRentCar] == 1) return SCM(playerid, -1, "Ai deja o masina inchiriata.");
          switch(listitem)
          {
              case 0:
              {    
                  if(getMoney(playerid) < 50000) return SCM(playerid, COLOR_GREY, "You don't have $50,000.");
                  PlayerInfo[playerid][pRentCar] = 1;
                  rentcar = CreateVehicle(411, 561.8007,-1290.3135,16.9753,0.2764, -1, -1, -1);
                  SetVehicleNumberPlate(rentcar, "Rent");
                  GivePlayerMoneyEx(playerid, -50000);
                  SCM(playerid, -1, "You have rented a Infernus for $50,000 until you explode it.");
                  PutPlayerInVehicle(playerid, rentcar, 0);
                  vehicle_personal[rentcar] = -1;
                  vehicle_fuel[rentcar] = 100;
                  new engine, lights, alarm, doors, bonnet, boot, objective;
                  GetVehicleParamsEx(rentcar, engine, lights, alarm, doors, bonnet, boot, objective);
                  SetVehicleParamsEx(rentcar, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
              }
              case 1:
              {    
                  if(getMoney(playerid) < 40000) return SCM(playerid, COLOR_GREY, "You don't have $40,000.");
                  PlayerInfo[playerid][pRentCar] = 1;
                   rentcar = CreateVehicle(560, 561.8007,-1290.3135,16.9753,0.2764, -1, -1, -1);
                  SetVehicleNumberPlate(rentcar, "Rent");
                  GivePlayerMoneyEx(playerid, -40000);
                  SCM(playerid, -1, "You have rented a Sultan for $40,000 until you explode it.");
                  PutPlayerInVehicle(playerid, rentcar, 0);
                  vehicle_personal[rentcar] = -1;
                  vehicle_fuel[rentcar] = 100;
                  new engine, lights, alarm, doors, bonnet, boot, objective;
                  GetVehicleParamsEx(rentcar, engine, lights, alarm, doors, bonnet, boot, objective);
                  SetVehicleParamsEx(rentcar, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
              }    
              case 2:
              {    
                  if(getMoney(playerid) < 30000) return SCM(playerid, COLOR_GREY, "You don't have $30,000.");
                  PlayerInfo[playerid][pRentCar] = 1;
                  rentcar = CreateVehicle(522, 561.8007,-1290.3135,16.9753,0.2764, -1, -1, -1);
                  SetVehicleNumberPlate(rentcar, "Rent");
                  GivePlayerMoneyEx(playerid, -30000);
                  SCM(playerid, -1, "You have rented a NRG-500 for $30,000 until you explode it. Pr");
                  PutPlayerInVehicle(playerid, rentcar, 0);
                  vehicle_personal[rentcar] = -1;
                  vehicle_fuel[rentcar] = 100;
                  new engine, lights, alarm, doors, bonnet, boot, objective;
                  GetVehicleParamsEx(rentcar, engine, lights, alarm, doors, bonnet, boot, objective);
                  SetVehicleParamsEx(rentcar, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);        
              }    
              case 3:
              {    
                  if(getMoney(playerid) < 20000) return SCM(playerid, COLOR_GREY, "You don't have $20,000.");
                  PlayerInfo[playerid][pRentCar] = 1;
                  rentcar = CreateVehicle(506, 561.8007,-1290.3135,16.9753,0.2764, -1, -1, -1);
                  SetVehicleNumberPlate(rentcar, "Rent");
                  GivePlayerMoneyEx(playerid, -20000);
                  SCM(playerid, -1, "You have rented a Super GT for $20,000 until you explode it.");
                  PutPlayerInVehicle(playerid, rentcar, 0);
                  vehicle_personal[rentcar] = -1;
                  vehicle_fuel[rentcar] = 100;
                  new engine, lights, alarm, doors, bonnet, boot, objective;
                  GetVehicleParamsEx(rentcar, engine, lights, alarm, doors, bonnet, boot, objective);
                  SetVehicleParamsEx(rentcar, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);        
              }
              case 4:
              {    
                  if(getMoney(playerid) < 10000) return SCM(playerid, COLOR_GREY, "You don't have $10,000.");
                  PlayerInfo[playerid][pRentCar] = 1;
                  rentcar = CreateVehicle(426, 561.8007,-1290.3135,16.9753,0.2764, -1, -1, -1);
                  SetVehicleNumberPlate(rentcar, "Rent");
                  GivePlayerMoneyEx(playerid, -10000);
                  SCM(playerid, -1, "You have rented a Premier for $10,000 until you explode it.");
                  PutPlayerInVehicle(playerid, rentcar, 0);
                  vehicle_personal[rentcar] = -1;
                  vehicle_fuel[rentcar] = 100;
                  new engine, lights, alarm, doors, bonnet, boot, objective;
                  GetVehicleParamsEx(rentcar, engine, lights, alarm, doors, bonnet, boot, objective);
                  SetVehicleParamsEx(rentcar, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);            
              }
              case 5:
              {    
                  if(getMoney(playerid) < 7000) return SCM(playerid, COLOR_GREY, "You don't have $7,000.");
                  PlayerInfo[playerid][pRentCar] = 1;
                  rentcar = CreateVehicle(521, 561.8007,-1290.3135,16.9753,0.2764, -1, -1, -1);
                  SetVehicleNumberPlate(rentcar, "Rent");
                  GivePlayerMoneyEx(playerid, -7000);
                  SCM(playerid, -1, "You have rented a FCR-900 for $7,000 until you explode it.");
                  PutPlayerInVehicle(playerid, rentcar, 0);
                  vehicle_personal[rentcar] = -1;
                  vehicle_fuel[rentcar] = 100;
              
                  new engine, lights, alarm, doors, bonnet, boot, objective;
                  GetVehicleParamsEx(rentcar, engine, lights, alarm, doors, bonnet, boot, objective);
                  SetVehicleParamsEx(rentcar, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
              }
              case 6:
              {    
                  if(getMoney(playerid) < 5000) return SCM(playerid, COLOR_GREY, "You don't have $5,000.");
                  PlayerInfo[playerid][pRentCar] = 1;
                  rentcar = CreateVehicle(510, 561.8007,-1290.3135,16.9753,0.2764, -1, -1, -1);
                  GivePlayerMoneyEx(playerid, -5000);
                  SCM(playerid, -1, "You have rented a Mountain Bike for $5,000.");
                  PutPlayerInVehicle(playerid, rentcar, 0);
                  vehicle_personal[rentcar] = -1;
                  vehicle_fuel[rentcar] = 100;
                  new engine, lights, alarm, doors, bonnet, boot, objective;
                  GetVehicleParamsEx(rentcar, engine, lights, alarm, doors, bonnet, boot, objective);
                  SetVehicleParamsEx(rentcar, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);            
              }                        
          }
          return true;
      }
       
      // Si  mai am o problema, la pcolor, eu am salvat culoarea in baza de date, dar cand intru pe samp si scriu ceva imi arata culoarea aia normala (gri)
      Dialog:DIALOG_COLOR(playerid, response, listitem)
      {
          if(!response) return true;
          SelectColor[playerid] = listitem;
          SCMF(playerid, -1, "{%s}Server: {FFFFFF}Hope you like your new color!", playerColors(listitem));
          mysqlQuery("UPDATE `server_accounts` SET `Color` = '%d' WHERE `ID`= '%d'", listitem, PlayerInfo[playerid][pSQLID]);
          PlayerInfo[playerid][pColor] = listitem;
          return true;
      }
       
      public OnPlayerText(playerid, text[])
      {
          if(IsPlayerLogged(playerid))
          {
              if(PlayerInfo[playerid][pMute] > gettime())
              {
                  SCMF(playerid, COLOR_GREY, "You can't type right now! You are still muted for %d %s.", ((PlayerInfo[playerid][pMute] - gettime()) > 60) ? ((PlayerInfo[playerid][pMute] - gettime()) / 60) : (PlayerInfo[playerid][pMute] - gettime()), ((PlayerInfo[playerid][pMute] - gettime()) > 60) ? ("minutes") : ("seconds"));
                  return false;
              }
              SendNearby(playerid, COLOR_WHITE, 25.0, "{%s}%s: {FFFFFF}%s", playerColors(SelectColor[playerid]), GetName(playerid), text);
              SetPlayerChatBubble(playerid, text, COLOR_CIVIL, 25.0, 5000);    
              gQuery[0] = (EOS);
              mysql_format(SQL, gQuery, sizeof(gQuery), "INSERT INTO `server_chat_log` (Name, Text) VALUES ('%s', '%s')", GetName(playerid), text);
              mysql_pquery(SQL, gQuery, "", "");        
          }
          return false;
      }
    • By CosminAK47
      (1:30 - 2:24)
      Download: Click
      Images:  Click
    • By MihaiADV
      Un System de rent car
      Link: 

    • By Catalin Soare
      Nu imi consuma bani atunci cand merg cu masina de la rent.
  • 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.