Hallo liebe Community,
ich habe wieder ein Problem, und zwar hab ich das so gemacht das wenn der Spieler disconnected, von seinem Auto gespeichert wird ob es verschlossen oder offen ist. Leider schließt er das Auto nicht wenn ich rein komme.
Mein Code (zum Autos laden):
public OnPlayerCarsLoad(playerid)
{
new num_fields,num_rows;
cache_get_data(num_rows,num_fields,dbhandle);
if(!num_rows)return 1;
for(new i=0; i<num_rows; i++)
{
new id=getFreeCarID();
cInfo[id][model]=cache_get_field_content_int(i,"model",dbhandle);
cInfo[id][besitzer]=cache_get_field_content_int(i,"besitzer",dbhandle);
cInfo[id][c_x]=cache_get_field_content_float(i,"x",dbhandle);
cInfo[id][c_y]=cache_get_field_content_float(i,"y",dbhandle);
cInfo[id][c_z]=cache_get_field_content_float(i,"z",dbhandle);
cInfo[id][c_r]=cache_get_field_content_float(i,"r",dbhandle);
cInfo[id][vcolor1]=cache_get_field_content_int(i,"color1",dbhandle);
cInfo[id][vcolor2]=cache_get_field_content_int(i,"color2",dbhandle);
cInfo[id][tuning1]=cache_get_field_content_int(i,"tuning1",dbhandle);
cInfo[id][tuning2]=cache_get_field_content_int(i,"tuning2",dbhandle);
cInfo[id][tuning3]=cache_get_field_content_int(i,"tuning3",dbhandle);
cInfo[id][tuning4]=cache_get_field_content_int(i,"tuning4",dbhandle);
cInfo[id][tuning5]=cache_get_field_content_int(i,"tuning5",dbhandle);
cInfo[id][tuning6]=cache_get_field_content_int(i,"tuning6",dbhandle);
cInfo[id][tuning7]=cache_get_field_content_int(i,"tuning7",dbhandle);
cInfo[id][tuning8]=cache_get_field_content_int(i,"tuning8",dbhandle);
cInfo[id][tuning9]=cache_get_field_content_int(i,"tuning9",dbhandle);
cInfo[id][tuning10]=cache_get_field_content_int(i,"tuning10",dbhandle);
cInfo[id][tuning11]=cache_get_field_content_int(i,"tuning11",dbhandle);
cInfo[id][tuning12]=cache_get_field_content_int(i,"tuning12",dbhandle);
cInfo[id][tuning13]=cache_get_field_content_int(i,"tuning13",dbhandle);
cInfo[id][tuning14]=cache_get_field_content_int(i,"tuning14",dbhandle);
cInfo[id][lock]=cache_get_field_content_int(i,"lock",dbhandle);
cInfo[id][db_id]=cache_get_field_content_int(i,"id",dbhandle);
cInfo[id][id_x]=CreateVehicle(cInfo[id][model],cInfo[id][c_x],cInfo[id][c_y],cInfo[id][c_z],cInfo[id][c_r],cInfo[id][vcolor1],cInfo[id][vcolor2],-1);
AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning1]);
AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning2]);
AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning3]);
AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning4]);
AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning5]);
AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning6]);
AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning7]);
AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning8]);
AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning9]);
AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning10]);
AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning11]);
AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning12]);
AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning13]);
AddVehicleComponent(cInfo[id][id_x], cInfo[id][tuning14]);
if(cInfo[id][lock]==1)
{
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(id, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(id, engine, lights, alarm, VEHICLE_PARAMS_ON, bonnet, boot, objective);
}
}
return 1;
}
Im Script natürlich richtig eingrückt.
Mit freundlichen Grüßen,
DexterA1
Sorry für die schlechte Formulierung