01.11.2012, 17:38
Hi, I would like to do something like that after entering the command displays a list of the gui and prints all records in the table, and when you click a result of a specific action is performed.
OnPlayerCommandText:
OnDialogResponse:
This unfortunately does not work and I have no idea how it could have been done differently. Please help me.
OnPlayerCommandText:
Код:
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); item[playerid]++; } mysql_free_result(); ShowPlayerDialog(playerid,666,DIALOG_STYLE_LIST,"items",guistr,"ok",""); return 1; }
Код:
if(dialogid == 666) { if(listitem == item[playerid]) { printf("clicked id: %d",item[playerid]); } return 1; }