16.08.2015, 14:18
I dont know if this is what you did mean but; The row ids displayed from your selection are normally indexed from 0 till the end of the list #.
So basically after showing the dialog (threaded queries) you can:
Please note that this is an example code, im not sure of what you are selecting or requesting. This is what i understood and coded in 3 mins. I hope this helped.
So basically after showing the dialog (threaded queries) you can:
Код:
// Display the clan dialog: mysql_format(mysql, szQuery, sizeof (szQuery), "SELECT * FROM `users` WHERE `Clan` = '%d'", PlayerInfo[playerid][pClan]); mysql_tquery(mysql, szQuery, "DisplayClanList", "ii", playerid, -1); // Under the dialog response case DIALOG_CLAN: { if (!response) return 1; mysql_format(mysql, szQuery, sizeof (szQuery), "SELECT * FROM `users` WHERE `Clan` = '%d'", PlayerInfo[playerid][pClan]); mysql_tquery(mysql, szQuery, "DisplayClanList", "ii", playerid, listitem); return 1; } public DisplayClanList(playerid, rowid) { // you are showing the list if (rowid == -1) { for ( new i, j = cache_get_row_count ( ); i != j; ++i ) { cache_get_field_content( i, "Username", szName ); format(string, 300, szName); format(Selected[Players][snume], MAX_PLAYER_NAME, szName); format(sName[playerid], MAX_PLAYER_NAME, Selected[Players][snume]); Players++; } ShowPlayerDialog(playerid, DIALOG_CLAN2, DIALOG_STYLE_LIST, "Clan Members:", szDialog, "Select", "Back" ); return 1; } new nick[21]; cache_get_field_content(rowid, "Username", nick); printf("You clicked username %s", nick); }