23.06.2011, 11:05
pawn Код:
new str[6][150], lstr[512];
format(str[0], sizeof(str[0]), "UPDATE `sa-mp`.`propertyinfo` SET `E_X`='%f', `E_Y`='%f', `E_Z`='%f', `E_INT`='%d'", propertyInfo[propertyid][E_X],propertyInfo[propertyid][E_Y],propertyInfo[propertyid][E_Z],propertyInfo[propertyid][E_INT]);
format(str[1], sizeof(str[1]), "`E_VW`='%d', `I_X`='%f', `I_Y`='%f', `I_Z`='%f',", propertyInfo[propertyid][E_VW], propertyInfo[propertyid][I_X],propertyInfo[propertyid][I_Y],propertyInfo[propertyid][I_Z]);
format(str[2], sizeof(str[3]), "`I_INT`='%d', `CASHBOX`='%d', `TYPE`='%d', `LEVEL`='%d',", propertyInfo[propertyid][I_INT],propertyInfo[propertyid][CASHBOX],propertyInfo[propertyid][TYPE],propertyInfo[propertyid][LEVEL]);
format(str[2], sizeof(str[4]), "`NAME`='%s', `OWNER`='%s',`CO_OWNER`='%s', `SOLD`='%d',", propertyInfo[propertyid][NAME],propertyInfo[propertyid][OWNER],propertyInfo[propertyid][CO_OWNER],propertyInfo[propertyid][SOLD],);
format(str[2], sizeof(str[5]), "`LOCK`='%d', `ALARM`='%d', `PRICE`='%d' WHERE `ID`='%d'", propertyInfo[propertyid][LOCK],propertyInfo[propertyid][ALARM],propertyInfo[propertyid][PRICE], propertyid);
format(lstr, sizeof(lstr), "%s %s %s %s %s", str[0], str[1], str[2], str[3], str[4], str[5]);
mysql_query(lstr);