So basiclly after registration show tutorial dialog.
#1

So bassicly I need to show dialog after registration only. So maybe could Someone help me out.

pawn Код:
ShowMainMenuDialog(playerid, frame)
{
    new titlestring[64];
    new string[256];

    switch(frame)
    {
        case 1:
        {
            new ip[32];
            GetPlayerIp(playerid, ip, 32);
            format(titlestring, sizeof(titlestring), "Login - %s", GetPlayerNameEx(playerid));
            format(string, sizeof(string), "Welcome to Natural Los Santos Roleplay, %s.\n\nThis Account Is Registred Please Fill In Your Password To Login In", GetPlayerNameEx(playerid),  ip);
            ShowPlayerDialog(playerid,MAINMENU,DIALOG_STYLE_INPUT,titlestring,string,"Login","Exit");
        }
        case 2:
        {
            new ip[32];
            GetPlayerIp(playerid, ip, 32);
            format(titlestring, sizeof(titlestring), "Register - %s", GetPlayerNameEx(playerid));
            format(string, sizeof(string), "Welcome to Natural Los Santos Roleplay, %s.\n\nYou Have Not Yet Registerd Please Do And Fill Out The Password.", GetPlayerNameEx(playerid),  ip);
            ShowPlayerDialog(playerid,MAINMENU2,DIALOG_STYLE_INPUT,titlestring,string,"Register","Exit");
        }
        case 3:
        {
            new ip[32];
            GetPlayerIp(playerid, ip, 32);
            format(titlestring, sizeof(titlestring), "Login - %s", GetPlayerNameEx(playerid));
            format(string, sizeof(string), "Invalid Password!\n\nWelcome to Natural Los Santos Roleplay, %s.\n\nThis Account Is Registred Please Fill In Your Password To Login In", GetPlayerNameEx(playerid),  ip);
            ShowPlayerDialog(playerid,MAINMENU,DIALOG_STYLE_INPUT,titlestring,string,"Login","Exit");
        }
    }
}
And how I could add this after register dialog!

ShowPlayerDialog(playerid,dregister1,DIALOG_STYLE_ INPUT,"Error","When is your Birthday? ( DD/MM/YYYY )","Enter","Cancel");
Reply
#2

1.
pawn Код:
ShowMainMenuDialog(playerid, frame)
{
    new titlestring[64];
    new string[256];

    switch(frame)
    {
        case 1, 3:
        {
            new ip[32];
            GetPlayerIp(playerid, ip, 32);
            format(titlestring, sizeof(titlestring), "Login - %s", GetPlayerNameEx(playerid));
            if(3 == frame) strcat((string[0] = EOS, string), "Invalid Password!\n\n");
            strcat(string, "Welcome to Natural Los Santos Roleplay, %s.\n\nThis Account Is Registred Please Fill In Your Password To Login In");
            format(string, sizeof(string), string, GetPlayerNameEx(playerid),  ip);
            ShowPlayerDialog(playerid,MAINMENU,DIALOG_STYLE_INPUT,titlestring,string,"Login","Exit");
        }
        case 2:
        {
            new ip[32];
            GetPlayerIp(playerid, ip, 32);
            format(titlestring, sizeof(titlestring), "Register - %s", GetPlayerNameEx(playerid));
            format(string, sizeof(string), "Welcome to Natural Los Santos Roleplay, %s.\n\nYou Have Not Yet Registerd Please Do And Fill Out The Password.", GetPlayerNameEx(playerid),  ip);
            ShowPlayerDialog(playerid,MAINMENU2,DIALOG_STYLE_INPUT,titlestring,string,"Register","Exit");
        }
    }
}
2. OnDialogResponse for dialog id equal MAINMENU2
Reply
#3

So basiclly I need to put it after:

pawn Код:
if(dialogid == MAINMENU2)
        {
            if(strlen(inputtext))
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                if(doesAccountExist(sendername))
                {
                    SendClientMessageEx(playerid, COLOR_YELLOW, "That username is already taken, please choose a different one.");
                    return 1;
                }
                new tmppass[64];
                strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
                Encrypt(tmppass);
                OnPlayerRegister(playerid,tmppass);
            }
        }
    }
Here or ... here -

pawn Код:
case 2:
        {
            new ip[32];
            GetPlayerIp(playerid, ip, 32);
            format(titlestring, sizeof(titlestring), "Register - %s", GetPlayerNameEx(playerid));
            format(string, sizeof(string), "Welcome to Natural Los Santos Roleplay, %s.\n\nYou Have Not Yet Registerd Please Do And Fill Out The Password.", GetPlayerNameEx(playerid),  ip);
            ShowPlayerDialog(playerid,MAINMENU2,DIALOG_STYLE_INPUT,titlestring,string,"Register","Exit");
        }
Reply
#4

Think. In switch you are displaying registration dialog, you shouldn't show other dialog in the same time. Wait for registration dialog response and show it there
Reply
#5

