Registration steps to dialog. (please help me)
#1

Hello dear samp members.

Here is registration steps.. I want to make them in dialogs I have already made them..

Here is the steps:
pawn Код:
if(RegistrationStep[playerid] > 0)
    {
        if(RegistrationStep[playerid] == 1)
        {
            if (strcmp("male", text, true) == 0)
            {
                PlayerInfo[playerid][pSex] = 1;
                SendClientMessageEx(playerid, COLOR_YELLOW2, "Alright, so you're a male.");
                SendClientMessageEx(playerid, COLOR_LIGHTRED, "What is your date of birth? (Use dd/mm/yyyy)");
                RegistrationStep[playerid] = 2;
                return 0;
            }
            else if (strcmp("female", text, true) == 0)
            {
                PlayerInfo[playerid][pSex] = 2;
                SendClientMessageEx(playerid, COLOR_YELLOW2, "Alright, so you're a female.");
                SendClientMessageEx(playerid, COLOR_LIGHTRED, "What is your date of birth? (Use dd/mm/yyyy)");
                RegistrationStep[playerid] = 2;
                return 0;
            }
            else
            {
                SendClientMessageEx(playerid, COLOR_LIGHTRED, "Are you a male or female? Type in your choice.");
            }
            return 0;
        }
        else if(RegistrationStep[playerid] == 2)
        {
           
            PlayerInfo[playerid][pOrigin] = 0;
            format(string, sizeof(string), "Ok, so you are %d year old.",PlayerInfo[playerid][pAge]);
            SendClientMessageEx(playerid, COLOR_YELLOW2, string);
            SendClientMessageEx(playerid, COLOR_LIGHTRED, "Thanks for filling in all the information, now you can proceed to the tutorial!");
            RegistrationStep[playerid] = 0;
            SetPlayerVirtualWorld(playerid, 0);
            ClearChatbox(playerid);
            ShowTutGUIBox(playerid);
            ShowTutGUIFrame(playerid, 1);
            TutStep[playerid] = 1;
        }
        return 0;
    }
Here is the dialogs:
pawn Код:
if(dialogid == REGISTRATION1)
    {
        if(response)
        {
            PlayerInfo[playerid][pSex] = 1;
            SendClientMessage(playerid,COLOR_GRAD3,"You are now a Male");
        }
        else
        {
            PlayerInfo[playerid][pSex] = 2;
            SendClientMessage(playerid,COLOR_GRAD3,"You are now a Female");
        }
        ShowPlayerDialog(playerid, REGISTRATION2,DIALOG_STYLE_INPUT,"Government(U.S. Registration) - Account Age Management","Please input your age, make sure you are 14 or older:","Ok","Back");
        SavePlayerData(playerid);
    }
    if(dialogid == REGISTRATION2)
    {
        if (response == 1)
        {
            if(IsNull(inputtext))
            {
                SendClientMessage(playerid, COLOR_WHITE, "[ERROR] Type a number in...");
                return 1;
            }
            if(strval(inputtext) <= 14)
            {
                SendClientMessage(playerid, COLOR_WHITE, "[ERROR] Over 14, please");
                return 1;
            }
            if(strval(inputtext) >= 40)
            {
                SendClientMessage(playerid, COLOR_WHITE, "[ERROR] Under 40, please");
                return 1;
            }
            PlayerInfo[playerid][pAge] = strval(inputtext);
            new string[256], dstring[124];
            format(string, sizeof(string), "Your age is now %d ",PlayerInfo[playerid][pAge]);
            SendClientMessage(playerid,COLOR_WHITE,string);
            SavePlayerData(playerid);
            format(dstring, sizeof(dstring), "United States of America\nEurope\nAsia\nAfrica\nRussia");
            ShowPlayerDialog(playerid,REGISTRATION3,DIALOG_STYLE_LIST,"Government(U.S. Registration) - Account Origin Management",dstring,"Select","Back");
        }
        return 0;
    }
    if (dialogid == REGISTRATION3)
    {
        if (response == 1)
        {
            switch (listitem)
            {
                case 0:
                {
                    PlayerInfo[playerid][pOrigin] = 1;
                    SendClientMessage(playerid,COLOR_GRAD3,"You are now from United States Of America");
                    SetPlayerInterior(playerid, 0);
                    SetPlayerPos(playerid, 1642.2334,-2240.4983,13.4952);
                    SetCameraBehindPlayer(playerid);
                    SetPlayerVirtualWorld(playerid, 0);
                    TogglePlayerControllable(playerid, 1);
                    SavePlayerData(playerid);
                }
                case 1:
                {
                    PlayerInfo[playerid][pOrigin] = 2;
                    SendClientMessage(playerid,COLOR_GRAD3,"You are now from Europe");
                    SetPlayerInterior(playerid, 0);
                    SetPlayerPos(playerid, 1642.2334,-2240.4983,13.4952);
                    SetCameraBehindPlayer(playerid);
                    SetPlayerVirtualWorld(playerid, 0);
                    TogglePlayerControllable(playerid, 1);
                    SavePlayerData(playerid);
                }
                case 2:
                {
                    PlayerInfo[playerid][pOrigin] = 3;
                    SendClientMessage(playerid,COLOR_GRAD3,"You are now from Asia");
                    SetPlayerInterior(playerid, 0);
                    SetPlayerPos(playerid, 1642.2334,-2240.4983,13.4952);
                    SetCameraBehindPlayer(playerid);
                    SetPlayerVirtualWorld(playerid, 0);
                    TogglePlayerControllable(playerid, 1);
                    SavePlayerData(playerid);
                }
                case 3:
                {
                    PlayerInfo[playerid][pOrigin] = 4;
                    SendClientMessage(playerid,COLOR_GRAD3,"You are now from Africa");
                    SetPlayerInterior(playerid, 0);
                    SetPlayerPos(playerid, 1642.2334,-2240.4983,13.4952);
                    SetCameraBehindPlayer(playerid);
                    SetPlayerVirtualWorld(playerid, 0);
                    TogglePlayerControllable(playerid, 1);
                    SavePlayerData(playerid);
                }
                case 4:
                {
                    PlayerInfo[playerid][pOrigin] = 5;
                    SendClientMessage(playerid,COLOR_GRAD3,"You are now from Russia");
                    SetPlayerInterior(playerid, 0);
                    SetPlayerPos(playerid, 1642.2334,-2240.4983,13.4952);
                    SetCameraBehindPlayer(playerid);
                    SetPlayerVirtualWorld(playerid, 0);
                    TogglePlayerControllable(playerid, 1);
                    SavePlayerData(playerid);
                }
            }
        }
        return 1;
    }
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)