01.01.2011, 08:03
pawn Code:
stock LoadAccount(playerid)
{
new Userfolder[64];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Userfolder,sizeof(Userfolder),"/Users/%s.txt",name);
SetPlayerScore(playerid,dini_Int(Userfolder,"Level"));// Score wird wieder gegeben, mit dini_int wird gelsen
GivePlayerMoney(playerid,dini_Int(Userfolder,"Cash")); //Geld wird gegeben was man hatte, das gespeicherte
PlayerInfo[playerid][Adminlevel]=dini_Int(Userfolder,"Adminlevel");
PlayerInfo[playerid][Faction]=dini_Int(Userfolder,"Faction");
PlayerInfo[playerid][pSex]=dini_Int(Userfolder,"pSex");
PlayerInfo[playerid][pAge]=dini_Int(Userfolder,"pAge");
PlayerInfo[playerid][pPnumber]=dini_Int(Userfolder,"pPnumber");
return;
}
stock UserSave(playerid)
{
new Userfolder[64];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(Userfolder,sizeof(Userfolder),"/Users/%s.txt",name);//Es wird in der SpielerDatei gespeichert
dini_IntSet(Userfolder,"Level",GetPlayerScore(playerid)); //Level Speichern, mit Int eine Zahl speichern. Userfolder wo, welche Reihe fьr Level und was soll er speichern, getplayerscore
dini_IntSet(Userfolder,"Cash",GetPlayerMoney(playerid)); //Geld Speichern
dini_IntSet(Userfolder,"Adminlevel",PlayerInfo[playerid][Adminlevel]);
dini_IntSet(Userfolder,"Faction",PlayerInfo[playerid][Faction]);
dini_IntSet(Userfolder,"pSex",PlayerInfo[playerid][pSex]);
dini_IntSet(Userfolder,"pAge",PlayerInfo[playerid][pAge]);
dini_IntSet(Userfolder,"pPnumber",PlayerInfo[playerid][pPnumber]);
dini_IntSet(Userfolder,"Faction",PlayerInfo[playerid][Faction]);
return 1;
}
Thats my code. My problem is, after every Server Restart the PlayerInfo thingy\'s are resetted. Only the Cash and Level is saved, but it always ask\'s me by the tutorial which Gender I\'m, I need to buy again a mobile Phone etc..
How can I do this that those things are also automatically loaded and stay forever? (the PlayerInfo functions..)