Ohh I got it Thanks
I got a problem after rigistration it's not showing dialog...

pawn Код:
if(dialogid == MAINMENU || dialogid == dregister1 || dialogid == MAINMENU2)
    {
        if(dialogid == MAINMENU)
        {
            if( response == 0 )
            {
                SendClientMessageEx(playerid, COLOR_RED, "SERVER: You have been kicked out automatically.");
                Kick(playerid);
            }
            else
            {
                if(strlen(inputtext))
                {
                    new tmppass[64];
                    strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
                    Encrypt(tmppass);
                    OnPlayerLogin(playerid,tmppass);
                }
                else
                {
                    new loginname[64];
                    GetPlayerName(playerid,loginname,sizeof(loginname));
                    ShowPlayerDialog(playerid,MAINMENU,DIALOG_STYLE_INPUT,"Login","Incorrect password. \n \nThat name is registered, you may now enter your password.","Login","Exit");
                    gPlayerLogTries[playerid] += 1;
                    if(gPlayerLogTries[playerid] == 2) { SendClientMessageEx(playerid, COLOR_RED, "SERVER: Wrong password, you have been kicked out automatically."); Kick(playerid); }
                }
            }
        }
        if(dialogid == dregister1)
        {
            if(strlen(inputtext))
            {
                new year, month,day;
                getdate(year, month, day);
                new DateInfo[3][20];
                splits(inputtext, DateInfo, '/');
                if(year - strval(DateInfo[2]) > 100 || strval(DateInfo[2]) < 1 || strval(DateInfo[2]) >= year)
                {
                    ShowPlayerDialog(playerid,dregister1,DIALOG_STYLE_INPUT,"Error","When is your Birthday? ( DD/MM/YYYY )","Enter","Cancel");
                    return 0;
                }
                new check = year - strval(DateInfo[2]);
                if(check == year)
                {
                    ShowPlayerDialog(playerid,dregister1,DIALOG_STYLE_INPUT,"Error","When is your Birthday? ( DD/MM/YYYY )","Enter","Cancel");
                    return 0;
                }
                if(strval(DateInfo[1]) > month)
                {
                    check -= 1;
                }
                else if(strval(DateInfo[1]) == month && strval(DateInfo[0]) > day)
                {
                    check -= 1;
                }
                PlayerInfo[playerid][pAge] =
                RegistrationStep[playerid] = 2;
            }
        }
        if(dialogid == MAINMENU2)
        {
            if(strlen(inputtext))
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                if(doesAccountExist(sendername))
                {
                    SendClientMessageEx(playerid, COLOR_YELLOW, "That username is already taken, please choose a different one.");
                    return 1;
                }
                new tmppass[64];
                strmid(tmppass, inputtext, 0, strlen(inputtext), 255);
                Encrypt(tmppass);
                OnPlayerRegister(playerid,tmppass);
            }
        }
    }
pawn Код:
switch(frame)
    {
        case 1:
        {
            new ip[32];
            GetPlayerIp(playerid, ip, 32);
            format(titlestring, sizeof(titlestring), "Login - %s", GetPlayerNameEx(playerid));
            format(string, sizeof(string), "Welcome to Natural Los Santos Roleplay, %s.\n\nThis Account Is Registred Please Fill In Your Password To Login In", GetPlayerNameEx(playerid),  ip);
            ShowPlayerDialog(playerid,MAINMENU,DIALOG_STYLE_INPUT,titlestring,string,"Login","Exit");
        }
        case 2:
        {
            new ip[32];
            GetPlayerIp(playerid, ip, 32);
            format(titlestring, sizeof(titlestring), "Register - %s", GetPlayerNameEx(playerid));
            format(string, sizeof(string), "Welcome to Natural Los Santos Roleplay, %s.\n\nYou Have Not Yet Registerd Please Do And Fill Out The Password.", GetPlayerNameEx(playerid),  ip);
            ShowPlayerDialog(playerid,MAINMENU2,DIALOG_STYLE_INPUT,titlestring,string,"Register","Exit");
        }
        case 3:
        {
            ShowPlayerDialog(playerid,dregister1,DIALOG_STYLE_INPUT,"Error","When is your Birthday? ( DD/MM/YYYY )","Enter","Cancel");
        }
        case 4:
        {
            new ip[32];
            GetPlayerIp(playerid, ip, 32);
            format(titlestring, sizeof(titlestring), "Login - %s", GetPlayerNameEx(playerid));
            format(string, sizeof(string), "Invalid Password!\n\nWelcome to Natural Los Santos Roleplay, %s.\n\nThis Account Is Registred Please Fill In Your Password To Login In", GetPlayerNameEx(playerid),  ip);
            ShowPlayerDialog(playerid,MAINMENU,DIALOG_STYLE_INPUT,titlestring,string,"Login","Exit");
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)