SA-MP Forums Archive
Need help with registration dialogs..(Remaking) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need help with registration dialogs..(Remaking) (/showthread.php?tid=423513)



Need help with registration dialogs..(Remaking) ONPLAYERTEXT! - Scrillex - 18.03.2013

So basiclly the problem is on player text... It isnt showing dialogs after register and not switching camera it just spawns player in 0.0.0.0 localation.

so basicly here goes the code:
This is orginal: (everything worked fine after tutorial playerwas spawned
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_GREEN, "Are you a male or female? Type in your choice.");
            }
            return 0;
        }
        else if(RegistrationStep[playerid] == 2)
        {
            new year, month,day;
            getdate(year, month, day);
            new DateInfo[3][20];
            splits(text, DateInfo, '/');
            if(year - strval(DateInfo[2]) > 100 || strval(DateInfo[2]) < 1 || strval(DateInfo[2]) >= year)
            {
                SendClientMessageEx(playerid, COLOR_LIGHTRED, "What is your date of birth? (Use dd/mm/yyyy)");
                return 0;
            }
            new check = year - strval(DateInfo[2]);
            if(check == year)
            {
                SendClientMessageEx(playerid, COLOR_GREEN, "What is your date of birth? (Use dd/mm/yyyy)");
                return 0;
            }
            if(strval(DateInfo[1]) > month)
            {
                check -= 1;
            }
            else if(strval(DateInfo[1]) == month && strval(DateInfo[0]) > day)
            {
                check -= 1;
            }
            PlayerInfo[playerid][pAge] = check;
            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, Welcome to Galaxy Roleplay.!");
            //SendClientMessageEx(playerid, TEAM_CYAN, "We Hope Your Enjoy Your Stay Make Sure To Check Out Are Fourms");
            RegistrationStep[playerid] = 0;
            SetPlayerVirtualWorld(playerid, 0);
            ClearChatbox(playerid);
            SendClientMessageEx(playerid, COLOR_YELLOW, "Type /newplayer if you are new to roleplay/would like to be shown around.");
            SendClientMessageEx(playerid, COLOR_YELLOW, "Type /start to start playing!");
            ShowTutGUIBox(playerid);
            ShowTutGUIFrame(playerid, 1);
            TutStep[playerid] = 1;
        }
Took off tutorial but spawn point f...ed up..
pawn Код:
#define dregister1 13000

if(RegistrationStep[playerid] > 0)
    {
        if(RegistrationStep[playerid] == 1)
        {
            ShowPlayerDialog(playerid,dregister1,DIALOG_STYLE_INPUT,"Error","When is your Birthday? ( DD/MM/YYYY )","Enter","Cancel");
            RegistrationStep[playerid] = 2;
            return 0;
        }
        else if(RegistrationStep[playerid] == 2)
        {
            new year, month,day;
            getdate(year, month, day);
            new DateInfo[3][20];
            splits(text, DateInfo, '/');
            if(year - strval(DateInfo[2]) > 100 || strval(DateInfo[2]) < 1 || strval(DateInfo[2]) >= year)
            {
                SendClientMessageEx(playerid, COLOR_LIGHTRED, "What is your date of birth? (Use dd/mm/yyyy)");
                return 0;
            }
            new check = year - strval(DateInfo[2]);
            if(check == year)
            {
                SendClientMessageEx(playerid, COLOR_GREEN, "What is your date of birth? (Use dd/mm/yyyy)");
                return 0;
            }
            if(strval(DateInfo[1]) > month)
            {
                check -= 1;
            }
            else if(strval(DateInfo[1]) == month && strval(DateInfo[0]) > day)
            {
                check -= 1;
            }
            PlayerInfo[playerid][pAge] = check;
            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, Welcome to Free Roleplay.!");
            //SendClientMessageEx(playerid, TEAM_CYAN, "We Hope Your Enjoy Your Stay Make Sure To Check Out Are Fourms");
            RegistrationStep[playerid] = 0;
            SetPlayerVirtualWorld(playerid, 0);
            ClearChatbox(playerid);
            TutStep[playerid] = 1;
        }
        return 0;
    }
I'm editing it for my self so don't rage at me.


Re: Need help with registration dialogs..(Remaking) - Glad2BeHere - 18.03.2013

pawn Код:
//did u setthe playerrestrationstep 2 1 :?
 if(RegistrationStep[playerid] == 1)
        {
            ShowPlayerDialog(playerid,dregister1,DIALOG_STYLE_INPUT,"Error","When is your Birthday? ( DD/MM/YYYY )","Enter","Cancel");
            RegistrationStep[playerid] = 2;
            return 1;
        }
pawn Код:
else if(RegistrationStep[playerid] == 2)
        {
            new year, month,day;
            getdate(year, month, day);
            new DateInfo[3][20];
            splits(text, DateInfo, '/');
            if(year - strval(DateInfo[2]) > 100 || strval(DateInfo[2]) < 1 || strval(DateInfo[2]) >= year)
            {
                SendClientMessageEx(playerid, COLOR_LIGHTRED, "What is your date of birth? (Use dd/mm/yyyy)");
                return 0;
            }
            new check = year - strval(DateInfo[2]);
            if(check == year)
            {
                SendClientMessageEx(playerid, COLOR_GREEN, "What is your date of birth? (Use dd/mm/yyyy)");
                return 0;
            }
            if(strval(DateInfo[1]) > month)
            {
                check -= 1;
            }
            else if(strval(DateInfo[1]) == month && strval(DateInfo[0]) > day)
            {
                check -= 1;
            }
            PlayerInfo[playerid][pAge] = check;
            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, Welcome to Galaxy Roleplay.!");
            //SendClientMessageEx(playerid, TEAM_CYAN, "We Hope Your Enjoy Your Stay Make Sure To Check Out Are Fourms");
            RegistrationStep[playerid] = 0;
            SetPlayerVirtualWorld(playerid, 0);
            ClearChatbox(playerid);
            TutStep[playerid] = 1;
        }
        return 1;



Re: Need help with registration dialogs..(Remaking) - Scrillex - 18.03.2013

As you can see I set it to 2 So next step.. And even in dialog I did that!
The problem is when register dialog shows up and I put my pw next view for the player was birthday. So basiclly it isn't working at all only registration. Spawns it at 0.0.0.00 localation. . So basiclly I need help on this.. I tryed multiple variants but nothing good camed out!
Full

pawn Код:
if(RegistrationStep[playerid] > 0)
    {
        if(RegistrationStep[playerid] == 1)
        {
            ShowPlayerDialog(playerid,dregister1,DIALOG_STYLE_INPUT,"Error","When is your Birthday? ( DD/MM/YYYY )","Enter","Cancel");
            RegistrationStep[playerid] = 2;
            return 0;
        }
        else if(RegistrationStep[playerid] == 2)
        {
            new year, month,day;
            getdate(year, month, day);
            new DateInfo[3][20];
            splits(text, DateInfo, '/');
            if(year - strval(DateInfo[2]) > 100 || strval(DateInfo[2]) < 1 || strval(DateInfo[2]) >= year)
            {
                SendClientMessageEx(playerid, COLOR_LIGHTRED, "What is your date of birth? (Use dd/mm/yyyy)");
                return 0;
            }
            new check = year - strval(DateInfo[2]);
            if(check == year)
            {
                SendClientMessageEx(playerid, COLOR_GREEN, "What is your date of birth? (Use dd/mm/yyyy)");
                return 0;
            }
            if(strval(DateInfo[1]) > month)
            {
                check -= 1;
            }
            else if(strval(DateInfo[1]) == month && strval(DateInfo[0]) > day)
            {
                check -= 1;
            }
            PlayerInfo[playerid][pAge] = check;
            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, Welcome to Free Roleplay.!");
            RegistrationStep[playerid] = 0;
            SetPlayerVirtualWorld(playerid, 0);
            ClearChatbox(playerid);
            TutStep[playerid] = 1;
            SpawnPlayer(playerid);
        }
        return 0;
    }
UnderDialog
pawn Код:
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;
        }
    }



Re: Need help with registration dialogs..(Remaking) - Scrillex - 18.03.2013

Sorry for bump But this is really needed! I'm sitting here like on to hot coils!