Hey Leute,
sobald ich mich einlogge,
schließt der Server die Connection wieso ?
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
if(gPlayerAccount[playerid] == 1 && gPlayerLogged[playerid] == 0)
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Bitte logge dich in deinen Account ein!","Login","Abbrechen");
}
else if(gPlayerAccount[playerid] == 0 && gPlayerLogged[playerid] == 0)
{
ShowPlayerDialog(playerid,DIALOG_REG,DIALOG_STYLE_MSGBOX,"Account","Du benötigst einen Account, um auf diesem Server zu spielen!","Erstellen","Abbrechen");
}
return 1;
}
[pwn]
public OnPlayerLogin(playerid,password[])
{
new string2[128];
new playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername2, sizeof(playername2));
format(string2, sizeof(string2), "/Accounts/%s.ini", playername2);
new File: UserFile = fopen(string2, io_read);
if ( UserFile )
{
new PassData[256];
new keytmp[256], valtmp[256];
fread( UserFile , PassData , sizeof( PassData ) );
keytmp = ini_GetKey( PassData );
if( strcmp( keytmp , "Key" , true ) == 0 )
{
valtmp = ini_GetValue( PassData );
strmid(SpielerInfo[playerid][pKey], valtmp, 0, strlen(valtmp)-1, 255);
}
if(strcmp(SpielerInfo[playerid][pKey],password, true ) == 0 )
{
new key[ 256 ] , val[ 256 ];
new Data[ 256 ];
while ( fread( UserFile , Data , sizeof( Data ) ) )
{
key = ini_GetKey( Data );
if( strcmp( key , "Level" , true ) == 0 ) { val = ini_GetValue( Data ); SpielerInfo[playerid][pScore] = strval( val ); }
if( strcmp( key , "AdminLevel" , true ) == 0 ) { val = ini_GetValue( Data ); SpielerInfo[playerid][pAdmin] = strval( val ); }
if( strcmp( key , "Waffen" , true ) == 0 ) { val = ini_GetValue( Data ); SpielerInfo[playerid][pWaffe] = strval( val ); }
if( strcmp( key , "DonateRank" , true ) == 0 ) { val = ini_GetValue( Data ); SpielerInfo[playerid][pPremium] = strval( val ); }
if( strcmp( key , "Gang" , true ) == 0 ) { val = ini_GetValue( Data ); SpielerInfo[playerid][pGang] = strval( val ); }
if( strcmp( key , "Boss" , true ) == 0 ) { val = ini_GetValue( Data ); SpielerInfo[playerid][pBoss] = strval( val ); }
if( strcmp( key , "Mute" , true ) == 0 ) { val = ini_GetValue( Data ); SpielerInfo[playerid][pMuted] = strval( val ); }
//if( strcmp( key , "UpgradePoints" , true ) == 0 ) { val = ini_GetValue( Data ); SpielerInfo[playerid][gPupgrade] = strval( val ); }
}//end while
fclose(UserFile);//close the file after everything has been read in the while
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Das Passwort ist nicht korrekt! Bitte gib nun dein richtiges Passwort ein:","Login","Abbrechen");
fclose(UserFile);
gPlayerLogTries[playerid] += 1;
//if(gPlayerLogTries[playerid] == 4) { Ban(playerid); }
return 1;
}
SpawnPlayer(playerid);
gPlayerLogged[playerid] = 1;
}
return 1;
}
[/pwn]