Warum funzt das nit?
Unter OnPlayerDisconnect
dini_IntSet(accFormat,"Skin",GetPlayerSkin(playerid));
Und wenn er sich eingeloggt hat:
SetPlayerSkin(playerid, dini_Int(accFormat,"Skin"));
Aber er hat immer Skin ID 0
Warum funzt das nit?
Unter OnPlayerDisconnect
dini_IntSet(accFormat,"Skin",GetPlayerSkin(playerid));
Und wenn er sich eingeloggt hat:
SetPlayerSkin(playerid, dini_Int(accFormat,"Skin"));
Aber er hat immer Skin ID 0
hast du vielleicht 2 verschiedene Ordner angegeben?
worunter hast du das? onplayerconnect? wenn ja mach das mal unter OnPlayerSpawn.
Der saved den Skin iwie garnit beim Disconnect
//E: Ah ... der wird doch saved... ich teste mal mit onplayerspawn^^
//E2: Nein, da errort der... es wird saved, aber ... wenn man einloggt und spawnt wird der Skin IMMER auf 0 gesetzt
poste mal scriptauschnitt wo überall was gesaved und wiedergegeben wird
public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"acc/%s.sav",pname);
if(fexist(accFormat) && Player[playerid][eingeloggt])
{
dini_IntSet(accFormat,"Adminlvl",Player[playerid][admin]);
dini_IntSet(accFormat,"Kills",Player[playerid][Kills]);
dini_IntSet(accFormat,"Deaths",Player[playerid][Deaths]);
dini_IntSet(accFormat,"vip",Player[playerid][vip]);
dini_IntSet(accFormat,"exp",Player[playerid][exp]);
dini_IntSet(accFormat,"Skin",GetPlayerSkin(playerid));
dini_IntSet(accFormat,"Geld",GetPlayerMoney(playerid));
dini_IntSet(accFormat,"Score",GetPlayerScore(playerid));
}
Player[playerid][eingeloggt] = 0;
return 1;
}
GESPEICHERT
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"acc/%s.sav",pname);
if(response)
{
switch(dialogid)
{
case DIALOG_LOGIN: // ID Login
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Please logg in ","Cancel","Next");
return SendClientMessage(playerid,0xFFFFFFFF,"No password!");
}
if(strcmp(inputtext,dini_Get(accFormat,"Passwort")) == 0) // Load PSW
{
Player[playerid][admin] = dini_Int(accFormat,"AdminLvl");
Player[playerid][Kills] = dini_Int(accFormat,"Kills");
Player[playerid][Deaths] = dini_Int(accFormat,"Deaths");
Player[playerid][vip] = dini_Int(accFormat,"vip");
Player[playerid][exp] = dini_Int(accFormat,"exp");
SetPlayerSkin(playerid, dini_Int(accFormat,"Skin"));
GivePlayerMoney(playerid,dini_Int(accFormat,"Geld"));
SetPlayerScore(playerid,dini_Int(accFormat,"Score"));
Player[playerid][eingeloggt] = 1; //player is logged in now
SendClientMessage(playerid,0xFFFFFFFF,"You have been sucessfully logged in.");
}
Wiedergegeben
Skin wird ja auch gespeichert.
Mach es mal so.
Spieler[playerid][skin] = dini_Int(accFormat,"skin");
SetPlayerSkin(playerid,Spieler[playerid][skin]);
Ungetestet!
Nope, dann errots^^