01.11.2012, 18:48
So this should be done in this way? :
OnPlayerCommandText:
OnDialogResponse:
Код:
new item[MAX_PLAYERS][99], SOMECOUNT;
Код:
if(!strcmp(cmdtext,"/cmd",true)) { item[playerid] = 0; mysql_query("SELECT item FROM table"); mysql_store_result(); while(mysql_retrieve_row()) { mysql_fetch_field_row(resultstr,"item"); result=strval(resultstr); format(str,sizeof(str),"id: %d\n",result); strcat(guistr,str); SOMECOUNT++; item[playerid][SOMECOUNT]=result; } mysql_free_result(); ShowPlayerDialog(playerid,666,DIALOG_STYLE_LIST,"items",guistr,"ok",""); return 1; }
Код:
if(dialogid == 666) { printf("clicked id: %d",item[playerid][listitem]); return 1; }