Felar.Exe
Компетентный
Код:
stock SaveCars(playerid)
{
format(CarInfo[GetPlayerCars(playerid)][cComponents],72,"%i, %i, %i, %i, %i ,%i ,%i ,%i ,%i ,%i ,%i ,%i ,%i ,%i ,%i ,%i",CarInfo[GetPlayerCars(playerid)][cComponent][0],CarInfo[GetPlayerCars(playerid)][cComponent][1],CarInfo[GetPlayerCars(playerid)][cComponent][2],CarInfo[GetPlayerCars(playerid)][cComponent][3],CarInfo[GetPlayerCars(playerid)][cComponent][4],CarInfo[GetPlayerCars(playerid)][cComponent][5],
CarInfo[GetPlayerCars(playerid)][cComponent][6],CarInfo[GetPlayerCars(playerid)][cComponent][7],CarInfo[GetPlayerCars(playerid)][cComponent][8],CarInfo[GetPlayerCars(playerid)][cComponent][9],CarInfo[GetPlayerCars(playerid)][cComponent][10],CarInfo[GetPlayerCars(playerid)][cComponent][11],CarInfo[GetPlayerCars(playerid)][cComponent][12],CarInfo[GetPlayerCars(playerid)][cComponent][13],
CarInfo[GetPlayerCars(playerid)][cComponent][14],CarInfo[GetPlayerCars(playerid)][cComponent][15]);
new temp[128];
mysql_format(mysql, mysql_string, sizeof(mysql_string), "UPDATE `cars` SET ");
format(temp,sizeof(temp),"`owner`='%s',",CarInfo[GetPlayerCars(playerid)][cOwner]);strcat(mysql_string,temp,sizeof(mysql_string));
format(temp,sizeof(temp),"`fuel`='%i',",CarInfo[GetPlayerCars(playerid)][cFuel]);strcat(mysql_string,temp,sizeof(mysql_string));
format(temp,sizeof(temp),"`colors`='%s',",CarInfo[GetPlayerCars(playerid)][cColors]);strcat(mysql_string,temp,sizeof(mysql_string));
format(temp,sizeof(temp),"`Component`='%s',",CarInfo[GetPlayerCars(playerid)][cColors]);strcat(mysql_string,temp,sizeof(mysql_string));
format(temp,sizeof(temp),"`clock`='%i',",CarInfo[GetPlayerCars(playerid)][cLock]);strcat(mysql_string,temp,sizeof(mysql_string));
format(temp,sizeof(temp),"`x`='%f',",CarInfo[GetPlayerCars(playerid)][cX]);strcat(mysql_string,temp,sizeof(mysql_string));
format(temp,sizeof(temp),"`y`='%f',",CarInfo[GetPlayerCars(playerid)][cY]);strcat(mysql_string,temp,sizeof(mysql_string));
format(temp,sizeof(temp),"`z`='%f',",CarInfo[GetPlayerCars(playerid)][cZ]);strcat(mysql_string,temp,sizeof(mysql_string));
format(temp,sizeof(temp),"`fa`='%f'",CarInfo[GetPlayerCars(playerid)][cFa]);strcat(mysql_string,temp,sizeof(mysql_string));
format(temp,sizeof(temp)," WHERE id = '%i'",CarInfo[GetPlayerCars(playerid)][ids]);strcat(mysql_string,temp,sizeof(mysql_string));
mysql_function_query(mysql, mysql_string, true, "", "");
}
С циклом допустим
