Die Tuningteile werden in der datenbank zwar gespeichert aber beim laden sollten die eigentlich ans fahrzeug ran aber es funzt net ;
hir der stock laden:
stock loadCar(playerid)
{
GetPlayerName(playerid, pAutoInfo[playerid][sName], MAX_PLAYER_NAME);
pAutoInfo[playerid][pKey] = mysql_GetInt("cars", "Key", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][pAUTOPoS_X] = mysql_GetFloat("cars", "AutoX", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][pAUTOPoS_Y] = mysql_GetFloat("cars", "AutoY", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][pAUTOPoS_Z] = mysql_GetFloat("cars", "AutoZ", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][pAUTOPoS_A] = mysql_GetFloat("cars", "AutoA", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][ModelID] = mysql_GetInt("cars", "ModelID", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][Farbe1] = mysql_GetInt("cars", "Farbe1", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][Farbe2] = mysql_GetInt("cars", "Farbe2", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][Preis] = mysql_GetInt("cars", "VKPreis", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][spaintjobid] = mysql_GetInt("cars", "PaintJob", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][modspoiler] = mysql_GetInt("cars", "Spoiler", "Name", pAutoInfo[playerid][sName]);// wird geladen
pAutoInfo[playerid][modnitro] = mysql_GetInt("cars", "Nitro", "Name", pAutoInfo[playerid][sName]);// wird geladen
pAutoInfo[playerid][modwheels] = mysql_GetInt("cars", "Wheels", "Name", pAutoInfo[playerid][sName]);// wird geladen
pAutoInfo[playerid][modlights] = mysql_GetInt("cars", "Lights", "Name", pAutoInfo[playerid][sName]);// wird geladen
pAutoInfo[playerid][Carid] = CreateVehicle(pAutoInfo[playerid][ModelID],pAutoInfo[playerid][pAUTOPoS_X],pAutoInfo[playerid][pAUTOPoS_Y],pAutoInfo[playerid][pAUTOPoS_Z],pAutoInfo[playerid][pAUTOPoS_A],pAutoInfo[playerid] [Farbe1],pAutoInfo[playerid][Farbe2],-1);
if(pAutoInfo[playerid][spaintjobid]!=-1) {ChangeVehiclePaintjob(pAutoInfo[playerid][Carid],pAutoInfo[playerid][spaintjobid]);}
if(pAutoInfo[playerid][modspoiler]!=-1) {AddVehicleComponent(pAutoInfo[playerid][Carid],pAutoInfo[playerid][modspoiler]);}// hir
if(pAutoInfo[playerid][modnitro]!=-1) {AddVehicleComponent(pAutoInfo[playerid][Carid],pAutoInfo[playerid][modnitro]);} // hir
if(pAutoInfo[playerid][modwheels]!=-1) {AddVehicleComponent(pAutoInfo[playerid][Carid],pAutoInfo[playerid][modwheels]);} // hir
if(pAutoInfo[playerid][modlights]!=-1) {AddVehicleComponent(pAutoInfo[playerid][Carid],pAutoInfo[playerid][modlights]);}// hir
printf("--> Das Fahrzeug von %s wurde erfolgreich von der MySQL Datenbak geladen.", pAutoInfo[playerid][sName]);
return 1;
}
{
GetPlayerName(playerid, pAutoInfo[playerid][sName], MAX_PLAYER_NAME);
pAutoInfo[playerid][pKey] = mysql_GetInt("cars", "Key", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][pAUTOPoS_X] = mysql_GetFloat("cars", "AutoX", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][pAUTOPoS_Y] = mysql_GetFloat("cars", "AutoY", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][pAUTOPoS_Z] = mysql_GetFloat("cars", "AutoZ", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][pAUTOPoS_A] = mysql_GetFloat("cars", "AutoA", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][ModelID] = mysql_GetInt("cars", "ModelID", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][Farbe1] = mysql_GetInt("cars", "Farbe1", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][Farbe2] = mysql_GetInt("cars", "Farbe2", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][Preis] = mysql_GetInt("cars", "VKPreis", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][spaintjobid] = mysql_GetInt("cars", "PaintJob", "Name", pAutoInfo[playerid][sName]);
pAutoInfo[playerid][modspoiler] = mysql_GetInt("cars", "Spoiler", "Name", pAutoInfo[playerid][sName]);// wird geladen
pAutoInfo[playerid][modnitro] = mysql_GetInt("cars", "Nitro", "Name", pAutoInfo[playerid][sName]);// wird geladen
pAutoInfo[playerid][modwheels] = mysql_GetInt("cars", "Wheels", "Name", pAutoInfo[playerid][sName]);// wird geladen
pAutoInfo[playerid][modlights] = mysql_GetInt("cars", "Lights", "Name", pAutoInfo[playerid][sName]);// wird geladen
pAutoInfo[playerid][Carid] = CreateVehicle(pAutoInfo[playerid][ModelID],pAutoInfo[playerid][pAUTOPoS_X],pAutoInfo[playerid][pAUTOPoS_Y],pAutoInfo[playerid][pAUTOPoS_Z],pAutoInfo[playerid][pAUTOPoS_A],pAutoInfo[playerid] [Farbe1],pAutoInfo[playerid][Farbe2],-1);
if(pAutoInfo[playerid][spaintjobid]!=-1) {ChangeVehiclePaintjob(pAutoInfo[playerid][Carid],pAutoInfo[playerid][spaintjobid]);}
if(pAutoInfo[playerid][modspoiler]!=-1) {AddVehicleComponent(pAutoInfo[playerid][Carid],pAutoInfo[playerid][modspoiler]);}// hir
if(pAutoInfo[playerid][modnitro]!=-1) {AddVehicleComponent(pAutoInfo[playerid][Carid],pAutoInfo[playerid][modnitro]);} // hir
if(pAutoInfo[playerid][modwheels]!=-1) {AddVehicleComponent(pAutoInfo[playerid][Carid],pAutoInfo[playerid][modwheels]);} // hir
if(pAutoInfo[playerid][modlights]!=-1) {AddVehicleComponent(pAutoInfo[playerid][Carid],pAutoInfo[playerid][modlights]);}// hir
printf("--> Das Fahrzeug von %s wurde erfolgreich von der MySQL Datenbak geladen.", pAutoInfo[playerid][sName]);
return 1;
}
Komischer weisse geht ChangeVehiclePaintjob.
aber die Tuningteile wie z.B. Spoiler geht net
Dank im vorraus.
mfg. Fabi.StaR