Speichern tut er es immer noch nicht und den Score läd er auch nciht
Dann schau mal ob das mit dem Code funktioniert:
ocmd:register(playerid,params[])
{
new pass[200],accFormat[128],name[24];
if(sscanf(params,"s",pass)) return SendClientMessage(playerid,Orange,"TIPP: /register [Passwort]");
GetPlayerName(playerid,name,24);
format(accFormat,128,"/Accounts/%s.ini",name);
if(!dini_Exists(accFormat))
{
dini_Create(accFormat);
dini_Set(accFormat,"Passwort",pass);
dini_IntSet(accFormat,"Score",0);
dini_IntSet(accFormat,"Admin",0);
dini_IntSet(accFormat,"Geld",0);
dini_IntSet(accFormat,"Kills",0);
dini_IntSet(accFormat,"Tode",0);
SpawnPlayer(playerid);
SendClientMessage(playerid,Gruen2,"Du hast dich erfolgreich registriert.");
Eingeloggt[playerid] = 1;
}
else return SendClientMessage(playerid,Rot,"Du bist bereits registriert!");
return 1;
}
ocmd:login(playerid,params[])
{
new pass[128],pw[128],accFormat[128],name[24];
if(sscanf(params,"s",pass)) return SendClientMessage(playerid,Orange,"TIPP: /login [Passwort]");
GetPlayerName(playerid,name,24);
format(accFormat,128,"/Accounts/%s.ini",name);
if(!dini_Exists(accFormat)) return SendClientMessage(playerid,Rot,"Du musst dich erst registrieren!");
format(pw,sizeof(pw),"%s",dini_Get(s,"Passwort"));
if(strcmp(pass,pw) == 0)
{
SetPlayerScore(playerid,dini_Int(accFormat,"Score"));
Spieler[playerid][Admin] = dini_Int(accFormat,"Admin");
GivePlayerMoney(playerid,dini_Int(accFormat,"Geld")-GetPlayerMoney(playerid));
Spieler[playerid][Kills] = dini_Int(accFormat,"Kills");
Spieler[playerid][Tode] = dini_Int(accFormat,"Tode");
Eingeloggt[playerid] = 1;
SpawnPlayer(playerid);
SendClientMessage(playerid,Gruen2,"Du hast dich erfolgreich eingeloggt.");
}
else return SendClientMessage(playerid,Rot,"Falsches Passwort angegeben!");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new pname[24],accFormat[128];
GetPlayerName(playerid,pname,24);
format(accFormat,sizeof(accFormat),"/Accounts/%s.ini",pname);
if(dini_Exists(accFormat) && Spieler[playerid][eingeloggt])
{
dini_IntSet(accFormat,"Score",Spieler[playerid][Score]);
dini_IntSet(accFormat,"Admin",Spieler[playerid][Admin]);
dini_IntSet(accFormat,"Geld",Spieler[playerid][Geld]);
dini_IntSet(accFormat,"Kills",Spieler[playerid][Kills]);
dini_IntSet(accFormat,"Tode",Spieler[playerid][Tode]);
}
Eingeloggt[playerid] = 0;
return 1;
}