NAja habe es so gemacht aber geht mit sicherheit nicht xDD
public OnPlayerLogin(playerid,const string[])
{
new pname2[MAX_PLAYER_NAME];
new pname3[MAX_PLAYER_NAME];
new string2[64];
new string3[128];
GetPlayerName(playerid, pname2, sizeof(pname2));
format(string2, sizeof(string2), "%s.ini", pname2);
new File: UserFile = fopen(string2, io_read);
{
new pname2[MAX_PLAYER_NAME];
new pname3[MAX_PLAYER_NAME];
new string2[64];
new string3[128];
GetPlayerName(playerid, pname2, sizeof(pname2));
format(string2, sizeof(string2), "%s.ini", pname2);
new File: UserFile = fopen(string2, io_read);
if (UserFile)
{
new valtmp[128];
fread(UserFile, valtmp);strmid(PlayerInfo[playerid][pPassword], valtmp, 0, strlen(valtmp)-1, 255);
{
new valtmp[128];
fread(UserFile, valtmp);strmid(PlayerInfo[playerid][pPassword], valtmp, 0, strlen(valtmp)-1, 255);
if ((strcmp(PlayerInfo[playerid][pPassword], string, true, strlen(valtmp)-1) == 0))
{
new key[128],val[128];
new Data[128];
while(fread(UserFile,Data,sizeof(Data)))
{
key = ini_GetKey(Data);
if( strcmp( key , "Kills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKills] = strval( val ); }
if( strcmp( key , "Deaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDeaths] = strval( val ); }
if( strcmp( key , "Team" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pTeam] = strval( val ); }
if( strcmp( key , "Money" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCash] = strval( val ); }
if( strcmp( key , "Skin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSkin] = strval( val ); }
if( strcmp( key , "Geschlecht" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSex] = strval( val ); }
GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
SetPlayerTeam(playerid,PlayerInfo[playerid][pTeam]);
SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
new Geschlecht = PlayerInfo[playerid][pSex];
if(Geschlecht == 0 {
PlayerInfo[playerid][pSex] = Mannlich;
return 1;}
if(Geschlecht == 1 {
PlayerInfo[playerid][pSex] = Weiblich;
return 1;
}
}
fclose(UserFile);
gPlayerLogged[playerid] = 1;
gPlayerAccount[playerid] = 1;
new kills = PlayerInfo[playerid][pKills];
SetPlayerScore(playerid, kills);
GetPlayerName(playerid, pname3, sizeof(pname3));
format(string3, sizeof(string3), "Willkommen %s, du bist jetzt eingeloggt!", pname3);
SendClientMessage(playerid, COLOR_WHITE,string3);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Falsches Passwort");
fclose(UserFile);
}
}
return 1;
}
{
new key[128],val[128];
new Data[128];
while(fread(UserFile,Data,sizeof(Data)))
{
key = ini_GetKey(Data);
if( strcmp( key , "Kills" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pKills] = strval( val ); }
if( strcmp( key , "Deaths" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pDeaths] = strval( val ); }
if( strcmp( key , "Team" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pTeam] = strval( val ); }
if( strcmp( key , "Money" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pCash] = strval( val ); }
if( strcmp( key , "Skin" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSkin] = strval( val ); }
if( strcmp( key , "Geschlecht" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSex] = strval( val ); }
GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
SetPlayerTeam(playerid,PlayerInfo[playerid][pTeam]);
SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
new Geschlecht = PlayerInfo[playerid][pSex];
if(Geschlecht == 0 {
PlayerInfo[playerid][pSex] = Mannlich;
return 1;}
if(Geschlecht == 1 {
PlayerInfo[playerid][pSex] = Weiblich;
return 1;
}
}
fclose(UserFile);
gPlayerLogged[playerid] = 1;
gPlayerAccount[playerid] = 1;
new kills = PlayerInfo[playerid][pKills];
SetPlayerScore(playerid, kills);
GetPlayerName(playerid, pname3, sizeof(pname3));
format(string3, sizeof(string3), "Willkommen %s, du bist jetzt eingeloggt!", pname3);
SendClientMessage(playerid, COLOR_WHITE,string3);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Falsches Passwort");
fclose(UserFile);
}
}
return 1;
}