21.02.2017, 17:05
My vehicle tuning is not saving, why?
PHP код:
public OnVehicleMod(playerid, vehicleid, componentid)
{
// When the player changes a component of his vehicle, reduce the price of the component from the player's money
APlayerData[playerid][PlayerMoney] = APlayerData[playerid][PlayerMoney] - AVehicleModPrices[componentid - 1000];
RewardPlayer(playerid,APlayerData[playerid][PlayerMoney],0);
for(new i; i < 14; i++)
{
if(GetVehicleComponentType(componentid) == i)
{
AVehicleData[vehicleid][Components][i] = componentid;
}
}
if(AVehicleData[vehicleid][Owned] == 1)
{
new query[164];
mysql_format(g_SQL, query, sizeof(query), "UPDATE `vehicles` SET `VehicleSpoiler` = %i,`VehicleHood` = %i,`VehicleRoof` = %i,`VehicleSideSkirt` = %i,`VehicleLamps` = %i,`VehicleNitro` = %i,`VehicleExaust` = %i,`VehicleWheels` = %i,`VehicleStereo` = %i,`VehicleHydraulics` = %i, `VehicleFrontBumper` = %i,`VehicleRearBumper` = %i, `VehicleVentRigt` = %i,`VehicleVentLeft` = %i WHERE `ID` = %i",AVehicleData[vehicleid][Components][0],AVehicleData[vehicleid][Components][1],AVehicleData[vehicleid][Components][2],AVehicleData[vehicleid][Components][3],AVehicleData[vehicleid][Components][4],AVehicleData[vehicleid][Components][5],AVehicleData[vehicleid][Components][6],AVehicleData[vehicleid][Components][7],AVehicleData[vehicleid][Components][8],AVehicleData[vehicleid][Components][9],AVehicleData[vehicleid][Components][10],AVehicleData[vehicleid][Components][11],AVehicleData[vehicleid][Components][12],AVehicleData[vehicleid][Components][13],AVehicleData[vehicleid][IDD]);
mysql_tquery(g_SQL, query, "","");
}
return 1;
}