Mysql + PVar
#6

Could you try to identify which line is causing the issue? To do this, add prints between your current code lines, and after the crash happens, check which print is the last shown in the server_log.txt file.
Try using this code, with the print lines already added:

pawn Код:
if( dialogid == 1 )
    {
        print("debug a");
        if( response )
        {
            print("debug b");
            new
                query[ 128 ],
                str[ 50 ];
               
            print("debug c");              
            format( query, sizeof( query ), "SELECT `Slaptazodis`, `Patirtis`, `Admin` FROM `zaidejai` WHERE `id` = %d", GetPVarInt( playerid, "sqlidas" ) );
            print("debug d");
            mysql_query( query );
            print("debug e");
            mysql_store_result();
            print("debug f");
            mysql_fetch_row( query );
           
            print("debug g");
            mysql_fetch_field_row( str, "Slaptazodis" );
           
            print("debug h");
            if ( !strcmp(str, inputtext, true) )
            {
                print("debug i");
                mysql_fetch_field_row( str, "Patirtis" );
                print("debug J");
                new
                    exp = strval( str );

                print("debug k");
                mysql_fetch_field_row( str, "Admin" );
                print("debug L");
                SetPVarInt( playerid, "Adminas", strval( str ) );
                print("debug m");

                print("debug m");
                if(exp == -1) SetPVarInt( playerid, "Authstate", 1 ); else
                SetPVarInt( playerid, "Authstate", 2 );
                print("debug o");
               
                mysql_free_result();
                print("debug p");
                return 1;
            }
            print("debug q");
            ShowPlayerDialog( playerid, 1, DIALOG_STYLE_INPUT, "Serverio prisijungimas.", "Prasome prisijungti", "Prisijungti", "Atsaukti");
            print("debug r");
            return 1;
        }

        print("debug s");
        if( !response )
        {
            print("debug t");
            ShowPlayerDialog( playerid, 0, DIALOG_STYLE_MSGBOX, "Tikimes sulaukti jusu sugryztant" );
            print("debug u");
            Kick( playerid );
            print("debug v");
    }
Make sure to backup your current code, so you can revert to it easily afterwards.
Thank you.
Reply


Messages In This Thread
Mysql + PVar - by Axuj - 03.12.2010, 18:48
Re: Mysql + PVar - by Zamaroht - 03.12.2010, 18:50
Re: Mysql + PVar - by Axuj - 03.12.2010, 18:54
Re: Mysql + PVar - by ReVo_ - 03.12.2010, 18:55
Re: Mysql + PVar - by Axuj - 03.12.2010, 18:57
Re: Mysql + PVar - by Zamaroht - 03.12.2010, 19:25
Re: Mysql + PVar - by Axuj - 03.12.2010, 19:31
Re: Mysql + PVar - by Zamaroht - 03.12.2010, 19:41
Re: Mysql + PVar - by Axuj - 03.12.2010, 19:42

Forum Jump:


Users browsing this thread: 1 Guest(s)