Server Don't load Stats, easy help!
#10

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!");
}
Reply


Messages In This Thread
Server Don't load Stats, easy help! - by ricardo178 - 19.03.2011, 13:00
Re: Server Don't load Stats, easy help! - by JaTochNietDan - 19.03.2011, 13:04
Re: Server Don't load Stats, easy help! - by ricardo178 - 19.03.2011, 13:09
Re: Server Don't load Stats, easy help! - by JaTochNietDan - 19.03.2011, 13:10
Re: Server Don't load Stats, easy help! - by ricardo178 - 19.03.2011, 13:12
Re: Server Don't load Stats, easy help! - by JaTochNietDan - 19.03.2011, 13:22
Re: Server Don't load Stats, easy help! - by ricardo178 - 19.03.2011, 13:33
Re: Server Don't load Stats, easy help! - by JaTochNietDan - 19.03.2011, 13:37
Re: Server Don't load Stats, easy help! - by ricardo178 - 19.03.2011, 13:43
Re: Server Don't load Stats, easy help! - by JaTochNietDan - 19.03.2011, 13:45

Forum Jump:


Users browsing this thread: 1 Guest(s)