Hallo,
Ich habe ein Problem mit meinen Positions Daten diese Reseten immer auf 0 sobald man sich Einlogt ..
Ich schreib hier mal die save Datei ich denke mal es liegt daran..
vieleicht wisst ihr ja mehr
new Finder[MAX_PLAYERS][pBBB];
enum pBBB
{
Float:FX,
Float:FY,
Float:FZ,
FINT,
FDUTY,
Float:FFX,
Float:FFY,
Float:FFZ,
};
public OnPlayerConnect(playerid)
{
format(string,sizeof(string),"/Accounts/Finder/%s.ini",plname);
if(!dini_Exists(string))
{
dini_Create(string);
dini_IntSet(string,"FX",(0));
dini_IntSet(string,"FY",(0));
dini_IntSet(string,"FZ",(0));
dini_IntSet(string,"FINT",(0));
dini_IntSet(string,"FDUTY",(0));
dini_IntSet(string,"FFX",(0));
dini_IntSet(string,"FFY",(0));
dini_IntSet(string,"FFZ",(0));
}
else
{
new File: hFile = fopen(string, io_write);
if (hFile)
{
new var[128];
format(var, 128, "FX=%.4f\n",Finder[playerid][FX]);fwrite(hFile, var);
format(var, 128, "FY=%.4f\n",Finder[playerid][FY]);fwrite(hFile, var);
format(var, 128, "FZ=%.4f\n",Finder[playerid][FZ]);fwrite(hFile, var);
format(var, 128, "FINT=%d\n",Finder[playerid][FINT]);fwrite(hFile, var);
format(var, 128, "FDUTY=%d\n",Finder[playerid][FDUTY]);fwrite(hFile, var);
format(var, 128, "FFX=%.4f\n",Finder[playerid][FFX]);fwrite(hFile, var);
format(var, 128, "FFY=%.4f\n",Finder[playerid][FFY]);fwrite(hFile, var);
format(var, 128, "FFZ=%.4f\n",Finder[playerid][FFZ]);fwrite(hFile, var);
fclose(hFile);
}
}
return 1;
}
public Checksave()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
format(string,sizeof(string),"/Accounts/Finder/%s.ini",Name);
new File: hFile = fopen(string, io_write);
if (hFile)
{
new var[128];
format(var, 128, "FX=%.4f\n",Finder[i][FX]);fwrite(hFile, var);
format(var, 128, "FY=%.4f\n",Finder[i][FY]);fwrite(hFile, var);
format(var, 128, "FZ=%.4f\n",Finder[i][FZ]);fwrite(hFile, var);
format(var, 128, "FINT=%d\n",Finder[i][FINT]);fwrite(hFile, var);
format(var, 128, "FDUTY=%d\n",Finder[i][FDUTY]);fwrite(hFile, var);
format(var, 128, "FFX=%.4f\n",Finder[i][FFX]);fwrite(hFile, var);
format(var, 128, "FFY=%.4f\n",Finder[i][FFY]);fwrite(hFile, var);
format(var, 128, "FFZ=%.4f\n",Finder[i][FFZ]);fwrite(hFile, var);
fclose(hFile);
}
}
}
printf("Accounts und Stuff Erfolgreich Gespeichert");
return 0;
}