02.11.2012, 06:53
Ok, let's say I did it this way
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.
Quote:
Код:
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; } |
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.