26.04.2011, 10:52
Hi there.
I've got some problem with getting number from a list GUI.
I'll show you parts of script.
ShowPlayerDialog:
OnDialogResponse:
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?
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" );
pawn Код:
if( dialogid == DIALOG_NUMBER )
{
if(response)
{
new
kid = strval( inputtext )
;
printf( "KID: %d ", kid );
}
}
I don't know why, because in other dialogs like this it works fine...
Could somebody help?