tjuning ne radi

Započeo mmlinaric, Oktobar 19, 2019, 11:55:55 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): tuning se savea u bazi podataka, ali ne ucitava poslje restarta
Dio skripte: ovo je u OnPlayerSpawn: https://pastebin.com/SN4ZZ5wg (stavio sam u pastebin radi lakse citljivosti)
Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): /
Slika/video ingame problema(obavezno ako je ingame problem): /

znaci, startao sam server usao in game i tjunirao vozilo. izasao sam iz igre, stopirao server i opet ga startao. tuning je u databazi normalno spremljen al se in game ne ucitava.

posalji query


bilo je lijepo dok je trajalo.


Citat: Bašovski poslato Oktobar 19, 2019, 15:41:01 POSLE PODNE
posalji query
pa gle, kad ucitava orge i slicno ucita ih ovako:
[pawn]
mysql_format( _dbConnector, q, sizeof( q ), "SELECT * FROM `vehicles` WHERE `owner_sqlID` = '%d' AND `v_usage` = '1'", PlayerInfo[ playerid ][ xID ] );
mysql_pquery( _dbConnector, q, "OnPlayerVehiclesLoad", "i", playerid );
[/pawn]
znaci selekta sve di je tip npr orga posao rent i sl
a OnVehicsleLoad je ovo:
[pawn]
forward OnVehiclesLoad( playerid, targetid, moneyauc );
public OnVehiclesLoad( playerid, targetid, moneyauc ) {

   new rows, fields, vehicleid;
    cache_get_data( rows, fields, _dbConnector );

   if( rows ) {
      for( new i = 0; i < rows; i ++ ){



            vehicleid = a_CreateVehicle( cache_get_field_content_int( i, "v_model" ),
                                    cache_get_field_content_float( i, "v_pos_x" ),
                                    cache_get_field_content_float( i, "v_pos_y" ),
                                    cache_get_field_content_float( i, "v_pos_z" )+1.0,
                                    cache_get_field_content_float( i, "v_pos_a" ),
                                    cache_get_field_content_int( i, "v_color_1" ),
                                    cache_get_field_content_int( i, "v_color_2" ), 300000 );

            VehicleInfo[ vehicleid ][ vSqlID ] = cache_get_field_content_int( i, "veh_id" );
         VehicleInfo[ vehicleid ][ vOwner_sqlID ] = cache_get_field_content_int( i, "owner_sqlID" );
         strmid( VehicleInfo[ vehicleid ][ vOwner ], "Drzava", 0, strlen( "Drzava" ), 24);
         VehicleInfo[ vehicleid ][ vPrice ] = cache_get_field_content_int( i, "v_price" );
         VehicleInfo[ vehicleid ][ vLocked ] = cache_get_field_content_int( i, "v_locked" );
         VehicleInfo[ vehicleid ][ vLokacijaX ] = cache_get_field_content_float( i, "v_pos_x" );
         VehicleInfo[ vehicleid ][ vLokacijaY ] = cache_get_field_content_float( i, "v_pos_y" );
         VehicleInfo[ vehicleid ][ vLokacijaZ ] = cache_get_field_content_float( i, "v_pos_z" );
         VehicleInfo[ vehicleid ][ vLokacijaA ] = cache_get_field_content_float( i, "v_pos_a" );
         VehicleInfo[ vehicleid ][ vVirtualWorld ] = cache_get_field_content_int( i, "v_virtualw" );
         VehicleInfo[ vehicleid ][ vInterior ] = cache_get_field_content_int( i, "v_interior" );
         VehicleInfo[ vehicleid ][ vUsage ] = cache_get_field_content_int( i, "v_usage" );
         VehicleInfo[ vehicleid ][ vOrganizationSQLID ] = cache_get_field_content_int( i, "v_organization" );
         VehicleInfo[ vehicleid ][ vOrganization ] = -1;

         if( VehicleInfo[ vehicleid ][ vOrganizationSQLID ] != 0 ) {
                for( new j = 1; j < MAX_ORG; j++) {
                 if( org_info[ j ][ oID ] == VehicleInfo[ vehicleid ][ vOrganizationSQLID ] ) {
                     VehicleInfo[ vehicleid ][ vOrganization ] = j;
                     break;
                 }
             }
         }

         VehicleInfo[ vehicleid ][ vJob ] = cache_get_field_content_int( i, "v_job" );
         VehicleInfo[ vehicleid ][ vFuelStation ]  = cache_get_field_content_int( i, "v_fuel_station" );
         VehicleInfo[ vehicleid ][ vColor1 ] = cache_get_field_content_int( i, "v_color_1" );
         VehicleInfo[ vehicleid ][ vColor2 ]  = cache_get_field_content_int( i, "v_color_2" );
         VehicleInfo[ vehicleid ][ vModel ] = cache_get_field_content_int( i, "v_model" );
         VehicleInfo[ vehicleid ][ vTeh ] = cache_get_field_content_int( i, "v_teh" );
         VehicleInfo[ vehicleid ][ vReg ] = cache_get_field_content_int( i, "v_reg" );
         VehicleInfo[ vehicleid ][ vRegVreme ] = cache_get_field_content_int( i, "v_reg_vreme" );
         cache_get_field_content( i, "v_tablice", VehicleInfo[ vehicleid ][ vTablice ], _dbConnector, 16 );
         VehicleInfo[ vehicleid ][ vGPS ] = cache_get_field_content_int( i, "v_gps" );
         VehicleInfo[ vehicleid ][ vOsiguranje ] = cache_get_field_content_int( i, "v_insurance" );
         VehicleInfo[ vehicleid ][ vLock ] = cache_get_field_content_int( i, "v_lock" );
         VehicleInfo[ vehicleid ][ vAlarm ] = cache_get_field_content_int( i, "v_alarm" );
         VehicleInfo[ vehicleid ][ vFuel ] = cache_get_field_content_int( i, "v_fuel" );
         VehicleInfo[ vehicleid ][ vFuelType ] = cache_get_field_content_int( i, "v_fuel_type" );
         VehicleInfo[ vehicleid ][ vNeon ] = cache_get_field_content_int( i, "v_neon" );
          VehicleInfo[ vehicleid ][ vTuned ] = cache_get_field_content_int( i, "v_tuned" );
         VehicleInfo[ vehicleid ][ vImobilizator ] = cache_get_field_content_int( i, "v_imobilizator" );
         VehicleInfo[ vehicleid ][ vSpoiler ] = cache_get_field_content_int( i, "v_spoiler" );
         VehicleInfo[ vehicleid ][ vHood ] = cache_get_field_content_int( i, "v_hood" );
         VehicleInfo[ vehicleid ][ vRoof ] = cache_get_field_content_int( i, "v_roof" );
         VehicleInfo[ vehicleid ][ vSkirt ] = cache_get_field_content_int( i, "v_skirt" );
         VehicleInfo[ vehicleid ][ vLamps ] = cache_get_field_content_int( i, "v_lamps" );
         VehicleInfo[ vehicleid ][ vNitro ] = cache_get_field_content_int( i, "v_nitro" );
         VehicleInfo[ vehicleid ][ vExhaust ] = cache_get_field_content_int( i, "v_exhaust" );
         VehicleInfo[ vehicleid ][ vWheels ] = cache_get_field_content_int( i, "v_wheels" );
         VehicleInfo[ vehicleid ][ vStereo ] = cache_get_field_content_int( i, "v_stereo" );
         VehicleInfo[ vehicleid ][ vHydraulics ] = cache_get_field_content_int( i, "v_hydraulics" );
         VehicleInfo[ vehicleid ][ vFrontBumper ] = cache_get_field_content_int( i, "v_front_bumper" );
         VehicleInfo[ vehicleid ][ vRearBumper ] = cache_get_field_content_int( i, "v_rear_bumper" );
         VehicleInfo[ vehicleid ][ vVents ] = cache_get_field_content_int( i, "v_vents" );
         VehicleInfo[ vehicleid ][ vPaintJob ] = cache_get_field_content_int( i, "v_paintjob" );
         VehicleInfo[ vehicleid ][ vDrugAmmount ][ 0 ] = cache_get_field_content_int( i, "v_drug_ammount_1" );
         VehicleInfo[ vehicleid ][ vDrugAmmount ][ 1 ] = cache_get_field_content_int( i, "v_drug_ammount_2" );
         VehicleInfo[ vehicleid ][ vDrugAmmount ][ 2 ] = cache_get_field_content_int( i, "v_drug_ammount_3" );
         VehicleInfo[ vehicleid ][ vDrugAmmount ][ 3 ] = cache_get_field_content_int( i, "v_drug_ammount_4" );
         VehicleInfo[ vehicleid ][ vDrugAmmount ][ 4 ] = cache_get_field_content_int( i, "v_drug_ammount_5" );
         VehicleInfo[ vehicleid ][ vDrugAmmount ][ 5 ] = cache_get_field_content_int( i, "v_drug_ammount_6" );
         VehicleInfo[ vehicleid ][ vMaterijali ] = cache_get_field_content_int( i, "v_mats" );
         VehicleInfo[ vehicleid ][ vMelee ] = cache_get_field_content_int( i, "v_weapon_melee" );
         VehicleInfo[ vehicleid ][ vWeap1 ] = cache_get_field_content_int( i, "v_weapon_slot_1" );
         VehicleInfo[ vehicleid ][ vAmmo1 ] = cache_get_field_content_int( i, "v_weapon_ammo_1" );
         VehicleInfo[ vehicleid ][ vWeap2 ] = cache_get_field_content_int( i, "v_weapon_slot_2" );
         VehicleInfo[ vehicleid ][ vAmmo2 ] = cache_get_field_content_int( i, "v_weapon_ammo_2" );
         VehicleInfo[ vehicleid ][ vGajbica ][ 0 ] = cache_get_field_content_int( i, "v_gajbica_slot_1" );
         VehicleInfo[ vehicleid ][ vGajbica ][ 1 ] = cache_get_field_content_int( i, "v_gajbica_slot_2" );
         VehicleInfo[ vehicleid ][ vGajbica ][ 2 ] = cache_get_field_content_int( i, "v_gajbica_slot_3" );
         VehicleInfo[ vehicleid ][ vGajbica ][ 3 ] = cache_get_field_content_int( i, "v_gajbica_slot_4" );
         VehicleInfo[ vehicleid ][ vGajbica ][ 4 ] = cache_get_field_content_int( i, "v_gajbica_slot_5" );
         VehicleInfo[ vehicleid ][ vGajbicaAmmount ][ 0 ] = cache_get_field_content_int( i, "v_gajbica_kolicina_1" );
         VehicleInfo[ vehicleid ][ vGajbicaAmmount ][ 1 ] = cache_get_field_content_int( i, "v_gajbica_kolicina_2" );
         VehicleInfo[ vehicleid ][ vGajbicaAmmount ][ 2 ] = cache_get_field_content_int( i, "v_gajbica_kolicina_3" );
         VehicleInfo[ vehicleid ][ vGajbicaAmmount ][ 3 ] = cache_get_field_content_int( i, "v_gajbica_kolicina_4" );
         VehicleInfo[ vehicleid ][ vGajbicaAmmount ][ 4 ] = cache_get_field_content_int( i, "v_gajbica_kolicina_5" );
         VehicleInfo[ vehicleid ][ vKilometri ] = cache_get_field_content_int( i, "v_kilometri" );
         VehicleInfo[ vehicleid ][ vMetri ] = cache_get_field_content_int( i, "v_metri" );
         VehicleInfo[ vehicleid ][ v_owner_id ] = -1;

         LinkVehicleToInterior( vehicleid, VehicleInfo[ vehicleid ][ vInterior ] );
           SetVehicleVirtualWorld( vehicleid, VehicleInfo[ vehicleid ][ vVirtualWorld ] );
         vCanDrive[ vehicleid ] = 1;

              VehicleInfo[ vehicleid ][ Validv3DText ] = false;
          if( VehicleInfo[ vehicleid ][ vFuelType ] == 0 ) {

            if( Diesel( vehicleid ) ) VehicleInfo[ vehicleid ][ vFuelType ] = 1;
            else if( Gasoline( vehicleid ) ) VehicleInfo[ vehicleid ][ vFuelType ] = 2;
            else if( GasOil( vehicleid ) ) VehicleInfo[ vehicleid ][ vFuelType ] = 3;
         }

           SetVehicleParamsEx( vehicleid, 0, 0, 0, VehicleInfo[ vehicleid ][ vLocked ], 0, 0, 0 );
           if( IsVehicleBajs( vehicleid ) ) {
            SetVehicleParamsEx( vehicleid, 1, 0, 0, VehicleInfo[ vehicleid ][ vLocked ], 0, 0, 0 );
         }
           ResetVehicleStatistics( vehicleid );
         VehicleInfo[ vehicleid ][ vFuel ] = getAmountFuel( vehicleid );

            if( VehicleInfo[ vehicleid ][ vUsage ] == PRIVATNO_VOZILO ) {
              Fuel[ vehicleid ] = VehicleInfo[ vehicleid ][ vFuel ];
          }
         else if( VehicleInfo[ vehicleid ][ vUsage ] == POSLOVNO_VOZILO ) {
             VehicleInfo[ vehicleid ][ vFuel ] = 100;
             Fuel[ vehicleid ] = 100;
         }
         else {
             Fuel[ vehicleid ] = getAmountFuel( vehicleid );
         }

         SetVehicleLabels( vehicleid );

         if( VehicleInfo[ vehicleid ][ vReg ] == 1 ) {
            SetTablice( vehicleid );
         }
         else if( VehicleInfo[ vehicleid ][ vReg ] == 2 ) {
            SetVehicleNumberPlate( vehicleid, VehicleInfo[ vehicleid ][ vTablice ] );
         }
         else  {
            SetVehicleNumberPlate( vehicleid, "NEMA" );
         }

         TuneVehicle( vehicleid );

            if( VehicleInfo[ vehicleid ][ vUsage ] == PUMPA_VOZILO ) {

                new fstationID = VehicleInfo[ vehicleid ][ vFuelStation ];

            if( VehicleInfo[ vehicleid ][ vModel ] == 584 ) {
               FuelStation[ fstationID ][ fsCisternID ] = vehicleid;
            }
            else if( VehicleInfo[ vehicleid ][ vModel ] == 403 ) {
               FuelStation[ fstationID ][ fsTruckID ] = vehicleid;
            }

         }

           #if ZIMSKI_MOD == 1
         if( VehicleInfo[ vehicleid ][ vUsage ] == POSLOVNO_VOZILO && VehicleInfo[ vehicleid ][ vJob ] == POSAO_KOMUNALAC && VehicleInfo[ vehicleid ][ vModel ] == 455 ) {

             SnowObjects[ vehicleid ] = true;

             SnowObject1[ vehicleid ] = CreateDynamicObject( 19601, 0, 0, 1500, 0, 0, 0 );
            AttachDynamicObjectToVehicle( SnowObject1[ vehicleid ], vehicleid, 0.000000, 4.200001, -1.049999, 13.500000, 0.000000, 180.000 );

            SnowObject2[ vehicleid ] = CreateDynamicObject( 18646, 0, 0, 1500, 0, 0, 0 );
            AttachDynamicObjectToVehicle( SnowObject2[ vehicleid ], vehicleid, 0.749999, 1.575000, 1.725000, 0.000000, 0.000000, 0.000000 );
         }
         #endif

         if( playerid != 1001 ) {
             SendInfoMessage( playerid, "Dodali ste vozilo %s sa aukcije, igracu %s za $%d.", GetVehicleNameEx( VehicleInfo[ vehicleid ][ vModel ] ), ImeIgraca( targetid ), moneyauc );

            new string[ 128 ];
                format( string, sizeof( string ), "AUKCIJA VOZILO SQLID: %d | Prodano igracu %s od admina %s ", VehicleInfo[ vehicleid ][ vSqlID ], ImeIgraca( targetid ), ImeIgraca( playerid ) );
            LogSave( "Ostalo/LogAukcije.log", string );
         }

         if( targetid != 1001 && targetid != IPI ) {

             for( new j = 0; j < MAX_VEH_SLOT; j ++ ){
                   if( (j+1) <= PlayerInfo[ targetid ][ xSlotoviVozila ] && player_veh[ targetid ][ vehicle_id ][ j ] == -1 ) {
                  player_veh[ targetid ][ vehicle_id ][ j ] = vehicleid;
                  break;
               }
            }

            VehicleInfo[ vehicleid ][ v_owner_id ] = targetid;
            VehicleInfo[ vehicleid ][ vOwner_sqlID ] = PlayerInfo[ targetid ][ xID ];
            strmid( VehicleInfo[ vehicleid ][ vOwner ], ImeIgraca( targetid ), 0, strlen( ImeIgraca( targetid ) ), 32 );

                VehicleInfo[ vehicleid ][ vPrice ] = VehPrice[ VehicleInfo[ vehicleid ][ vModel ]- 400 ][ 1 ];

                new Float:plocx, Float:plocy, Float:plocz, Float:carangle;
            GetPlayerPos( targetid, plocx, plocy, plocz );
            a_SetVehiclePos( vehicleid, plocx, plocy+4, plocz );
                GetVehicleZAngle( vehicleid, carangle );

                VehicleInfo[ vehicleid ][ vVirtualWorld ] = GetPlayerVirtualWorld( targetid );
            VehicleInfo[ vehicleid ][ vInterior ] = GetPlayerInterior( targetid );

            VehicleInfo[ vehicleid ][ vLokacijaX ] = plocx;
            VehicleInfo[ vehicleid ][ vLokacijaY ] = plocy;
            VehicleInfo[ vehicleid ][ vLokacijaZ ] = plocz;
            VehicleInfo[ vehicleid ][ vLokacijaA ] = carangle;

            LinkVehicleToInterior( vehicleid, VehicleInfo[ vehicleid ][ vInterior ] );
             SetVehicleVirtualWorld( vehicleid, VehicleInfo[ vehicleid ][ vVirtualWorld ] );

            new q[ 512 ];
            mysql_format( _dbConnector, q, sizeof(q), "UPDATE `vehicles` SET `owner_sqlID` = '%d', `v_price` = '%d', `v_pos_x` = '%f', `v_pos_y` = '%f', `v_pos_z` = '%f', `v_pos_a` = '%f', `v_virtualw` = '%d', `v_interior` = '%d' WHERE `veh_id` = '%d' LIMIT 1",
                              VehicleInfo[ vehicleid ][ vOwner_sqlID ],
                              VehicleInfo[ vehicleid ][ vPrice ],
                              VehicleInfo[ vehicleid ][ vLokacijaX ],
                              VehicleInfo[ vehicleid ][ vLokacijaY ],
                              VehicleInfo[ vehicleid ][ vLokacijaZ ],
                              VehicleInfo[ vehicleid ][ vLokacijaA ],
                              VehicleInfo[ vehicleid ][ vVirtualWorld ],
                              VehicleInfo[ vehicleid ][ vInterior ],
                              VehicleInfo[ vehicleid ][ vSqlID ] );

            mysql_pquery( _dbConnector, q, "", "" );

            SendInfoMessage( targetid, "Dobili ste vozilo %s sa aukcije, od admina %s za $%d.", GetVehicleNameEx( VehicleInfo[ vehicleid ][ vModel ] ), ImeIgraca( playerid ), moneyauc );

            if( moneyauc != 0 ) DajIgracuNovac( targetid, -moneyauc );


         }
      }
   }
   else {
      if( playerid != 1001 ) {
          SendInfoMessage( playerid, "Pogresan basesqlID(nepostoji)." );
      }
   }
   return (true);
}
[/pawn]
Poslednja Izmena: Oktobar 19, 2019, 16:36:39 POSLE PODNE od mmlinaric

Pozivas samo playerid u query-u a u publicu ti trazi targetid i moneyuc, i zato on nece ucitati jer on ne zna sta mu je to ako me kapiras , ne mozes to stavljati u ucitavanju

One And Only
Old Member
Since AVGUST 2013. :)
GAME OVER - SCRIPTING
SINCE 2009 - 2020

Citat: LANMY.pwN poslato Oktobar 19, 2019, 17:00:58 POSLE PODNE
Pozivas samo playerid u query-u a u publicu ti trazi targetid i moneyuc, i zato on nece ucitati jer on ne zna sta mu je to ako me kapiras , ne mozes to stavljati u ucitavanju
Zapravo query poziva potpuno drugi callback ili ti ga onaj koji je postavio u temi na pastebin

fala svima, mislim da sam naso rjesenje.
ljock.