SA-MP Forums Archive
Getting number from a list GUI - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Getting number from a list GUI (/showthread.php?tid=251264)



Getting number from a list GUI - Feverlander - 26.04.2011

Hi there.
I've got some problem with getting number from a list GUI.
I'll show you parts of script.
ShowPlayerDialog:
pawn Код:
mysql_query( "SELECT `uid`, `text` FROM `CrazyThings`" );
mysql_store_result( );
new    
    big_str[ 1024 ], res[ 200 ],
    id, text[ 128 ]
;
while( mysql_fetch_row ( res ) )
{
    sscanf( res, "p<|>i", id );
    sscanf( res, "p<|>is[128]", id, text );
    format( big_str, sizeof( big_str ), "%s%d.\t%s\n", big_str, id, text );
}
mysql_free_result( );
ShowPlayerDialog(playerid, DIALOG_NUMBER, DIALOG_STYLE_LIST, "Some crazy shit",
big_str, "Read", "Close" );
OnDialogResponse:
pawn Код:
if( dialogid == DIALOG_NUMBER )
{
    if(response)
    {
        new
            kid = strval( inputtext )
        ;
        printf( "KID: %d ", kid );
    }
}
Always prints 'KID: 0' and drives me mad...
I don't know why, because in other dialogs like this it works fine...
Could somebody help?


Re: Getting number from a list GUI - Feverlander - 26.04.2011

Refresh...
Anyone?