Jump to content
  • 0

[GF/RP] Problema register dialog


gabbii

Question

am o problema la register dialog, imi apare dialogu cu register scriu orice parola acolo dar nu imi inregistreaza contu... ce pot face?

uitati linile

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new sendername[MAX_PLAYER_NAME];
    if(dialogid == 12346 || dialogid == 12347)
    {
       if(response)
       {
          if(strlen(inputtext))
          {
             new tmppass[64];
             strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
             OnPlayerLogin(playerid,tmppass);
          }
          else
          {
             new loginstring[500];
             new loginname[64];
             GetPlayerName(playerid,loginname,sizeof(loginname));
             format(loginstring,sizeof(loginstring),"{FF0000}WRONG PASSWORD\nPlease enter the correct password",loginname);
             ShowPlayerDialog(playerid,12347,DIALOG_STYLE_PASSWORD,"Login",loginstring,"Login","Exit");
          }
       }
    }

    if(dialogid == 12345)
    {
       if(response)
       {
          if(strlen(inputtext))
          {
             new string[128];
             GetPlayerName(playerid, sendername, sizeof(sendername));
             format(string, sizeof(string), "Users/%s.ini", sendername);
             new File: hFile = fopen(string, io_read);
             if (hFile)
             {
                SendClientMessage(playerid, COLOR_YELLOW, "That Username is already taken, please choose a different one.");
                fclose(hFile);
                return 1;
             }
             else
             {
                new regstring[1000];
                new regname[64];
                GetPlayerName(playerid,regname,sizeof(regname));
                format(regstring,sizeof(regstring),"Welcome, %s\nNot registered on this server with this name\nEnter a password to register an account with this name",regname);
                ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Register",regstring,"Register","Exit");
             }
          }
       }
    }
    return 0;
}

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.