08.05.2011, 01:08
First I wanted to apologize for my bad English.
My problem is this, I have this code to select three values of the database and display it in a menu but do not display any values, the fields are spelled correctly and compiling not throw any error or warning. Thanks for your time and hope you can help me.
My problem is this, I have this code to select three values of the database and display it in a menu but do not display any values, the fields are spelled correctly and compiling not throw any error or warning. Thanks for your time and hope you can help me.
Код:
forward GetCuData(playerid, campo[]); public GetCuData(playerid, campo[]) { new tmp[128]; new row[60]; format(tmp, 128, "SELECT %s FROM cucus WHERE ID= %d LIMIT 1", campo, cuInfo[playerid][cuSQLID]); mysql_query(tmp); mysql_store_result(); mysql_fetch_row(row); new id; id = strval(row); mysql_free_result(); return id; } forward AsignCuInfo(playerid); public AsignCuInfo(playerid) { CuInfo[playerid][Sabor1]=GetCuData(playerid,"Sabor1"); CuInfo[playerid][Sabor2]=GetCuData(playerid,"Sabor2"); CuInfo[playerid][Sabor3]=GetCuData(playerid,"Sabor3"); } forward OnCuCrear(playerid); public OnCuCrear(playerid) { AsignCuInfo(playerid); new stringmenu[128]; format(stringmenu, sizeof(stringmenu), "%s \n %s \n %s",CuInfo[playerid][Sabor1],CuentaInfo[playerid][Sabor2],CuentaInfo[playerid][Sabor3]); ShowPlayerDialog(playerid, CU_MENU,DIALOG_STYLE_LIST, "Elige el cucurucho que quieres comer",stringmenu, "Seleccionar", "Salir"); }