Hallo com.
ich versuche greade fahrzeuge zu speichern mit:
stock SaveCar(playerid, vehicleid)
{
new file[128];
format(file, sizeof file[], "/Autos/%d.txt", vehicleid);
if(!dini_Exists(file)){
new text[128];
format(text, sizeof text, "Fehler beim erstellen der Datei \"%s\" für die ID: %d", file, vehicleid);
if(!dini_Create(file)) return SendClientMessage(playerid, ROT, text);
}
dini_FloatSet(file, "xpos", cars[vehicleid][point][xpos]);
dini_FloatSet(file, "ypos", cars[vehicleid][point][ypos]);
dini_FloatSet(file, "zpos", cars[vehicleid][point][zpos]);
dini_FloatSet(file, "angel", cars[vehicleid][point][angel]);
dini_IntSet(file, "modelid", cars[vehicleid][modelid]);
dini_IntSet(file, "SPOILER", cars[vehicleid][mods][SPOILER]);
dini_IntSet(file, "HOOD", cars[vehicleid][mods][HOOD]);
dini_IntSet(file, "ROOF", cars[vehicleid][mods][ROOF]);
dini_IntSet(file, "SIDESKIRT", cars[vehicleid][mods][SIDESKIRT]);
dini_IntSet(file, "LAMPS", cars[vehicleid][mods][LAMPS]);
dini_IntSet(file, "NITRO", cars[vehicleid][mods][NITRO]);
dini_IntSet(file, "EXHAUST", cars[vehicleid][mods][EXHAUST]);
dini_IntSet(file, "WHEELS", cars[vehicleid][mods][WHEELS]);
dini_IntSet(file, "STEREO", cars[vehicleid][mods][STEREO]);
dini_IntSet(file, "HYDRAULICS", cars[vehicleid][mods][HYDRAULICS]);
dini_IntSet(file, "FRONT_BUMPER", cars[vehicleid][mods][FRONT_BUMPER]);
dini_IntSet(file, "REAR_BUMPER", cars[vehicleid][mods][REAR_BUMPER]);
dini_IntSet(file, "VENT_RIGHT", cars[vehicleid][mods][VENT_RIGHT]);
dini_IntSet(file, "VENT_LEFT", cars[vehicleid][mods][VENT_LEFT]);
return SendClientMessage(playerid, GRUN, "Auto gespeichert!");
}
leider gibt mir (selbst als eigenen befehl (/carid)) GetPlayerVehicleID nichts aus wodurch der Stock das Auto nicht speichern kann ?
/carid:
if (strcmp("/carid", cmdtext, true, 5) == 0)
{
new id = GetPlayerVehicleID(playerid), text[128];
format(text, sizeof text, "Deine Auto ID: %d", id);
SendClientMessage(playerid, GRUN, text);
return 1;
}