Dialog just turns off and dosent log me in?
#1

Hello,

I connect to my server, And i goto put my password in,
I put it in and press login, But the dialog just switches of,
And im stuck spectating, Although if i delete my file,
And register and THEN login it works fine?
If you want to see my login code then just ask
Reply
#2

show it
Reply
#3

pawn Код:
if (dialogid == DIALOG_TYPE_LOGIN)
{
  if (response) {
    new PlayerName[24];
    if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid, DIALOG_TYPE_LOGIN, DIALOG_STYLE_INPUT, "Account", "Error ~ Please enter a password \n\nWelcome to tRoleplay \nAs your account is registered please login to it \nYou will not be able to play this server until you login \n\nHint: To login enter the password used to register below and hit the button Login", "Login", "Cancel");
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"/tRoleplay/%s.ini",name);

    if(fexist(file)) {
      new password = dini_Int(file, "Password");
      if(udb_hash(inputtext) != password) {
        ShowPlayerDialog(playerid, DIALOG_TYPE_LOGIN, DIALOG_STYLE_INPUT, "Account", "Error ~ Incorrect password \n\nWelcome to tRoleplay \nAs your account is registered please login to it \nYou will not be able to play this server until you login \n\nHint: To login enter the password used to register below and hit the button Login", "Login", "Cancel");
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        printf("%s has failed to login", name);
      }
      else {
        TogglePlayerSpectating(playerid, 0);
        IsLogged[playerid] = 1;
        PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
        PlayerInfo[playerid][Finalize] = dini_Int(file, "Finalize");
        PlayerInfo[playerid][Gender] = dini_Int(file, "Gender");
        PlayerInfo[playerid][City] = dini_Int(file, "City");
        SendClientMessage(playerid, COLOR_GREEN, "You have successfully logged into your account");
      }
    }
  }
  if (!response) Kick(playerid);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)