Grüße an euch,
Ich möchte gerne meine Fahrzeug Farben Speichern. Er speichert alles nur die Fahrzeug Farben komischer weiße nicht.
stock SaveVehicles(string[],playerid)
{
new entry[256],str[256];
format(str, sizeof(str),"/Autohaus/%s.ini",SpielerName(playerid));
format(entry, sizeof(entry), "%s\n",string);
new File:hFile;
hFile = fopen(str, io_write);
fwrite(hFile, entry);
fclose(hFile);
return 1;
}
stock LoadVehicels(playerid)
{
new arrCoords[30][64];
new strFromFile2[256];
new string[256];
format(string, sizeof(string),"/Autohaus/%s.ini",SpielerName(playerid));
if(!fexist(string)) return 1;
new File: file = fopen(string, io_read);
if(file)
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
sInfo[playerid][cX] = floatstr(arrCoords[0]);
sInfo[playerid][cY] = floatstr(arrCoords[1]);
sInfo[playerid][cZ] = floatstr(arrCoords[2]);
sInfo[playerid][cA] = floatstr(arrCoords[3]);
sInfo[playerid][cFarbe1] = strval(arrCoords[4]);
sInfo[playerid][cFarbe2] = strval(arrCoords[5]);
sInfo[playerid][cModel] = strval(arrCoords[6]);
sInfo[playerid][cPreis] = strval(arrCoords[7]);
strmid(sInfo[playerid][cOwner], SpielerName(playerid), 0, strlen(SpielerName(playerid)), 255);
new str[128];
format(str, sizeof(str),"%s",SpielerName(playerid));
sInfo[playerid][cKey] = CreateVehicle(sInfo[playerid][cModel],sInfo[playerid][cX],sInfo[playerid][cY],sInfo[playerid][cZ],sInfo[playerid][cA],sInfo[playerid][cFarbe1],sInfo[playerid][cFarbe2],-1);
SetVehicleNumberPlate(sInfo[playerid][cKey],str);
SetVehicleToRespawn(sInfo[playerid][cKey]);
fclose(file);
}
return 1;
}
stock GetVehicleColor(vehicleID, &color1, &color2)
{
vehicleID = PROPERTY_OFFSET(vehicleID);
if(existproperty(_, "", vehicleID))
{
new colorStr[24],strPos;
getproperty(_, "", vehicleID, colorStr);
strunpack(colorStr, colorStr);
if((strPos = strfind(colorStr, "-")) != -1)
{
color1 = strval(colorStr);
color2 = strval(colorStr[strPos + 1]);
return 1;
}
}
return 0;
}
Freundliche Grüße