case DIALOG_LOGIN: { if ( !response ) return Kick ( playerid ); if( response ) { if(!strlen(inputtext)) { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an invalid password.\n"WHITE"Type your password below to login.","Login","Quit"); } if(INI_Open(getINI(playerid))) { INI_ReadString(PlayerInfo[playerid][Pass],"Pass",20); if(strcmp(inputtext,PlayerInfo[playerid][Pass],false)) { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an incorrect password.\n"WHITE"Type your password below to login.","Login","Quit"); } new Float:x, Float:y, Float:z, Float:a; SetPlayerScore(playerid, INI_ReadInt("Score")); ResetPlayerMoney(playerid); GivePlayerMoney(playerid, INI_ReadInt("Cash")); PlayerInfo[playerid][Admin] = INI_ReadInt("Admin"); PlayerInfo[playerid][Skin] = INI_ReadInt("Skin"); x = INI_ReadFloat("Savedpositionx"); y = INI_ReadFloat("Savedpositiony"); z = INI_ReadFloat("Savedpositionz"); a = INI_ReadFloat("Savedpositiona"); SetSpawnInfo(playerid, 0, PlayerInfo[playerid][Skin], x, y, z, a, 0, 0, 0, 0, 0, 0); SetPlayerInterior(playerid, 3); SpawnPlayer(playerid); INI_Close(); } } }
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an incorrect password.\n"WHITE"Type your password below to login.","Login","Quit");
return 1;
if(strcmp(inputtext,PlayerInfo[playerid][Pass],false)) { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an incorrect password.\n"WHITE"Type your password below to login.","Login","Quit"); return false; }
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(!strlen(inputtext)) {
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an invalid password.\n"WHITE"Type your password below to login.","Login","Quit");
return 1;
}
if(INI_Open(getINI(playerid))) {
INI_ReadString(PlayerInfo[playerid][Pass],"Pass",20);
if(strcmp(inputtext,PlayerInfo[playerid][Pass],false)) {
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an incorrect password.\n"WHITE"Type your password below to login.","Login","Quit");
return 1;
}
new Float:x, Float:y, Float:z, Float:a;
SetPlayerScore(playerid, INI_ReadInt("Score"));
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, INI_ReadInt("Cash"));
PlayerInfo[playerid][Admin] = INI_ReadInt("Admin");
PlayerInfo[playerid][Skin] = INI_ReadInt("Skin");
x = INI_ReadFloat("Savedpositionx");
y = INI_ReadFloat("Savedpositiony");
z = INI_ReadFloat("Savedpositionz");
a = INI_ReadFloat("Savedpositiona");
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][Skin], x, y, z, a, 0, 0, 0, 0, 0, 0);
SetPlayerInterior(playerid, 3);
SpawnPlayer(playerid);
INI_Close();
}
}
}
if(strcmp(inputtext,PlayerInfo[playerid][Pass],false)) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an incorrect password.\n"WHITE"Type your password below to login.","Login","Quit");
When ive registered the server places the password in the user file but when i come to actually logging in say my password is password123 and i enter asdfjasdfjkf it still accepts it. Heres the code:
Код:
case DIALOG_LOGIN: { if ( !response ) return Kick ( playerid ); if( response ) { if(!strlen(inputtext)) { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an invalid password.\n"WHITE"Type your password below to login.","Login","Quit"); } if(INI_Open(getINI(playerid))) { INI_ReadString(PlayerInfo[playerid][Pass],"Pass",20); if(strcmp(inputtext,PlayerInfo[playerid][Pass],false)) { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an incorrect password.\n"WHITE"Type your password below to login.","Login","Quit"); } new Float:x, Float:y, Float:z, Float:a; SetPlayerScore(playerid, INI_ReadInt("Score")); ResetPlayerMoney(playerid); GivePlayerMoney(playerid, INI_ReadInt("Cash")); PlayerInfo[playerid][Admin] = INI_ReadInt("Admin"); PlayerInfo[playerid][Skin] = INI_ReadInt("Skin"); x = INI_ReadFloat("Savedpositionx"); y = INI_ReadFloat("Savedpositiony"); z = INI_ReadFloat("Savedpositionz"); a = INI_ReadFloat("Savedpositiona"); SetSpawnInfo(playerid, 0, PlayerInfo[playerid][Skin], x, y, z, a, 0, 0, 0, 0, 0, 0); SetPlayerInterior(playerid, 3); SpawnPlayer(playerid); INI_Close(); } } } |
case DIALOG_LOGIN:
{
if(!response) return Kick ( playerid );
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an invalid password.\n"WHITE"Type your password below to login.","Login","Quit");
return 1;
}
if(INI_Open(getINI(playerid)))
{
INI_ReadString(PlayerInfo[playerid][Pass],"Pass",20);
if(strcmp(inputtext,PlayerInfo[playerid][Pass],false))
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an incorrect password.\n"WHITE"Type your password below to login.","Login","Quit");
return 1;
}
new Float:x, Float:y, Float:z, Float:a;
SetPlayerScore(playerid, INI_ReadInt("Score"));
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, INI_ReadInt("Cash"));
PlayerInfo[playerid][Admin] = INI_ReadInt("Admin");
PlayerInfo[playerid][Skin] = INI_ReadInt("Skin");
x = INI_ReadFloat("Savedpositionx");
y = INI_ReadFloat("Savedpositiony");
z = INI_ReadFloat("Savedpositionz");
a = INI_ReadFloat("Savedpositiona");
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][Skin], x, y, z, a, 0, 0, 0, 0, 0, 0);
SetPlayerInterior(playerid, 3);
SpawnPlayer(playerid);
INI_Close();
}
}
if(PlayerInfo[playerid][Pass] == inputtext)
if(!strcmp(PlayerInfo[playerid][Pass], inputtext))
if(!strlen(inputtext)) { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an invalid password.\n"WHITE"Type your password below to login.","Login","Quit"); return 1; }
if(strcmp(inputtext,PlayerInfo[playerid][Pass],false)) { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""WHITE"Login",""RED"You have entered an incorrect password.\n"WHITE"Type your password below to login.","Login","Quit"); return 1; }