31.05.2015, 16:28
If it's fines per-players, then what I meant is this:
I'd suggest you though not to use that outdated plugin and use the one by BlueG, version R39-3 with threaded queries. It is MUCH faster!
pawn Код:
new FinesInfo[MAX_PLAYERS][MAX_FINES][e_FinesInfo /* REPLACE WITH THE NAME OF THE ENUM IS USED TO THE SCRIPT */];
pawn Код:
for(new fine, rows = mysql_num_rows(sql);fine<rows;fine++)
{
if (fine >= sizeof (FinesInfo)) break;
mysql_fetch_field( "ID", DataString );
FinesInfo[ playerid ][fine][ fId ] = strval( DataString );
mysql_fetch_field( "Price", DataString );
FinesInfo[ playerid ][fine][ fPrice ] = strval( DataString );
mysql_fetch_field( "For", DataString );
strmid(FinesInfo[ playerid ][fine][ fFor ], DataString, 0, strlen(DataString), 255);
}
pawn Код:
// NOTE: finelist should be long enough to store the whole text
for(new fine;fine<MAX_FINES;fine++)
{
if (!FinesInfo[ playerid ][fine][ fFor ]) break;
format(finelist,sizeof(finelist),"%sAmenda #%d [{4747D1}$%d{FFFFFF}] pentru '%s'",finelist,FinesInfo[playerid][fine][fId],FinesInfo[playerid][fine][fPrice],FinesInfo[playerid][fine][fFor]);
}
ShowPlayerDialog(playerid, 432,DIALOG_STYLE_LIST,"Fines", finelistt, "Detalii", "Close");