Ich habe schon seit langem das Problem, dass das Speichern von privaten Autos einfach nicht klappen will. Immer wenn ich mein Command ausführe bekomme ich nur ERROR: Unkown command zurück. Ich habe alles immer direkt in dem Befehl gehabt, aber jetzt habe ich eine Stock daraus gemacht, immer noch der selbe Fehler: (Ich habe zwei Abfragen bezüglich des Besitzers mal ausgeklammert um Fehler zu vermeiden)
stock SavePlayerVehicle(playerid)
{
new parkID;
parkID = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,COLOR_RED,"You have to be in a vehicle to use this command.");
//if(!IsPrivateCar(parkID))return SendClientMessage(playerid,COLOR_RED,"You can only use this command in your own vehicle.");
//if(!IsPlayerVehicleOwner(playerid, parkID))return SendClientMessage(playerid,COLOR_RED,"You can only use this command in your own vehicle.");
GetVehiclePos(parkID,cInfo[parkID][c_x],cInfo[parkID][c_y],cInfo[parkID][c_z]);
GetVehicleZAngle(parkID,cInfo[parkID][c_r]);
GetVehicleColor(parkID,cInfo[parkID][vcolor1],cInfo[parkID][vcolor2]);
cInfo[parkID][tuning0] = GetVehicleComponentInSlot(parkID,0);
cInfo[parkID][tuning1] = GetVehicleComponentInSlot(parkID,1);
cInfo[parkID][tuning2] = GetVehicleComponentInSlot(parkID,2);
cInfo[parkID][tuning3] = GetVehicleComponentInSlot(parkID,3);
cInfo[parkID][tuning4] = GetVehicleComponentInSlot(parkID,4);
cInfo[parkID][tuning5] = GetVehicleComponentInSlot(parkID,5);
cInfo[parkID][tuning6] = GetVehicleComponentInSlot(parkID,6);
cInfo[parkID][tuning7] = GetVehicleComponentInSlot(parkID,7);
cInfo[parkID][tuning8] = GetVehicleComponentInSlot(parkID,8);
cInfo[parkID][tuning9] = GetVehicleComponentInSlot(parkID,9);
cInfo[parkID][tuning10] = GetVehicleComponentInSlot(parkID,10);
cInfo[parkID][tuning11] = GetVehicleComponentInSlot(parkID,11);
cInfo[parkID][tuning12] = GetVehicleComponentInSlot(parkID,12);
cInfo[parkID][tuning13] = GetVehicleComponentInSlot(parkID,13);
new query[256];
format(query,sizeof(query),"UPDATE vehicles SET x='%f',y='%f',z='%f',r='%f',color1='%i',color2='%i',tune0='%i',tune1='%i',tune2='%i',tune3='%i',tune4='%i',tune5='%i',tune6='%i',tune7='%i',tune8='%i',tune9='%i',tune10='%i',tune11='%i',tune12='%i',tune13='%i' WHERE id='%i'",cInfo[parkID][c_x],cInfo[parkID][c_y],
cInfo[parkID][c_z],
cInfo[parkID][c_r],
cInfo[parkID][vcolor1],
cInfo[parkID][vcolor2],
cInfo[parkID][tuning0],
cInfo[parkID][tuning1],
cInfo[parkID][tuning2],
cInfo[parkID][tuning3],
cInfo[parkID][tuning4],
cInfo[parkID][tuning5],
cInfo[parkID][tuning6],
cInfo[parkID][tuning7],
cInfo[parkID][tuning8],
cInfo[parkID][tuning9],
cInfo[parkID][tuning10],
cInfo[parkID][tuning11],
cInfo[parkID][tuning12],
cInfo[parkID][tuning13],
cInfo[parkID][db_id]);
mysql_function_query(dbhandle,query,false,"","");
SendClientMessage(playerid,COLOR_RED,"Vehicle parked!");
return 1;
}
Ich bin mir zu 99% sicher es liegt an der parkID in mein Array cInfo.
cInfo[parkID].
Wieso bin ich mir so sicher ? Wenn ich alles in eine Schleife packe und das parkID dann durch ggf. "i" ersetze parken zwar alle Fahrzeuge an der selben Position, aber es funktioniert.