SA-MP Forums Archive
Dialog problem - 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: Dialog problem (/showthread.php?tid=360776)



Dialog problem - 2KY - 18.07.2012

I'm using Y_INI, and creating a dialog-based login, but the file doesn't even get created. Can anyone see anything wrong with the following code?

pawn Код:
case DIALOG_REGISTER: // Pretty self explainatory.
        {
            if( isnull( inputtext ) )
            {
                SHOWDIALOG_REGISTER;
            }
           
            else
            {
                new
                        INI: theirFile = INI_Open( FindPlayerFile( playerid ) );

                INI_SetTag( theirFile, "data" );

                INI_WriteInt( theirFile,        "Passcode",     udb_hash( inputtext ) );
                INI_WriteInt( theirFile,        "Level",        1 );
                INI_WriteInt( theirFile,        "XP",           1 );

                INI_Close( theirFile );

                SendClientMessage( playerid, -1, "1" );

                SetSpawnInfo( playerid, 255,
                    plStats [ playerid ] [ Skin ],
                    plStats [ playerid ] [ LastPosition ] [ 0 ],
                    plStats [ playerid ] [ LastPosition ] [ 1 ],
                    plStats [ playerid ] [ LastPosition ] [ 2 ],
                    plStats [ playerid ] [ LastPosition ] [ 3 ],
                    0,0, 0,0, 0,0
                );

                SpawnPlayer( playerid );

                SendClientMessage( playerid, -1, "2" );
            }
        }
Yes, the dialog is shown, but once you enter your password, nothing happens, nor do the Client Messages get sent.


Re: Dialog problem - XStormiest - 18.07.2012

don't use isnull(inputtext[0]) because isnull use a new format , he don't check if the player don't writed in the dialog it check if using the entire format..


use this
pawn Код:
if(strlen(inputtext[0])
    {
             SHOWDIALOG_REGISTER;
    }
hmmm show me your FindPlayerFile(playerid) function and CASE_LOGIN
fine , try follow this but don't only what you need it maybe will be usefull for you

https://sampforum.blast.hk/showthread.php?tid=352703