Dialogs / question improved
#2

not sure about the limit, as for dialog in /reports use strcat
pawn Код:
#define DIALOG_UNUSED 1

CMD:reports(playerid, params[])
{
    if(pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid,-1,""COL_RED"Not Admin!");
    mysql_tquery(mysql, "SELECT * FROM `reportlog`", "ShowReports", "d", playerid);
    return 1;
}

forward ShowReports(playerid);
public ShowReports(playerid)
{
    new rows, fields, handlingarray[500];
    cache_get_data(rows, fields, handle);
    if(rows != 0)
    {
        strcat(handlingarray, "Username\t\tTargetname\t\tReason\t\tDate");
        for(new i = 0; i < rows; i++)
        {
            new reporter[MAX_PLAYER_NAME], reported[MAX_PLAYER_NAME], reportid, reportedon[25], reportreason[25], showreps[200];
            reportid = cache_get_field_content_int(i, "ID");
            cache_get_field_content(i, "Username", reporter);
            cache_get_field_content(i, "Targetname", reported);
            cache_get_field_content(i, "Data", reportedon);
            cache_get_field_content(i, "Report", reportreason);
            format(showreps, sizeof(showreps), "%s\t\t%s\t\t%s\t\t%s", reporter, reported, reportreason, reportdon);
            strcat(handlingarray, showreps);
        }
        ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_TABLIST_HEADERS, "Reports", handlingarray, "OK", "");
    }
    else if(rows == 0)
    {
        SendClientMessage(playerid, RED, "There are currently no reports!");
    }
    return 1;
}
Reply


Messages In This Thread
Dialogs / question improved - by Zeus666 - 21.10.2018, 16:48
Re: Dialogs - by ReD_HunTeR - 21.10.2018, 17:02
Re: Dialogs / question improved - by Zeus666 - 21.10.2018, 17:13
Re: Dialogs / question improved - by ReD_HunTeR - 21.10.2018, 17:42
Re: Dialogs / question improved - by Zeus666 - 21.10.2018, 17:49
Re: Dialogs / question improved - by ReD_HunTeR - 21.10.2018, 18:26
Re: Dialogs / question improved - by Chyakka - 21.10.2018, 18:34
Re: Dialogs / question improved - by Zeus666 - 21.10.2018, 19:03
Re: Dialogs / question improved - by Chyakka - 21.10.2018, 20:53
Re: Dialogs / question improved - by Zeus666 - 21.10.2018, 21:03

Forum Jump:


Users browsing this thread: 1 Guest(s)