display all records from a database table in gui
#10

Ok, let's say I did it this way

Quote:
Originally Posted by Lolcio12
Посмотреть сообщение
Код:
new item[MAX_PLAYERS][99], SOMECOUNT;
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);
			
                        SOMECOUNT++;
			item[playerid][SOMECOUNT]=result;
		}
		mysql_free_result();
		ShowPlayerDialog(playerid,666,DIALOG_STYLE_LIST,"items",guistr,"ok","");
		return 1;
	}
OnDialogResponse:
Код:
	if(dialogid == 666)
	{
		printf("clicked id: %d",item[playerid][listitem]);
		return 1;
	}
How do I make an array Item does not have a limit (99),
In the tables for players, or vehicles can be used MAX_PLAYERS, MAX_VEHICLES, and what to do in this case?
My system will allow for dynamic addition, the limit would be records in a table from the database.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)