public OnCarsSaved(vehicleid) {
new num_rows, num_fields;
cache_get_data(num_rows,num_fields,dbhandle);
if(!num_rows) {
new query[164];
format(query,sizeof(query),"INSERT INTO autos (x,y,z,r,paintjob,Color1,Color2,Spoiler,Hood,Roof,Sideskirt) VALUES('%f','%f','%f','%f','%i','%i','%i','%i','%i')",vInfo[vehicleid][v_x],vInfo[vehicleid][v_y],vInfo[vehicleid][v_z],vInfo[vehicleid][v_r],vInfo[vehicleid][v_paintjob],vInfo[vehicleid][v_Color1],vInfo[vehicleid][v_Color2],vInfo[vehicleid][v_spoiler],vInfo[vehicleid][v_hood],vInfo[vehicleid][v_roof],vInfo[vehicleid][v_sideskirt]);
mysql_function_query(dbhandle,query,false,"","");
format(query,sizeof(query),"INSERT INTO autos (Lamps,Nitro,Exhaust,Wheels,Stereo,Hydraulics,Front_Bumper,Rear_Bumper,Vent_Left,Vent_Right) VALUES ('%i','%i','%i','%i','%i','%i','%i','%i','%i','%i')",vInfo[vehicleid][v_lamps],vInfo[vehicleid][v_nitro],vInfo[vehicleid][v_exhaust],vInfo[vehicleid][v_wheels],vInfo[vehicleid][v_stereo],vInfo[vehicleid][v_hydraulics],vInfo[vehicleid][v_front_bumper],vInfo[vehicleid][v_rear_bumper],vInfo[vehicleid][v_vent_left],vInfo[vehicleid][v_vent_right]);
mysql_function_query(dbhandle,query,false,"","");
} else {
new query[200];
format(query,sizeof(query),"UPDATE autos SET x='%f',y='%f',z='%f',r='%f',paintjob='%i',Color1='%i' WHERE id='%i'",vInfo[vehicleid][v_x],vInfo[vehicleid][v_y],vInfo[vehicleid][v_z],vInfo[vehicleid][v_r],vInfo[vehicleid][v_paintjob],vInfo[vehicleid][v_Color1],vInfo[vehicleid][v_Color2], vInfo[vehicleid][v_db_id]);
mysql_function_query(dbhandle,query,false,"","");
format(query,sizeof(query),"UPDATE autos SET Color2='%i',Spoiler='%i',Hood='%i',Roof='%i',Sideskirt='%i' WHERE id='%i'",vInfo[vehicleid][v_Color1],vInfo[vehicleid][v_spoiler],vInfo[vehicleid][v_hood],vInfo[vehicleid][v_roof],vInfo[vehicleid][v_sideskirt],vInfo[vehicleid][v_db_id]);
mysql_function_query(dbhandle,query,false,"","");
format(query,sizeof(query),"UPDATE autos SET Lamps='%i',Nitro='%i',Exhaust='%i',Wheels='%i',Stereo='%i' WHERE id='%i'",vInfo[vehicleid][v_lamps],vInfo[vehicleid][v_nitro],vInfo[vehicleid][v_exhaust],vInfo[vehicleid][v_wheels],vInfo[vehicleid][v_stereo],vInfo[vehicleid][v_db_id]);
mysql_function_query(dbhandle,query,false,"","");
format(query,sizeof(query),"UPDATE autos SET Hydraulics='%i',Front_Bumper='%i',Rear_Bumper='%i',Vent_Left='%i',Vent_Right='%i' WHERE id='%i'",vInfo[vehicleid][v_hydraulics],vInfo[vehicleid][v_front_bumper],vInfo[vehicleid][v_rear_bumper],vInfo[vehicleid][v_vent_left],vInfo[vehicleid][v_vent_right],vInfo[vehicleid][v_db_id]);
mysql_function_query(dbhandle,query,false,"","");
}
}