Tuning saving (mysql)
#1

Hey bro's,

My tuning is none saving, while i'm parking my vehicle.

I explain: i buy my tuning, and when i park my vehicle, the tuning is removing.

Here is my /v park command:

pawn Код:
if(strcmp(subcmd, "park", true) == 0 || strcmp(subcmd, "garer", true) == 0 || strcmp(subcmd, "parquer", true) == 0)
        {
            new Float:x, Float:y, Float:z, Float:a;
            new getcarid = GetPlayerVehicleID(playerid);
            GetPlayerName(playerid, playername, sizeof(playername));
            if(!IsPlayerInAnyVehicle(playerid))
                {SendClientMessage(playerid, COLOR_VEHICULE, "[Vehicule] Vous n'кtes pas dans une voiture."); return 1;}
            if(GetVehicleVirtualWorld(getcarid) != 0)
                {SendClientMessage(playerid, COLOR_VEHICULE, "[Vehicule] Ce vйhicule est dans un virtual world particulier, retournez а l'exterieur."); return 1;}
            if(CarInfo[getcarid][cOwned] !=1 || strcmp(CarInfo[getcarid][cOwner], playername, true)!=0)
            {
                if(!pack_isAdmin(playerid, 7))
                    {SendClientMessage(playerid, COLOR_VEHICULE, "[Vehicule] Vous n'кtes pas le propriйtaire de ce vehicule."); return 1;}
                else if(aDuty[playerid])
                    {SendClientMessage(playerid, COLOR_ADMIN, "[Admin] Voiture parquйe.");}
                else
                    {SendClientMessage(playerid, COLOR_ADMIN, "[Admin] En ServiceAdmin pour pourriez la parquer."); return 1;}
            }
            GetVehiclePos(getcarid, x, y, z);
            GetVehicleZAngle(getcarid, a);
            new panels,doors,lights,tires,Float:damage;
            GetVehicleHealth(getcarid, damage);
            DestroyVehicle(getcarid);
            CarInfo[getcarid][cLocationx] = x;
            CarInfo[getcarid][cLocationy] = y;
            CarInfo[getcarid][cLocationz] = z;
            CarInfo[getcarid][cAngle] = a;
            CeintureNotUpdate[playerid]=3;
            GetVehicleDamageStatus(getcarid,panels,doors,lights,tires);
            CreateVehicle(CarInfo[getcarid][cModel],x,y,z+1.0,a,CarInfo[getcarid][cColorOne],CarInfo[getcarid][cColorTwo],-1);
            PutPlayerInVehicle(playerid,getcarid, 0);
            UpdateVehicleDamageStatus(getcarid, panels, doors, lights, tires);
            SetVehicleHealth(getcarid, damage);
            //CarInfo[getcarid][cHealth] = damage;
            format(sql, 256, "UPDATE srp_players_cars SET park_x=%f, park_y=%f, park_z=%f, park_angle=%f WHERE id=%d", x, y, z, a, getcarid);
            MySQLCheckconnexion();
            mysql_query(sql);
            //SQLLog(sql);
            tuning_applyDbTuning(getcarid);
            GameTextForPlayer(playerid, "~w~Vehicule parque", 1000, MSG_STYLE);
            SaveSQLCar(getcarid,false);
            car_Engine(getcarid);
            return 1;
        }
Thanks !
Reply
#2

nobody ?
Reply
#3

bump..
Reply
#4

help please..
Reply
#5

You're not saving the tuning at all, that's why it disappears.

You should save the vehicle components in the database, for instance by iterating through the vehicle component slots when the command is called. https://sampwiki.blast.hk/wiki/GetVehicleComponentInSlot
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)