Input line too strong
#1

Code:
SaveVehicle(vehicleid) {

    if(!Iter_Contains(ServerVehicles, vehicleid)) return 0;

    format(vInfo[vehicleid][vehName], 16, GetVehicleName(vInfo[vehicleid][vehModel]));
    GetVehiclePos(vInfo[vehicleid][vehSessionID], vInfo[vehicleid][vehX], vInfo[vehicleid][vehY], vInfo[vehicleid][vehZ]);
    GetVehicleZAngle(vInfo[vehicleid][vehSessionID], vInfo[vehicleid][vehA]);

    new query[500];
    mysql_format(mysql, query, sizeof(query), "UPDATE `Vehicles` SET `vehName` = '%e', `vehOwner` = '%e', `vehLock` = %i, `vehModel` = %i,\
    `vehPlate` = '%e', `vehMod_1` = %i, `vehMod_2` = %i, `vehMod_3` = %i, `vehMod_4` = %i, `vehMod_5` = %i, `vehMod_6` = %i, `vehMod_7` = %i,\
    `vehMod_8` = %i, `vehMod_9` = %i, `vehMod_10` = %i, `vehMod_11` = %i, `vehMod_12` = %i, `vehMod_13` = %i, `vehMod_14` = %i, `vehColorOne` = %i,\
    `vehColorTwo` = %i, `vehX` = %f, `vehY` = %f, `vehZ` = %f, `vehA` = %f WHERE `vehID` = %d", vInfo[vehicleid][vehName], vInfo[vehicleid][vehOwner],
    vInfo[vehicleid][vehLock], vInfo[vehicleid][vehModel], vInfo[vehicleid][vehPlate], vInfo[vehicleid][vehMod][0], vInfo[vehicleid][vehMod][1], vInfo[vehicleid][vehMod][2], 
    vInfo[vehicleid][vehMod][3], vInfo[vehicleid][vehMod][4], vInfo[vehicleid][vehMod][5], vInfo[vehicleid][vehMod][6], vInfo[vehicleid][vehMod][7], vInfo[vehicleid][vehMod][8], 
    vInfo[vehicleid][vehMod][9], vInfo[vehicleid][vehMod][10], vInfo[vehicleid][vehMod][11], vInfo[vehicleid][vehMod][12], vInfo[vehicleid][vehMod][13], vInfo[vehicleid][vehColorOne],
    vInfo[vehicleid][vehColorTwo], vInfo[vehicleid][vehX], vInfo[vehicleid][vehY], vInfo[vehicleid][vehZ], vInfo[vehicleid][vehA], vInfo[vehicleid][vehID]);
    mysql_tquery(mysql, query);
    return 1;
}
Code:
rp.pwn(1585) : error 075: input line too long (after substitutions)
rp.pwn(1586) : error 037: invalid string (possibly non-terminated string)
rp.pwn(1586) : error 017: undefined symbol "UPDATE"
rp.pwn(1586) : error 029: invalid expression, assumed zero
rp.pwn(1586) : fatal error 107: too many error messages on one line
Reply
#2

Hello!

It's the problem that the compiler do it to one line while it compile the script.
Work with strcat or use mysql_format multiple times.

When you don't know how to realize that you can ask.
Reply
#3

Which part should I change to strcat?
Reply
#4

Do it like this:
PHP Code:
mysql_format(mysql,query,sizeof(query),"UPDATE `Vehicles` SET `vehName`='%e',`vehOwner`='%e',`vehLock`='%d',`vehModel`='%d',`vehPlate`='%e',`vehMod_1`='%d'",
vInfo[vehicleid][vehName], vInfo[vehicleid][vehOwner],vInfo[vehicleid][vehLock], vInfo[vehicleid][vehModel], vInfo[vehicleid][vehPlate], vInfo[vehicleid][vehMod][0]);
mysql_format(mysql,query,sizeof(query),"%s,`vehMod_2`='%d',`vehMod_3`='%d',`vehMod_4`='%d',`vehMod_5`='%d',`vehMod_6`='%d',`vehMod_7`='%d',`vehMod_8`='%d',`vehMod_9`='%d'",
query,vInfo[vehicleid][vehMod][1], vInfo[vehicleid][vehMod][2],vInfo[vehicleid][vehMod][3], vInfo[vehicleid][vehMod][4], vInfo[vehicleid][vehMod][5],
vInfo[vehicleid][vehMod][6], vInfo[vehicleid][vehMod][7], vInfo[vehicleid][vehMod][8]);
mysql_format(mysql,query,sizeof(query),"%s,`vehMod_10`='%d',`vehMod_11`='%d',`vehMod_12`='%d',`vehMod_13`='%d',`vehMod_14`='%d',`vehColorOne`='%d',`vehColorTwo`='%d'",
query,vInfo[vehicleid][vehMod][9], vInfo[vehicleid][vehMod][10], vInfo[vehicleid][vehMod][11], vInfo[vehicleid][vehMod][12], vInfo[vehicleid][vehMod][13], vInfo[vehicleid][vehColorOne],
vInfo[vehicleid][vehColorTwo]);
mysql_format(mysql,query,sizeof(query),"%s,`vehX`='%f',`vehY`='%f',`vehZ`='%f',`vehA`='%f' WHERE `vehID`='%d'",
query,vInfo[vehicleid][vehX], vInfo[vehicleid][vehY], vInfo[vehicleid][vehZ], vInfo[vehicleid][vehA], vInfo[vehicleid][vehID]); 
You needn't strcat when you do it like this.
Reply
#5

Or you can do it properly instead of trying to hack around the problem. See the tutorial about storing vehicle mods in my signature.
Reply
#6

Quote:
Originally Posted by Vince
View Post
Or you can do it properly instead of trying to hack around the problem. See the tutorial about storing vehicle mods in my signature.
Doing it by string field is easier. No need to create new table.

Veh enum:

Code:
vehicle_component[14],
Saving:

Code:
format(visual_tuning, sizeof(visual_tuning), "%d %d %d %d %d %d %d %d %d %d %d %d %d %d", comp0, comp1, comp2, comp3, comp4, comp5, comp6, comp7,comp8, comp9, comp10, comp11, comp12, comp13);
mysql_query(mySQLconnection, sprintf("UPDATE vehicles SET vehicle_component = '%s' WHERE vehicle_uid = %d", visual_tuning, Vehicle[vehid][vehicle_uid]));
Loading:

Code:
new tmp_comp[70];
cache_get_row(row, 24, tmp_comp);	
sscanf(tmp_comp, "a<d>[12]", Vehicle[vid][vehicle_component]);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)