Szerző Téma: Autó spawnolás egybõl  (Megtekintve 1020 alkalommal)

Nem elérhető Szilard

  • Adminisztrátor
  • 1832
    • Profil megtekintése
Autó spawnolás egybõl
« Dátum: 2011. február 16. - 19:32:19 »
0 Show voters
Üdv.
Az lenne a problémám,hogy mikor belép a player,akkor ha kocsit szeretne használni be kell írnia hogy /kocsi spawn1 (vagy spawn2 vagy spawn3).És ha nem írja be nem is jelenik meg,és max 1 kocsi lehet lespawnolva.
Azt szeretném,ha amikor elindult a szerver,ahány autója van mindet spawnolja le.Hogy lenne megoldható?
A parancsok:
 
else if(SmallLifeParancs(x_job,\"spawn1\",true) == 0)
        {
      if(PlayerInfo[playerid][pCarkey] == SCRIPT_CARS) {
                   SmallLifeMessage(playerid,COLOR_GREY,\"Neked nincs 1es számú kocsid.\");
                   return 1;
                  }
            if(CarInfo[PlayerInfo[playerid][pCarkey]][cImpounded]==1) {
                SmallLifeMessage(playerid,COLOR_GREY,\"Your car is impounded, Go to the PD and pay your fine!\");
                return 1;
      }
      if(CarInfo[PlayerInfo[playerid][pCarkey]][cOwned] == 0)
      {
         PlayerInfo[playerid][pCarkey] = SCRIPT_CARS;
                  }
                  if(ForwardOwnCar(1,playerid)) { SmallLifeMessage(playerid,COLOR_GREY,\"Neked már le van spawnolva egy kocsid,írd be hogy /v despawn!\"); return 1; }
              else if(ForwardOwnCar(2,playerid)) { SmallLifeMessage(playerid,COLOR_GREY,\"Neked már le van spawnolva egy kocsid,írd be hogy /v despawn!\"); return 1; }
              else if(ForwardOwnCar(3,playerid)) { SmallLifeMessage(playerid,COLOR_GREY,\"Neked már le van spawnolva egy kocsid,írd be hogy /v despawn!\"); return 1; }
              else
         {
         new key = PlayerInfo[playerid][pCarkey];
                  new carid;
                  carid = SmallLifeVehicle(CarInfo[key][cModel],CarInfo[key][cLocationx],CarInfo[key][cLocationy],CarInfo[key][cLocationz]+1.0,CarInfo[key][cAngle],CarInfo[key][cColorOne],CarInfo[key][cColorTwo],3600);
                  VehSpawned[carid] = 1;
                  GameTextForPlayer(playerid, \"~w~Auto ~g~Spawnolva!\", 5000, 1);
                  VehicleOwned[carid] = key;
                  SetVehicleToRespawn(carid);
                  LoadMods(carid,key);
                  SetVehicleNumberPlate(carid, CarInfo[key][cPlate]);
 
                  if(CarInfo[key][cFuel] > 0)
         {
             Gas[carid] = CarInfo[key][cFuel];
         }
         else
         {
             Gas[carid] = 100;
         }
                  VehicleWindows[carid] = 0;
                  }
      return 1;
            }
            else if(SmallLifeParancs(x_job,\"spawn2\",true) == 0)
        {
                  if(PlayerInfo[playerid][pCarkey2] == SCRIPT_CARS)
                  {
                   SmallLifeMessage(playerid,COLOR_GREY,\"HIBA:Nincs 2es számú kocsid.\");
                   return 1;
                  }
            if(CarInfo[PlayerInfo[playerid][pCarkey2]][cImpounded]==1) {
                SmallLifeMessage(playerid,COLOR_GREY,\"Your car is impounded, Go to the PD and pay your fine!\");
                return 1;
      }
                if(CarInfo[PlayerInfo[playerid][pCarkey2]][cOwned] == 0)
                {
                    PlayerInfo[playerid][pCarkey2] = SCRIPT_CARS;
                }
                if(ForwardOwnCar(1,playerid)) { SmallLifeMessage(playerid,COLOR_GREY,\"Neked már le van spawnolva egy kocsid,írd be hogy /v despawn!\"); return 1; }
            else if(ForwardOwnCar(2,playerid)) { SmallLifeMessage(playerid,COLOR_GREY,\"Neked már le van spawnolva egy kocsid,írd be hogy /v despawn!\"); return 1; }
            else if(ForwardOwnCar(3,playerid)) { SmallLifeMessage(playerid,COLOR_GREY,\"Neked már le van spawnolva egy kocsid,írd be hogy /v despawn!\"); return 1; }
       else
       {
       new key = PlayerInfo[playerid][pCarkey2];
       new carid;
                carid = SmallLifeVehicle(CarInfo[key][cModel],CarInfo[key][cLocationx],CarInfo[key][cLocationy],CarInfo[key][cLocationz]+1.0,CarInfo[key][cAngle],CarInfo[key][cColorOne],CarInfo[key][cColorTwo],3600);
                VehSpawned[carid] = 1;
                GameTextForPlayer(playerid, \"~w~Kocsi2 ~g~Spawnolva\", 5000, 1);
                VehicleOwned[carid] = key;
                SetVehicleToRespawn(carid);
                LoadMods(carid,key);
                SetVehicleNumberPlate(carid, CarInfo[key][cPlate]);
                if(CarInfo[key][cFuel] > 0)
       {
           Gas[carid] = CarInfo[key][cFuel];
       }
       else
       {
           Gas[carid] = 100;
       }
                VehicleEngine[carid] = 0;
                VehicleWindows[carid] = 0;
                }
                return 1;
            }
            else if(SmallLifeParancs(x_job,\"spawn3\",true) == 0)
        {
               if(PlayerInfo[playerid][pCarkey3] == SCRIPT_CARS)
               {
                   SmallLifeMessage(playerid,COLOR_GREY,\"Neked nincs 3as számú kocsid.\");
                   return 1;
               }
           if(CarInfo[PlayerInfo[playerid][pCarkey3]][cImpounded]==1) {
                SmallLifeMessage(playerid,COLOR_GREY,\"Your car is impounded, Go to the PD and pay your fine!\");
                return 1;
      }
               if(CarInfo[PlayerInfo[playerid][pCarkey3]][cOwned] == 0)
               {
                   PlayerInfo[playerid][pCarkey3] = SCRIPT_CARS;
                   return 1;
               }
               if(ForwardOwnCar(1,playerid)) { SmallLifeMessage(playerid,COLOR_GREY,\"Neked már le van spawnolva egy kocsid,írd be hogy /v despawn!\"); return 1; }
           else if(ForwardOwnCar(2,playerid)) { SmallLifeMessage(playerid,COLOR_GREY,\"Neked már le van spawnolva egy kocsid,írd be hogy /v despawn!\"); return 1; }
           else if(ForwardOwnCar(3,playerid)) { SmallLifeMessage(playerid,COLOR_GREY,\"Neked már le van spawnolva egy kocsid,írd be hogy /v despawn!\"); return 1; }
           else
      {
      new key = PlayerInfo[playerid][pCarkey3];
      new carid;
               carid = SmallLifeVehicle(CarInfo[key][cModel],CarInfo[key][cLocationx],CarInfo[key][cLocationy],CarInfo[key][cLocationz]+1.0,CarInfo[key][cAngle],CarInfo[key][cColorOne],CarInfo[key][cColorTwo],3600);
               VehSpawned[carid] = 1;
               GameTextForPlayer(playerid, \"~w~Kocsi3 ~g~Spawnolva\", 5000, 1);
               VehicleOwned[carid] = key;
               SetVehicleToRespawn(carid);
               LoadMods(carid,key);
               SetVehicleNumberPlate(carid, CarInfo[key][cPlate]);
               if(CarInfo[key][cFuel] > 0)
      {
          Gas[carid] = CarInfo[key][cFuel];
      }
      else
      {
          Gas[carid] = 100;
      }
               VehicleEngine[carid] = 0;
               VehicleWindows[carid] = 0;
               }
               return 1;
            }

Nem elérhető DrAkE

  • 2078
    • Profil megtekintése
Autó spawnolás egybõl
« Válasz #1 Dátum: 2011. február 16. - 19:37:40 »
0 Show voters
Ehh és most ennek mi értelme hogy bekkel írnia elõtte hogy spawn1,spawn2,spawn3. Akkor már használnád az enyémet azzal csak 1 kocsit lehet lespawnolni.

Nem elérhető Szilard

  • Adminisztrátor
  • 1832
    • Profil megtekintése
Autó spawnolás egybõl
« Válasz #2 Dátum: 2011. február 16. - 20:27:20 »
0 Show voters
Ezt szeretném kivenni...

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal