Register and then a question?
#1

Hello everyone!



UPDATE EXPLAINATION:
I have a gamemode made by me from scratch. I am a newbie scripter and wants to learn new things. But currently my project has been stuck at the register system. I have a working register system and saving system, but now I want to make more dialogs like register steps to get more information about the player as it is a roleplay server it will end up with. So basically I want the script to first ask for password, and it will be saved in the file, already fixed. But then I want to add another dialog as step two for example and then it will ask for age, and you may write in the age in a dialog (similar to the password dialog, just with age). I have no clue how to proceed by the dialogs, that is why I am asking. I have nearly tried everything but I just ends up with a loads of errors and warnings. I want three steps first one is password, next step is age and the third step is origin. Everything is gonna be saved (I know how to make them save), but I do not know how to make the dialogs going after eachother upon the registering. Like a "Next" button to next dialog. If you still don't know what I mean, please private message me and tell me what you didn't understand clearly.

My register system currently:
Quote:

public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_GREY"Welcome to Complete Gaming Role Play",""COLOR_GREY"SERVER: You have 60 seconds to login \n NOTICE: We are currently under beta testing \n so if you find any bugs, let us know \n\n Enter Your Password:","Login","Cancel");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COLOR_GREY"Welcome to Complete Gaming Role Play",""COLOR_GREY"Type your password below to register a new account. \n HINT: Do not give out your password to anyone else","Register","Cancel");
}
return 1;
}

Where shall I place the other dialog so it will pop up after you've written in your password? That is my question.

Also looking for a working /ame command in zcmd. Tried a bunch of released or posted /ame on the sa-mp forum, used the search funcation but no one of they worked properly, even if I tired to fix them.
Reply
#2

Bump.
Reply
#3

OnDialogResponse...

if(dialogid == DIALOG_REGISTER)
SendClientMessage(playerid, -1, "Registered!");

ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, "origin", "enter origin", "Enter", "");
Reply
#4

Quote:
Originally Posted by -Prodigy-
Посмотреть сообщение
OnDialogResponse...

if(dialogid == DIALOG_REGISTER)
SendClientMessage(playerid, -1, "Registered!");

ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_INPUT, "origin", "enter origin", "Enter", "");
Not working.


My dialog response:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case DIALOG_REGISTER:
        {
            if (!response) return Kick(playerid);
            if(response)
            {
                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COLOR_GREY"Welcome to Complete Gaming Role Play",""COLOR_GREY"You have entered an invalid password.\n"COLOR_GREY"Type your password below to register a new account.","Register","Cancel");
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Password",udb_hash(inputtext));
                INI_WriteInt(File,"Cash",5000);
                INI_WriteInt(File,"Banned",0);
                PlayerInfo[playerid][pBanned] = 0;
                INI_WriteInt(File,"Admin",0);
                PlayerInfo[playerid][pAdmin] = 0;
                INI_WriteInt(File,"Kills",0);
                PlayerInfo[playerid][pKills] = 0;
                INI_WriteInt(File,"Deaths",0);
                PlayerInfo[playerid][pDeaths] = 0;
                INI_WriteInt(File,"Model",264);
                PlayerInfo[playerid][pModel] = 264;
                INI_WriteInt(File,"Level",1);
                PlayerInfo[playerid][pLevel] = 1;
                INI_Close(File);

                SetPlayerScore(playerid, 1);
                GivePlayerMoney(playerid, 5000);
                SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pModel], 1686.1014, -2332.1179, -2.6797, 355.4632, 0, 0, 0, 0, 0, 0);
                SpawnPlayer(playerid);
                        }
        }

        case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
                    SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pModel], 1686.1014, -2332.1179, -2.6797, 355.4632, 0, 0, 0, 0, 0, 0);
                    SpawnPlayer(playerid);
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COLOR_GREY"Login",""COLOR_GREY"Password does not match.\n\n"COLOR_GREY"SERVER: You have 60 seconds to login\n NOTICE: We are still under beta testing\n\n Enter Your Password:","Login","Cancel");
                }
                return 1;
            }
        }
    }
    return 1;
}

    [B][COLOR="red"](LINE407)[/COLOR][/B] if(DIALOG_ORIGIN == DIALOG_REGISTER)
        {  
            ShowPlayerDialog(playerid, DIALOG_ORIGIN, DIALOG_STYLE_INPUT,""COLOR_GREY"Login",""COLOR_GREY"Password does not match.\n\n"COLOR_GREY"SERVER: You have 60 seconds to login\n NOTICE: We are still under beta testing\n\n    Enter Your Password:","Login","Cancel");
[B][COLOR="Red"](LINE410)[/COLOR][/B]       return 1;
        }
Errors:
pawn Код:
(407) : error 010: invalid function or declaration
(410) : error 010: invalid function or declaration
Reply
#5

Bump as I got no answers plus I edited the explaination. Still wondering how to do this and I will give the person who helps me a reptuation + as a "payback".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)