(541) error 075: input line too long (after substitutions)
new str[512];
format( str , sizeof(str) , "UPDATE `sa-mp`.`propertyinfo` SET `E_X`='%f', `E_Y`='%f', `E_Z`='%f', `E_INT`='%d', `E_VW`='%d', `I_X`='%f', `I_Y`='%f', `I_Z`='%f', `I_INT`='%d', `CASHBOX`='%d', `TYPE`='%d', `LEVEL`='%d',\
`NAME`='%s', `OWNER`='%s',`CO_OWNER`='%s', `SOLD`='%d', `LOCK`='%d',\
`ALARM`='%d', `PRICE`='%d' WHERE `ID`='%d'",propertyInfo[propertyid][E_X],propertyInfo[propertyid][E_Y],propertyInfo[propertyid][E_Z],propertyInfo[propertyid][E_INT],propertyInfo[propertyid][E_VW],
propertyInfo[propertyid][I_X],propertyInfo[propertyid][I_Y],propertyInfo[propertyid][I_Z],
propertyInfo[propertyid][I_INT],propertyInfo[propertyid][CASHBOX],propertyInfo[propertyid][TYPE],propertyInfo[propertyid][LEVEL],propertyInfo[propertyid][NAME],propertyInfo[propertyid][OWNER],propertyInfo[propertyid][CO_OWNER],propertyInfo[propertyid][SOLD],
propertyInfo[propertyid][LOCK],propertyInfo[propertyid][ALARM],propertyInfo[propertyid][PRICE], propertyid );
mysql_query(str);
//print(str);
It normally means that your actual line is too long, make it into more lines. If it's not that, you will need to use two or more format strings and then format those separate strings into one larger string.
|
Tied doing more lines didnt work. Could you help me out with that "more format strings"?
|
new str[2][256], largestr[512];
format(str[0], sizeof(str[0]), "%s.....", Varables...);
format(str[1], sizeof(str[1]), "%d.....", More Varables...);
format(largestr, sizeof(largestr), "%s %s", str[0], str[1]);
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);
pawn Код:
|
new str[5][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[2]), "`I_INT`='%d', `CASHBOX`='%d', `TYPE`='%d', `LEVEL`='%d',", propertyInfo[propertyid][I_INT],propertyInfo[propertyid][CASHBOX],propertyInfo[propertyid][TYPE],propertyInfo[propertyid][LEVEL]);
format(str[3], sizeof(str[3]), "`NAME`='%s', `OWNER`='%s',`CO_OWNER`='%s', `SOLD`='%d',", propertyInfo[propertyid][NAME],propertyInfo[propertyid][OWNER],propertyInfo[propertyid][CO_OWNER],propertyInfo[propertyid][SOLD],);
format(str[4], sizeof(str[4]), "`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", str[0], str[1], str[2], str[3], str[4]);
mysql_query(lstr);
You made a little mistake, you formatted 3 times the third string, with the lenght of the others, the right code is
pawn Код:
|
(540) : error 001: expected token: "]", but found "-integer value-"
(540) : warning 215: expression has no effect
(540) : error 001: expected token: ";", but found "]"
(540) : error 029: invalid expression, assumed zero
(540) : fatal error 107: too many error messages on one line
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]);
str[5][150]
//Or
str[150][5]