31.05.2015, 15:59
Hello sa-mp.com,is possible to make a dialog_style_list with case = rows in mysql database?
So example i have an Fine System,and i make a dialog,but i can't show more than 1 fine.Can you help me,please ?
LoadPlayerFines();
So example i have an Fine System,and i make a dialog,but i can't show more than 1 fine.Can you help me,please ?
Код:
LoadPlayerFines(); format(finelist,sizeof(finelist),"Amenda #%d [{4747D1}$%d{FFFFFF}] pentru '%s'",FinesInfo[playerid][fId],FinesInfo[playerid][fPret],FinesInfo[playerid][fPentru]); ShowPlayerDialog(playerid, 432,DIALOG_STYLE_LIST,"Fines", finelistt, "Detalii", "Close");
Код:
if( IsPlayerConnected( playerid ) ) { new DataString[ 1536 ], Query[ 1536 ], sendername[256]; GetPlayerName(playerid, sendername, sizeof(sendername)); format( Query, sizeof( Query ), "SELECT * FROM `fines` WHERE `Inssuer` = '%s'", sendername); if(mysql_query( Query )) { mysql_store_result(); } else { mysql_free_result(); SendClientMessage( playerid, COLOR_WHITE, "MYSQL ERROR LAV, feel free to report this bug by SS'ing it and send it to a dev." ); printf("Could not call loadaccountvariables query %d %d",playerid,PlayerInfo[playerid][pDatabaseID]); Kick(playerid); } printf(" SQL: %s",Query); for(new fine;fine<MAX_FINES;fine++) { mysql_fetch_field( "ID", DataString ); FinesInfo[ playerid ][ fId ] = strval( DataString ); mysql_fetch_field( "Price", DataString ); FinesInfo[ playerid ][ fPrice ] = strval( DataString ); mysql_fetch_field( "For", DataString ); strmid(FinesInfo[ playerid ][ fFor ], DataString, 0, strlen(DataString), 255); } mysql_free_result(); }