19.03.2011, 13:45
Okay, so what you should do in this situation is just use an else statement on top of the if statement that checks if the passwords were the same or not, so that will then mean the information must not have matched, so the login must be wrong, for example:
pawn Код:
if(udb_hash(tmp) == strval(tmp2)) // The passwords matched...so now do the code in the brackets
{
SendClientMessage(playerid, 0xFFFFFFFF, "Login Failed!"); // The login was successful, why do you send them a message saying it failed?
GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); // Get the name and store it in a variable
printf("%s has failed to login", name); // Again, printing that he failed to login, when he didn't?
IsLogged[playerid] = 1; // Setting the IsLogged variable to 1
SetPlayerMoney(playerid, dini_Int(file, "Cash")); // Setting the players money to the value of Cash in the file
SetPlayerMoney(playerid, dini_Int(file, "Score")); // You're setting the money of the person to the value of score in the file, why? Shouldn't you be using SetPlayerScore?
PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel"); // Setting the variable to the value of AdminLevel in the file
SendClientMessage(playerid, 0xFFFFFFFF, "[System]: Account Logged into!"); // Telling the player that he logged in!
}
else // The passwords didn't match in the "if(udb_hash(tmp) == strval(tmp2))" statement!
{
SendClientMessage(playerid, 0xFFFFFFFF, "[System]: Passwords did not match!");
}

