Hey, mein Geld wird nach einem Relogg nicht gespiechert.
stock LoadPlayer(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
new Name[MAX_PLAYER_NAME],path[64];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
format(path, sizeof(path),"Administration/Users/%s.ini", Name);
SpielerInfo[playerid][pLevel] = dini_Int(path, "Level");
SpielerInfo[playerid][pGeld] = dini_Int(path, "Geld");
SpielerInfo[playerid][pAdmin] = dini_Int(path, "Admin");
SpielerInfo[playerid][pLeader] = dini_Int(path, "Leader" );
SpielerInfo[playerid][pMember] = dini_Int(path, "Member" );
SpielerInfo[playerid][pFraktion] = dini_Int(path, "Fraktion" );
SpielerInfo[playerid][pStadt] = dini_Int(path, "Stadt" );
SpielerInfo[playerid][pKills] = dini_Int(path, "Kills");
SpielerInfo[playerid][pTode] = dini_Int(path, "Tode");
SpielerInfo[playerid][pHaus] = dini_Int(path, "Haus");
}
return 1;
}
stock SavePlayer(playerid)
{
if(GetPVarInt(playerid,"Eingeloggt") == 1)
{
new Name[MAX_PLAYER_NAME],path[64];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
format(path, sizeof(path),"Administration/Users/%s.ini", Name);
dini_IntSet(path,"Level", SpielerInfo[playerid][pLevel]);
dini_IntSet(path,"Geld", SpielerInfo[playerid][pGeld]);
dini_IntSet(path,"Admin", SpielerInfo[playerid][pAdmin]);
dini_IntSet(path, "Leader", SpielerInfo[playerid][pLeader]);
dini_IntSet(path, "Member", SpielerInfo[playerid][pMember]);
dini_IntSet(path, "Fraktion", SpielerInfo[playerid][pFraktion]);
dini_IntSet(path, "Stadt", SpielerInfo[playerid][pStadt]);
dini_IntSet(path,"Kills", SpielerInfo[playerid][pKills]);
dini_IntSet(path,"Tode", SpielerInfo[playerid][pTode]);
dini_IntSet(path,"Haus", SpielerInfo[playerid][pHaus]);
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
SavePlayer(playerid);
DeletePVar(playerid,"Eingeloggt");
return 1;
}
Gruß,
iAIR