Hey Leute,
ich wollte mal meinen Skin versuchen zu speichern, aber das funktioniert irgendwie nicht..
Könnt ihr mir vllt sagen, was ich falsch gemacht habe?
public OnPlayerRequestClass(playerid, classid)
{
new string[300];
new Pfad[64], Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
format(Pfad,sizeof(Pfad),"/Accounts/%s.txt",Name);
if(!dini_Exists(Pfad))
{
SetPlayerVirtualWorld(playerid,1);
SetPlayerCameraPos(playerid,1474.7272,-1620.4200,60.6713);
SetPlayerCameraLookAt(playerid,1521.0511,-1743.9844,13.5469);
SetPlayerPos(playerid,1507.4302,-1674.9789,14.0469);
format(string,sizeof(string),"{FEFEFE}Willkommen auf {009BFF}New-Evolution-Reallife{FEFEFE}! Um auf diesem Server spielen zu können,\nmusst du dich nun registrieren. Dadurch erstellst du dir einen Eintrag in die\nDatenbank und kannst jederzeit auf dem Server joinen. {009BFF}Gib dein Passwort ein:");
ShowPlayerDialog(playerid,DIALOG_REGISTER1,DIALOG_STYLE_INPUT,"Registrieren",string,"Registrieren","Abbrechen");
}
else if(dini_Exists(Pfad))
{
SetPlayerVirtualWorld(playerid,1);
SetPlayerCameraPos(playerid,1474.7272,-1620.4200,60.6713);
SetPlayerCameraLookAt(playerid,1521.0511,-1743.9844,13.5469);
SetPlayerPos(playerid,1507.4302,-1674.9789,14.0469);
format(string,sizeof(string),"{FEFEFE}Willkommen zurück auf {009BFF}New-Evolution-Reallife{FEFEFE}! Bitte logge dich unten ein,\num weiterzuspielen. Oder drück auf Abbrechen, um den Vorgang abzubrechen.\n{009BFF}Bitte gib hier dein Passwort ein:");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login",string,"Login","Abbrechen");
}
if(GetPVarInt(playerid,"loggedin")==1)
{
if(PlayerInfo[playerid][pMember] == 0 && PlayerInfo[playerid][pLeader] == 0)
{
SetSpawnInfo(playerid,0,PlayerInfo[playerid][pSkin],1758.6577,-1950.2799,14.1096,307.9163,0,0,0,0,0,0);
SpawnPlayer(playerid);
}
}
return 1;
}
stock SavePlayer(playerid)
{
new Pfad[64], Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
format(Pfad,sizeof(Pfad),"/Accounts/%s.txt",Name);
if(!dini_Exists(Pfad))
{
dini_Create(Pfad);
}
else if(dini_Exists(Pfad))
{
dini_IntSet(Pfad,"Adminlevel",PlayerInfo[playerid][pAdmin]);
dini_IntSet(Pfad,"Supporter",PlayerInfo[playerid][pSup]);
dini_IntSet(Pfad,"Geld",PlayerInfo[playerid][pGeld]);
dini_IntSet(Pfad,"Level",PlayerInfo[playerid][pLevel]);
dini_IntSet(Pfad,"Member",PlayerInfo[playerid][pMember]);
dini_IntSet(Pfad,"Leader",PlayerInfo[playerid][pLeader]);
dini_IntSet(Pfad,"Skin",PlayerInfo[playerid][pSkin]);
}
}
stock LoadPlayer(playerid)
{
new Pfad[64], Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
format(Pfad,sizeof(Pfad),"/Accounts/%s.txt",Name);
if(dini_Exists(Pfad))
{
ResetPlayerMoney(playerid);
PlayerInfo[playerid][pGeld] = dini_Int(Pfad,"Geld");
GivePlayerMoney(playerid,PlayerInfo[playerid][pGeld]);
PlayerInfo[playerid][pLevel] = dini_Int(Pfad,"Level");
SetPlayerScore(playerid,PlayerInfo[playerid][pLevel]);
PlayerInfo[playerid][pAdmin] = dini_Int(Pfad,"Adminlevel");
PlayerInfo[playerid][pSup] = dini_Int(Pfad,"Supporter");
PlayerInfo[playerid][pMember] = dini_Int(Pfad,"Member");
PlayerInfo[playerid][pLeader] = dini_Int(Pfad,"Leader");
PlayerInfo[playerid][pSkin] = dini_Int(Pfad,"Skin");
SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
}
}