Peršokti į turinį

Pagalbos dėl mašinų spalvų saugojimo


Recommended Posts

Sveiki, susidūriau su tokia problema, jog nusipirkus mašiną ar turint mašina ir padarius RR pasikeičia spalvos, bet padarius tune išlieka.

 

Mašinų krovimai:

stock KraunamMasina1( playerid )
{
   new
      zVardas      [ MAX_PLAYER_NAME ],
      failas      [ 65 ];
 
   GetPlayerName   ( playerid, zVardas, sizeof( zVardas ) );
   format         ( failas, 65, "transportas/%s.ini", zVardas );
   if( dini_Exists( failas) )
   {
         new
            CreatedCar = CreateVehicle( dini_Int( failas, "Modelis" ), dini_Float( failas, "X" ), dini_Float( failas, "Y" ), dini_Float( failas, "Z" ), dini_Float( failas, "F" ), dini_Int( failas, "Spalva1" ),dini_Int( failas,"Spalva2" ), -1 ); //Šią funkciją naudosim jog sukurtų transp. priemonę( paprasta. )
 
         vehicleDB[ CreatedCar ][ locked ] = true;
         SetVehicleHealth(CreatedCar, 1000.0);
         for( new i = 0; i < MAX_PLAYERS;i++ )
         {
            if( i != playerid )
            {
                    SetVehicleParamsForPlayer( CreatedCar, i, 0, 1 );
            }
         }
         vehicleDB[CreatedCar][registruota] = false;
         format( vehicleDB[ CreatedCar ][ owner_name ], MAX_PLAYER_NAME, "%s", dini_Get( failas, "Savininkas" ) );
         SetVehicleHealth( CreatedCar, dini_Float(failas,"Bukle"));
         vehicleDB[ CreatedCar ][lastpos][0] = dini_Float(failas,"X");
         vehicleDB[ CreatedCar ][lastpos][1] = dini_Float(failas,"Y");
         vehicleDB[ CreatedCar ][lastpos][2] = dini_Float(failas,"Z");
         vehicleDB[ CreatedCar ][lastpos][3] = dini_Float(failas,"F");
         vehicleDB[ CreatedCar ][gas] = dini_Int(failas,"Degalai");
         vehicleDB[ CreatedCar ][bagazaz] = dini_Int(failas,"Bagazaz");
         vehicleDB[ CreatedCar ][benzinas] = dini_Int(failas,"Benzinas");
         vehicleDB[ CreatedCar ][dyzelis] = dini_Int(failas,"Dyzelis");
         vehicleDB[ CreatedCar ][dujos] = dini_Int(failas,"Dujos");
         vehicleDB[ CreatedCar ][technikine] = dini_Int(failas,"Technikine");
         vehicleDB[ CreatedCar ][remont] = dini_Int(failas,"Remont");
         vehicleDB[ CreatedCar ][spalva1] = dini_Int(failas,"Spalva1");
         vehicleDB[ CreatedCar ][spalva2] = dini_Int(failas,"Spalva2");
         vehicleDB[ CreatedCar ][paintjob] = dini_Int(failas,"Paintjob");
         vehicleDB[ CreatedCar ][rida] = dini_Float(failas,"Rida");
         if (dini_Int(failas,"Registruota")) vehicleDB[CreatedCar][registruota] = true;
         format(vehicleDB[CreatedCar][numeriai],9,"%s",dini_Get(failas,"Numeriai"));
   SetVehicleNumberPlate(CreatedCar,vehicleDB[CreatedCar][numeriai]);
         ChangeVehicleColor      ( CreatedCar, vehicleDB[ CreatedCar ][spalva1], vehicleDB[ CreatedCar ][spalva2]);
         ChangeVehiclePaintjob   ( CreatedCar, vehicleDB[ CreatedCar ][paintjob]);
         if(dini_Int(failas,"Tune0") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune0"));
         if(dini_Int(failas,"Tune1") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune1"));
         if(dini_Int(failas,"Tune2") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune2"));
         if(dini_Int(failas,"Tune3") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune3"));
         if(dini_Int(failas,"Tune4") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune4"));
         if(dini_Int(failas,"Tune5") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune5"));
         if(dini_Int(failas,"Tune6") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune6"));
         if(dini_Int(failas,"Tune7") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune7"));
         if(dini_Int(failas,"Tune8") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune8"));
         if(dini_Int(failas,"Tune9") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune9"));
         if(dini_Int(failas,"Tune10") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune10"));
         if(dini_Int(failas,"Tune11") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune11"));
         if(dini_Int(failas,"Tune12") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune12"));
         if(dini_Int(failas,"Tune13") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune13"));
         vehicleDB[CreatedCar][parduodama]=false;
         Masina1[ playerid ] =  CreatedCar;
     }
  SaugomMasina( playerid );
 return 1;
}
//Antros mašinos įkelimas
stock KraunamMasina2( playerid )
{
   new
      zVardas      [ MAX_PLAYER_NAME ],
      failas      [ 65 ];
 
   GetPlayerName   ( playerid, zVardas, sizeof( zVardas ) );
   format         ( failas, 65, "transportas/%s2.ini", zVardas );
   if( dini_Exists( failas) )
   {
         new
            CreatedCar = CreateVehicle( dini_Int( failas, "Modelis" ), dini_Float( failas, "X" ), dini_Float( failas, "Y" ), dini_Float( failas, "Z" ), dini_Float( failas, "F" ), dini_Int( failas, "Spalva1" ),dini_Int( failas,"Spalva2" ), -1 );
 
         vehicleDB[ CreatedCar ][ locked ] = true;
         SetVehicleHealth(CreatedCar, 1000.0);
         for( new i = 0; i < MAX_PLAYERS;i++ )
         {
            if( i != playerid )
            {
                    SetVehicleParamsForPlayer( CreatedCar, i, 0, 1 );
            }
         }
         vehicleDB[CreatedCar][registruota] = false;
         format( vehicleDB[ CreatedCar ][ owner_name ], MAX_PLAYER_NAME, "%s", dini_Get( failas, "Savininkas" ) );
         SetVehicleHealth( CreatedCar, dini_Float(failas,"Bukle"));
         vehicleDB[ CreatedCar ][lastpos][0] = dini_Float(failas,"X");
         vehicleDB[ CreatedCar ][lastpos][1] = dini_Float(failas,"Y");
         vehicleDB[ CreatedCar ][lastpos][2] = dini_Float(failas,"Z");
         vehicleDB[ CreatedCar ][lastpos][3] = dini_Float(failas,"F");
         vehicleDB[ CreatedCar ][gas] = dini_Int(failas,"Degalai");
         vehicleDB[ CreatedCar ][bagazaz] = dini_Int(failas,"Bagazaz");
         vehicleDB[ CreatedCar ][benzinas] = dini_Int(failas,"Benzinas");
         vehicleDB[ CreatedCar ][dyzelis] = dini_Int(failas,"Dyzelis");
         vehicleDB[ CreatedCar ][dujos] = dini_Int(failas,"Dujos");
         vehicleDB[ CreatedCar ][technikine] = dini_Int(failas,"Technikine");
         vehicleDB[ CreatedCar ][remont] = dini_Int(failas,"Remont");
         vehicleDB[ CreatedCar ][spalva1] = dini_Int(failas,"Spalva1");
         vehicleDB[ CreatedCar ][spalva2] = dini_Int(failas,"Spalva2");
         vehicleDB[ CreatedCar ][paintjob] = dini_Int(failas,"Paintjob");
   vehicleDB[ CreatedCar ][rida] = dini_Float(failas,"Rida");
   if (dini_Int(failas,"Registruota")) vehicleDB[CreatedCar][registruota] = true;
   format(vehicleDB[CreatedCar][numeriai],9,"%s",dini_Get(failas,"Numeriai"));
   SetVehicleNumberPlate(CreatedCar,vehicleDB[CreatedCar][numeriai]);
         ChangeVehicleColor      ( CreatedCar, vehicleDB[ CreatedCar ][spalva1],vehicleDB[ CreatedCar ][spalva2]);
         ChangeVehiclePaintjob   ( CreatedCar, vehicleDB[ CreatedCar ][paintjob]);
         if(dini_Int(failas,"Tune0") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune0"));
         if(dini_Int(failas,"Tune1") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune1"));
         if(dini_Int(failas,"Tune2") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune2"));
         if(dini_Int(failas,"Tune3") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune3"));
         if(dini_Int(failas,"Tune4") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune4"));
         if(dini_Int(failas,"Tune5") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune5"));
         if(dini_Int(failas,"Tune6") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune6"));
         if(dini_Int(failas,"Tune7") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune7"));
         if(dini_Int(failas,"Tune8") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune8"));
         if(dini_Int(failas,"Tune9") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune9"));
         if(dini_Int(failas,"Tune10") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune10"));
         if(dini_Int(failas,"Tune11") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune11"));
         if(dini_Int(failas,"Tune12") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune12"));
         if(dini_Int(failas,"Tune13") != 0) AddVehicleComponent( CreatedCar ,dini_Int(failas,"Tune13"));
         vehicleDB[CreatedCar][parduodama]=false;
         Masina2[ playerid ] =  CreatedCar;
   }
   SaugomMasina2( playerid );
   return 1;
}

 
Mašinų saugojimas
 

stock SaugomMasina( playerid )
{
   if( Masina1[ playerid ] != INVALID_VEHICLE_ID )
   {
      new
         vehicleid = Masina1[ playerid ];
 
         new
         Float:CVieta[ 3 ],
             failas[ 60 ],
             Float:coo,
    Float:zAngle;
 
         GetVehicleHealth( vehicleid, coo );
         GetVehiclePos( vehicleid, CVieta[ 0 ], CVieta[ 1 ], CVieta[ 2 ] );
         format         ( failas, 60, "transportas/%s.ini", vehicleDB[ vehicleid ][ owner_name ] );
         if( !dini_Exists( failas ) ) dini_Create( failas );
         dini_Set      ( failas, "Savininkas", vehicleDB[ vehicleid ][ owner_name ] );
         dini_IntSet      ( failas, "Modelis", GetVehicleModel( vehicleid ) );
         dini_IntSet      ( failas, "Degalai", vehicleDB[ vehicleid ][ gas ] );
         dini_IntSet      ( failas, "Bagazaz", vehicleDB[ vehicleid ][ bagazaz ] );
         dini_IntSet      ( failas, "Benzinas",vehicleDB[ vehicleid ][ benzinas ] );
         dini_IntSet      ( failas, "Dyzelis",vehicleDB[ vehicleid ][ dyzelis ] );
         dini_IntSet      ( failas, "Dujos",vehicleDB[ vehicleid ][ dujos ] );
         dini_IntSet      ( failas, "Technikine", vehicleDB[ vehicleid ][ technikine ] );
         dini_IntSet      ( failas, "Remont", vehicleDB[ vehicleid ][ remont ] );
         dini_FloatSet      ( failas, "Bukle", coo );
         dini_IntSet      ( failas, "Spalva1", vehicleDB[ vehicleid ][ Spalva1 ] );
         dini_IntSet      ( failas, "Spalva2", vehicleDB[ vehicleid ][ Spalva2 ] );
         dini_IntSet      ( failas, "Paintjob", vehicleDB[ vehicleid ][ paintjob ] );
         dini_Set      ( failas, "Numeriai", vehicleDB[ vehicleid ][ numeriai ] );
         dini_FloatSet      ( failas, "Rida", vehicleDB[ vehicleid ][ rida ] );
         dini_BoolSet(failas,"Registruota",vehicleDB[vehicleid][registruota]);
         dini_FloatSet      ( failas, "X", CVieta[ 0 ] );
         dini_FloatSet      ( failas, "Y", CVieta[ 1 ] );
         dini_FloatSet      ( failas, "Z", CVieta[ 2 ] );
         GetVehicleZAngle(vehicleid,zAngle);
         dini_FloatSet      ( failas, "F", zAngle);
         dini_IntSet      ( failas, "Tune0",GetVehicleComponentInSlot(vehicleid,0));
         dini_IntSet      ( failas, "Tune1",GetVehicleComponentInSlot(vehicleid,1));
         dini_IntSet      ( failas, "Tune2",GetVehicleComponentInSlot(vehicleid,2));
         dini_IntSet      ( failas, "Tune3",GetVehicleComponentInSlot(vehicleid,3));
         dini_IntSet      ( failas, "Tune4",GetVehicleComponentInSlot(vehicleid,4));
         dini_IntSet      ( failas, "Tune5",GetVehicleComponentInSlot(vehicleid,5));
         dini_IntSet      ( failas, "Tune6",GetVehicleComponentInSlot(vehicleid,6));
         dini_IntSet      ( failas, "Tune7",GetVehicleComponentInSlot(vehicleid,7));
         dini_IntSet      ( failas, "Tune8",GetVehicleComponentInSlot(vehicleid,8));
         dini_IntSet      ( failas, "Tune9",GetVehicleComponentInSlot(vehicleid,9));
         dini_IntSet      ( failas, "Tune10",GetVehicleComponentInSlot(vehicleid,10));
         dini_IntSet      ( failas, "Tune11",GetVehicleComponentInSlot(vehicleid,11));
         dini_IntSet      ( failas, "Tune12",GetVehicleComponentInSlot(vehicleid,12));
         dini_IntSet      ( failas, "Tune13",GetVehicleComponentInSlot(vehicleid,13));
   }
}
//Antros mašinos saugojimas...
stock SaugomMasina2( playerid )
{
   if( Masina2[ playerid ] != INVALID_VEHICLE_ID )
   {
      new
         vehicleid = Masina2[ playerid ];
 
         new
         Float:CVieta[ 3 ],
             failas[ 60 ],
             Float:coo,
    Float:zAngle;
 
         GetVehicleHealth( vehicleid, coo );
         GetVehiclePos( vehicleid, CVieta[ 0 ], CVieta[ 1 ], CVieta[ 2 ] );
         format         ( failas, 60, "transportas/%s2.ini", vehicleDB[ vehicleid ][ owner_name ] );
         if( !dini_Exists( failas ) ) dini_Create( failas );
         dini_Set      ( failas, "Savininkas", vehicleDB[ vehicleid ][ owner_name ] );
         dini_IntSet      ( failas, "Modelis", GetVehicleModel( vehicleid ) );
         dini_IntSet      ( failas, "Degalai", vehicleDB[ vehicleid ][ gas ] );
         dini_IntSet      ( failas, "Bagazaz", vehicleDB[ vehicleid ][ bagazaz ] );
         dini_IntSet      ( failas, "Benzinas",vehicleDB[ vehicleid ][ benzinas ] );
         dini_IntSet      ( failas, "Dyzelis",vehicleDB[ vehicleid ][ dyzelis ] );
         dini_IntSet      ( failas, "Dujos",vehicleDB[ vehicleid ][ dujos ] );
         dini_IntSet      ( failas, "Technikine", vehicleDB[ vehicleid ][ technikine ] );
         dini_IntSet      ( failas, "Remont", vehicleDB[ vehicleid ][ remont ] );
         dini_FloatSet      ( failas, "Bukle", coo );
         dini_IntSet      ( failas, "Spalva1", vehicleDB[ vehicleid ][ Spalva1 ] );
         dini_IntSet      ( failas, "Spalva2", vehicleDB[ vehicleid ][ Spalva2 ] );
         dini_IntSet      ( failas, "Paintjob", vehicleDB[ vehicleid ][ paintjob ] );
         dini_Set      ( failas, "Numeriai", vehicleDB[ vehicleid ][ numeriai ] );
         dini_FloatSet      ( failas, "Rida", vehicleDB[ vehicleid ][ rida ] );
         dini_BoolSet(failas,"Registruota",vehicleDB[vehicleid][registruota]);
         dini_FloatSet      ( failas, "X", CVieta[ 0 ] );
         dini_FloatSet      ( failas, "Y", CVieta[ 1 ] );
         dini_FloatSet      ( failas, "Z", CVieta[ 2 ] );
         GetVehicleZAngle(vehicleid,zAngle);
         dini_FloatSet      ( failas, "F", zAngle);
         dini_IntSet      ( failas, "Tune0",GetVehicleComponentInSlot(vehicleid,0));
         dini_IntSet      ( failas, "Tune1",GetVehicleComponentInSlot(vehicleid,1));
         dini_IntSet      ( failas, "Tune2",GetVehicleComponentInSlot(vehicleid,2));
         dini_IntSet      ( failas, "Tune3",GetVehicleComponentInSlot(vehicleid,3));
         dini_IntSet      ( failas, "Tune4",GetVehicleComponentInSlot(vehicleid,4));
         dini_IntSet      ( failas, "Tune5",GetVehicleComponentInSlot(vehicleid,5));
         dini_IntSet      ( failas, "Tune6",GetVehicleComponentInSlot(vehicleid,6));
         dini_IntSet      ( failas, "Tune7",GetVehicleComponentInSlot(vehicleid,7));
         dini_IntSet      ( failas, "Tune8",GetVehicleComponentInSlot(vehicleid,8));
         dini_IntSet      ( failas, "Tune9",GetVehicleComponentInSlot(vehicleid,9));
         dini_IntSet      ( failas, "Tune10",GetVehicleComponentInSlot(vehicleid,10));
         dini_IntSet      ( failas, "Tune11",GetVehicleComponentInSlot(vehicleid,11));
         dini_IntSet      ( failas, "Tune12",GetVehicleComponentInSlot(vehicleid,12));
         dini_IntSet      ( failas, "Tune13",GetVehicleComponentInSlot(vehicleid,13));
   }
}

Redaguota , nario ` Ryan's
Nuoroda į komentarą
Dalintis per kitą puslapį


Prisijungti prie diskusijos

Palikti atsakymą galite iš karto, o užsiregistruoti vėliau. Jeigu jau turite paskyrą mūsų forume, Prisijunkite.

Svečias
Atsakyti šioje temoje...

×   Įklijuotas tekstas turi teksto formatavimą.   Pašalinti teksto formatavimą

  Galimi tik 75 veidukai.

×   Nuoroda buvo automatiškai įterpta.   Įterpti nuorodą paprastai

×   Jūsų ankstesnis pranešimas buvo atkurtas.   Išvalyti redaktorių

×   Jūs negalite įkelti nuotraukas tiesiogiai.Įkelkite arba įdėkite nuotraukas iš URL.

  • Šiame puslapyje naršo:   0 nariai

    • Nėra registruotų narių peržiūrinčių šį forumą.


×
×
  • Sukurti naują...