PHP код:
stock SaveCars(playerid)
{
if(p_info[playerid][pLogin] == 0) return 1;
format(MySQLStr, 1200, "UPDATE `accounts` SET `cModel` = '%d,%d,%d', ",
CarInfo[playerid][cModel][0], CarInfo[playerid][cModel][1], CarInfo[playerid][cModel][2]);
format(MySQLStr, 1200, "%s `cSost` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cSost][0], CarInfo[playerid][cSost][1], CarInfo[playerid][cSost][2]);
format(MySQLStr, 1200, "%s `cColor1` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cColor1][0], CarInfo[playerid][cColor1][1], CarInfo[playerid][cColor1][2]);
format(MySQLStr, 1200, "%s `cColor2` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cColor2][0], CarInfo[playerid][cColor2][1], CarInfo[playerid][cColor2][2]);
format(MySQLStr, 1200, "%s `cNumber` = '%s,%s,%s', ", MySQLStr,
VehicleNumberPlate[playerid][0], VehicleNumberPlate[playerid][1], VehicleNumberPlate[playerid][2]);
format(MySQLStr, 1200, "%s `cPaintJobs` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cPaintJobs][0], CarInfo[playerid][cPaintJobs][1], CarInfo[playerid][cPaintJobs][2]);
format(MySQLStr, 1200, "%s `cLock` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cLock][0], CarInfo[playerid][cLock][1], CarInfo[playerid][cLock][2]);
format(MySQLStr, 1200, "%s `cFuel` = '%f,%f,%f', ", MySQLStr,
CarInfo[playerid][cFuel][0], CarInfo[playerid][cFuel][1], CarInfo[playerid][cFuel][2]);
format(MySQLStr, 1200, "%s `cCost` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cCost][0], CarInfo[playerid][cCost][1], CarInfo[playerid][cCost][2]);
format(MySQLStr, 1200, "%s `cProbeg` = '%f,%f,%f', ", MySQLStr,
CarInfo[playerid][cProbeg][0], CarInfo[playerid][cProbeg][1], CarInfo[playerid][cProbeg][2]);
format(MySQLStr, 1200, "%s `cWheels` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cWheels][0], CarInfo[playerid][cWheels][1], CarInfo[playerid][cWheels][2]);
format(MySQLStr, 1200, "%s `cSpoiler` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cSpoiler][0], CarInfo[playerid][cSpoiler][1], CarInfo[playerid][cSpoiler][2]);
format(MySQLStr, 1200, "%s `cBumper1` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cBumper1][0], CarInfo[playerid][cBumper1][1], CarInfo[playerid][cBumper1][2]);
format(MySQLStr, 1200, "%s `cBumper2` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cBumper2][0], CarInfo[playerid][cBumper2][1], CarInfo[playerid][cBumper2][2]);
format(MySQLStr, 1200, "%s `cNitro` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cNitro][0], CarInfo[playerid][cNitro][1], CarInfo[playerid][cNitro][2]);
format(MySQLStr, 1200, "%s `cHydrawlic` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cHydrawlic][0], CarInfo[playerid][cHydrawlic][1], CarInfo[playerid][cHydrawlic][2]);
format(MySQLStr, 1200, "%s `cHood` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cHood][0], CarInfo[playerid][cHood][1], CarInfo[playerid][cHood][2]);
format(MySQLStr, 1200, "%s `cRoof` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cRoof][0], CarInfo[playerid][cRoof][1], CarInfo[playerid][cRoof][2]);
format(MySQLStr, 1200, "%s `cSideskirt` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cSideskirt][0], CarInfo[playerid][cSideskirt][1], CarInfo[playerid][cSideskirt][2]);
format(MySQLStr, 1200, "%s `cLamps` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cLamps][0], CarInfo[playerid][cLamps][1], CarInfo[playerid][cLamps][2]);
format(MySQLStr, 1200, "%s `cExhaust` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cExhaust][0], CarInfo[playerid][cExhaust][1], CarInfo[playerid][cExhaust][2]);
format(MySQLStr, 1200, "%s `cStereo` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cStereo][0], CarInfo[playerid][cStereo][1], CarInfo[playerid][cStereo][2]);
format(MySQLStr, 1200, "%s `cVentRight` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cVentRight][0], CarInfo[playerid][cVentRight][1], CarInfo[playerid][cVentRight][2]);
format(MySQLStr, 1200, "%s `cVentLeft` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cVentLeft][0], CarInfo[playerid][cVentLeft][1], CarInfo[playerid][cVentLeft][2]);
format(MySQLStr, 1200, "%s `cHeal` = '%f,%f,%f ', ", MySQLStr,
CarInfo[playerid][cHeal][0], CarInfo[playerid][cHeal][1], CarInfo[playerid][cHeal][2]);
format(MySQLStr, 1200, "%s `cDamagePanel` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cDamagePanel][0], CarInfo[playerid][cDamagePanel][1], CarInfo[playerid][cDamagePanel][2]);
format(MySQLStr, 1200, "%s `cDamageDoors` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cDamageDoors][0], CarInfo[playerid][cDamageDoors][1], CarInfo[playerid][cDamageDoors][2]);
format(MySQLStr, 1200, "%s `cDamageLights` = '%d,%d,%d', ", MySQLStr,
CarInfo[playerid][cDamageLights][0], CarInfo[playerid][cDamageLights][1], CarInfo[playerid][cDamageLights][2]);
format(MySQLStr, 1200, "%s `cDamageTires` = '%d,%d,%d' WHERE `pID` = %d", MySQLStr,
CarInfo[playerid][cDamageTires][0], CarInfo[playerid][cDamageTires][1], CarInfo[playerid][cDamageTires][2], GetPlayerAccountID(playerid));
mysql_tquery(dbHandle, MySQLStr);
return 1;
}
тут тоже такое говно сделали, как оптимизировать до минимума? по 1200 ячеек на каждую строку...