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
#2

Whats the problem , Seems like you dont have any problem in this..

All the codes are correctly set up...

just try to understand the concept of dialog
Reply
#3

So as you can see... It shows out the regstep 1 in text.. I want to make it in dialogs..

Basically my question is will it workifI just put UNDER REGSTEP 1 the ShowDialog code...
Reply
#4

Quote:
Originally Posted by Scrillex
Посмотреть сообщение
So as you can see... It shows out the regstep 1 in text.. I want to make it in dialogs..

Basically my question is will it workifI just put UNDER REGSTEP 1 the ShowDialog code...
You mean to say that you want to say that

"You are male" should be in dialogs?


EDIT: ohk got it what you mean...

just use this

pawn Код:
ShowPlayerDialog(playerid,REGISTRATION1,DIALOG_STYLE_MSGBOX,"Sex Selection","{FFFFFF}\nSelect your Gender.\nPress the buttons to select your gender..","Male","Female");
Reply
#5

yeah mate. soz just THINKING TODAY ISN'T my bright side (sorry for caps) dialogsare already made but idk how to put them under a registration step.
Reply
#6

Quote:
Originally Posted by Scrillex
Посмотреть сообщение
yeah mate. soz just THINKING TODAY ISN'T my bright side (sorry for caps) dialogsare already made but idk how to put them under a registration step.
Show us your onplayerconnect code...
Reply
#7

pawn Код:
public OnPlayerConnect(playerid)
{
    // Crash Fix - GhoulSlayeR
    InvalidNameCheck(playerid);

    new playerIP[16];
    GetPlayerIp(playerid, playerIP, sizeof(playerIP));
    if (CheckBan(playerIP) == 1)
    {
        SetPlayerName(playerid, "BannedPlayer");
        SendClientMessage(playerid, COLOR_WHITE, "Connection Error: You are banned from this server.");
        Kick(playerid);
        return 1;
    }
    if(IsPlayerNPC(playerid)) return 1;
    for(new i = 0; i < 3; i++)
    {
        StopaniFloats[playerid][i] = 0;
    }
    for(new i = 0; i < 6; i++)
    {
        EventFloats[playerid][i] = 0.0;
    }
    EventLastInt[playerid] = 0; EventLastVW[playerid] = 0;
    for(new i = 0; i < 6; i++)
    {
        HHcheckFloats[playerid][i] = 0;
    }
    SetPlayerColor(playerid,TEAM_HIT_COLOR);
    SendClientMessageEx( playerid, COLOR_WHITE, "SERVER: Welcome to [NEW][0.3x] Golden Power Roleplay[Refunding]." );
    SetTimerEx("SafeLogin", 1000, 0, "d", playerid);
    SyncPlayerTime(playerid);
    new string[128];
    format(string, sizeof(string), "%s Has Now Joined Golden Power Roleplay.", GetPlayerNameEx(playerid));
    foreach(Player, i) {
        if(PlayerInfo[i][pHelper] >= 2 || PlayerInfo[i][pAdmin] >= 1) {
            if(!togJoin[i]) {
                SendClientMessage(i, TEAM_AZTECAS_COLOR, string);
            }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)