PHP код:
forward MResultado(playerid);
public MResultado(playerid)
{
new rows, fields, MStatus[128], MNome[128], MScore[128], DialogBox[1200], MResultado[128];
cache_get_data(rows, fields, mysqlConnection);
if(rows)
{
for(new i = 0; i < rows; i++ )
{
cache_get_field_content(i, "Nome", MNome, mysqlConnection);
cache_get_field_content(i, "Score", MScore, mysqlConnection);
cache_get_field_content(i, "Status", MStatus, mysqlConnection);
format(MResultado, sizeof(MResultado), "Nome: %s -> Score: %d -> Status: %s\n", MNome, strval(MScore), (MStatus ? ("{00FF00}Online") : ("{FF0000}Offline")));
strcat(DialogBox, MResultado);
}
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Jogadores", DialogBox, "OK", "");
}
}