SA-MP Forums Archive
Tuning saving (mysql) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Tuning saving (mysql) (/showthread.php?tid=434186)



Tuning saving (mysql) - LilBob - 01.05.2013

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 !


Re: Tuning saving (mysql) - LilBob - 01.05.2013

nobody ?


Re: Tuning saving (mysql) - LilBob - 30.06.2013

bump..


Re: Tuning saving (mysql) - LilBob - 30.06.2013

help please..


Re: Tuning saving (mysql) - Johnson_boy - 02.07.2013

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