14.05.2018, 19:48
well you could create temporary array for tunings and when cancel is pressed, everything from array is removed.
PHP код:
new arrTempComps[max_players][14];
AddCompForPreview(pid,vid,comp){
arrTempComps[pid][GetVehicleComponentType(comp)]=comp;
AddVehicleComponent(vid,comp);
return 1;
}
SavePreviewComps(pid,vid){
for(new i; i < 14; i++){
Vehicle[vid][Tuning][i]=arrTempsComps[pid][i];
}
new s[120];
format(s,120,"update vehs set tune0...");
mysql_tquery(con0,s);
return 1;
}
RemovePreviewComps(pid,vid){
for(new i; i < 14; i++)if(arrTempComps[pid][i])RemoveVehicleComponent(vid,arrTempComps[i]),arrTempComps[i]=0;
return 1;
}