Moin,
ich habe ein Fahrzeug System. Ich erstelle ein Fahrzeug alles wunderbar es lässt sich benutzen wie es soll.
Jetzt passiert folgendes entweder ich schalte den Server ab oder restarte ihn völlig egal, sobald die Fahrzeuge aus der Datenbank geladen werden lassen sie sich zwar mit Commands ganz normal steuern (also auf abschließen und so) aber nur noch als beifahrer betreten als fahrer komm ich nicht rein.
Hoffe mir kann einer weiterhelfen
Hier mal mein laden:
Code
public onLoadPlayerCars()
{
print("================================================================");
print("*SERVER* Spielerfahrzeuge werden geladen...");
new count;
new num_fields,num_rows;
cache_get_data(num_rows,num_fields,dbhandle);
if(num_rows)
{
for(new i=0; i<num_rows; i++)
{
new id=getFreeCarId(),pstring[35],string[35],ownerstring[35];
cInfo[id][model]=cache_get_field_content_int(i,"model",dbhandle);
cInfo[id][ownerdbid]=cache_get_field_content_int(i,"ownerdbid",dbhandle);
cInfo[id][veh_x]=cache_get_field_content_float(i,"x",dbhandle);
cInfo[id][veh_y]=cache_get_field_content_float(i,"y",dbhandle);
cInfo[id][veh_z]=cache_get_field_content_float(i,"z",dbhandle);
cInfo[id][veh_r]=cache_get_field_content_float(i,"r",dbhandle);
cInfo[id][veh_color1]=cache_get_field_content_int(i,"color1",dbhandle);
cInfo[id][veh_color2]=cache_get_field_content_int(i,"color2",dbhandle);
cInfo[id][dbid]=cache_get_field_content_int(i,"dbid",dbhandle);
cInfo[id][resale]=cache_get_field_content_int(i,"resale",dbhandle);
cInfo[id][locked]=cache_get_field_content_int(i,"locked",dbhandle);
cInfo[id][carmod][0] = cache_get_field_content_int(i,"spoiler",dbhandle);
cInfo[id][carmod][1] = cache_get_field_content_int(i,"hood",dbhandle);
cInfo[id][carmod][2] = cache_get_field_content_int(i,"roof",dbhandle);
cInfo[id][carmod][3] = cache_get_field_content_int(i,"sideskirt",dbhandle);
cInfo[id][carmod][4] = cache_get_field_content_int(i,"lamps",dbhandle);
cInfo[id][carmod][5] = cache_get_field_content_int(i,"nitro",dbhandle);
cInfo[id][carmod][6] = cache_get_field_content_int(i,"exhaust",dbhandle);
cInfo[id][carmod][7] = cache_get_field_content_int(i,"wheels",dbhandle);
cInfo[id][carmod][8] = cache_get_field_content_int(i,"stereo",dbhandle);
cInfo[id][carmod][9] = cache_get_field_content_int(i,"hydraulics",dbhandle);
cInfo[id][carmod][10] = cache_get_field_content_int(i,"frontbumper",dbhandle);
cInfo[id][carmod][11] = cache_get_field_content_int(i,"rearbumper",dbhandle);
cInfo[id][carmod][12] = cache_get_field_content_int(i,"ventright",dbhandle);
cInfo[id][carmod][13] = cache_get_field_content_int(i,"ventleft",dbhandle);
cInfo[id][neon][0] = cache_get_field_content_int(i,"neon1",dbhandle);
cInfo[id][neon][1] = cache_get_field_content_int(i,"neon2",dbhandle);
cInfo[id][paintjob] = cache_get_field_content_int(i,"paintjob",dbhandle);
cInfo[id][frakid] = cache_get_field_content_int(i,"frakid",dbhandle);
cInfo[id][crewid] = cache_get_field_content_int(i,"crewid",dbhandle);
cInfo[id][taxi] = cache_get_field_content_int(i,"taxi",dbhandle);
cInfo[id][destroyed] = cache_get_field_content_int(i,"destroyed",dbhandle);
cInfo[id][insurance] = cache_get_field_content_int(i,"insurance",dbhandle);
cInfo[id][transmitter] = cache_get_field_content_int(i,"transmitter",dbhandle);
cache_get_field_content(i,"plate",string);
cache_get_field_content(i,"owner",ownerstring);
cInfo[id][plate] = string;
cInfo[id][owner] = ownerstring;
cInfo[id][vehid]=CreateVehicle(cInfo[id][model],cInfo[id][veh_x],cInfo[id][veh_y],cInfo[id][veh_z],cInfo[id][veh_r],cInfo[id][veh_color1],cInfo[id][veh_color2],-1,0);
AttachNeonToVehicle(cInfo[id][vehid],cInfo[id][neon][0]);
tank[cInfo[id][vehid]] = cache_get_field_content_int(i,"tank",dbhandle);
format(pstring,sizeof(pstring),"%s",string);
SetVehicleNumberPlate(cInfo[id][vehid],cInfo[id][plate]);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(cInfo[id][vehid],engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(cInfo[id][vehid],engine,lights,alarm,cInfo[i][locked],bonnet,boot,objective);
km_Info[1][cInfo[id][vehid]] = cInfo[id][locked]=cache_get_field_content_int(i,"km",dbhandle);
km_Info[0][cInfo[id][vehid]] = cInfo[id][locked]=cache_get_field_content_int(i,"m",dbhandle);
for(new k=0; k<14; k++)
{
if(!cInfo[id][carmod][k])continue;
AddVehicleComponent(cInfo[id][vehid],cInfo[id][carmod][k]);
}
ChangeVehiclePaintjob(cInfo[id][vehid],cInfo[id][paintjob]);
count++;
}
}
printf("*SERVER* Es wurden %i Spielerfahrzeuge geladen",count);
print("================================================================");
return 1;
}
Alles anzeigen
MfG