Hallo liebe Forum User ich habe ein problem mit den login system von
BlackFoX_UD_
ich habe es genau so und entwas hinzugefügt (bearbeitet)aber wen ich auf den server gehe speichert er nur das passwort
Script :
public OnPlayerDisconnect(playerid, reason)
{
new string[256];
format(string, sizeof(string), "***-||- %s verlässt den Server -||-***",ReadName(playerid));
SendClientMessageToAll(COLOR_GREY, string);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"/User/%s.datei",pname);
if(fexist(accFormat) && PlayerInfo[playerid][eingeloggt])
{
dini_IntSet(accFormat,"AdminLevel",PlayerInfo[playerid][pAdmin]);
dini_IntSet(accFormat,"Geld",GetPlayerMoney(playerid));
dini_IntSet(accFormat,"BankGeld",PlayerInfo[playerid][pBankCash]);
dini_IntSet(accFormat,"Skin",PlayerInfo[playerid][pSkin]);
dini_IntSet(accFormat,"Wanteds",PlayerInfo[playerid][pWanteds]);
dini_IntSet(accFormat,"Duty",PlayerInfo[playerid][pDuty]);
dini_IntSet(accFormat,"Member",PlayerInfo[playerid][pMember]);
dini_IntSet(accFormat,"Leader",PlayerInfo[playerid][pLeader]);
dini_IntSet(accFormat,"FraktionSkin",PlayerInfo[playerid][pFSkin]);
dini_IntSet(accFormat,"Rank",PlayerInfo[playerid][pRank]);
dini_IntSet(accFormat,"AutoSchein",PlayerInfo[playerid][pCarLic]);
dini_IntSet(accFormat,"MotorradSchein",PlayerInfo[playerid][pMofaLic]);
dini_IntSet(accFormat,"FlugSchein",PlayerInfo[playerid][pFlugLic]);
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"/User/%s.datei",pname);
if(response)
{
switch(dialogid) // dialogid auswählen
{
case DIALOG_LOGIN: // ID Login
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Abbrechen","Weiter");
return SendClientMessage(playerid,0xFFFFFFFF,"Kein Passwort angegeben!");
}
if(strcmp(inputtext,dini_Get(accFormat,"Passwort")) == 0) // Passwort Direkt aus der Datei Laden
{
PlayerInfo[playerid][pAdmin] = dini_Int(accFormat,"AdminLevel");
GivePlayerMoney(playerid,dini_Int(accFormat,"Geld"));
PlayerInfo[playerid][pBankCash] = dini_Int(accFormat,"BankGeld");
PlayerInfo[playerid][pSkin] = dini_Int(accFormat,"Skin");
PlayerInfo[playerid][pWanteds] = dini_Int(accFormat,"Wanteds");
PlayerInfo[playerid][pDuty] = dini_Int(accFormat,"Duty");
PlayerInfo[playerid][pMember] = dini_Int(accFormat,"Member");
PlayerInfo[playerid][pLeader] = dini_Int(accFormat,"Leader");
PlayerInfo[playerid][pFSkin] = dini_Int(accFormat,"FraktionSkin");
PlayerInfo[playerid][pRank] = dini_Int(accFormat,"Rank");
PlayerInfo[playerid][pCarLic] = dini_Int(accFormat,"AutoSchein");
PlayerInfo[playerid][pMofaLic] = dini_Int(accFormat,"MotorradSchein");
PlayerInfo[playerid][pFlugLic] = dini_Int(accFormat,"FlugSchein");
PlayerInfo[playerid][eingeloggt] = 1; // Spieler ist nun erfolgreich eingeloggt
SendClientMessage(playerid,0xFFFFFFFF,"Du wurdest erfolgreich eingeloggt.");
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Abbrechen","Weiter");
SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort war Falsch!");
}
}
case DIALOG_REG: // ID Registrieren
{
if(!strlen(inputtext)) // Text darf nicht = Null sein Null im Sinne von nichts
{
ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Abbrechen","Weiter");
return SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort ist zu kurz!");
}
dini_Create(accFormat);
dini_Set(accFormat,"Passwort",inputtext);
GivePlayerMoney(playerid, (START_CASH));
PlayerInfo[playerid][pAdmin] = 0;
PlayerInfo[playerid][pBankCash] = 50000;
PlayerInfo[playerid][pSkin] = 0;
PlayerInfo[playerid][pWanteds] =0 ;
PlayerInfo[playerid][pDuty] = 0;
PlayerInfo[playerid][pMember] = 1;
PlayerInfo[playerid][pLeader] = 0;
PlayerInfo[playerid][pFSkin] = 0;
PlayerInfo[playerid][pRank] = 0;
PlayerInfo[playerid][pCarLic] = 0;
PlayerInfo[playerid][pMofaLic] = 0;
PlayerInfo[playerid][pFlugLic] = 0;
PlayerInfo[playerid][eingeloggt] = 1;
SendClientMessage(playerid,0xFFFFFFFF,"Account wurde angelegt und du wurdest eingeloggt.");
}
}
}
else
{
switch(dialogid)
{
case DIALOG_LOGIN:ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Abbrechen","Weiter");
case DIALOG_REG:ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Abbrechen","Weiter");
}
}
//=====================================================================================================================================
return 1;
}
public OnPlayerConnect(playerid)
{
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"/User/%s.datei",pname);
if(fexist(accFormat))
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Abbrechen","Weiter");
}
else
{
ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Abbrechen","Weiter");
}
return 1;
}
wo ist der fehler bitt um hilfe ????
MFG
Ingo
Edit1// Überscrift bearbeitet
Edit2// edit1 vergessen