cache_num_row
#9

if it is storing data in ur database, then this should work
pawn Код:
CMD:reports(playerid, params[])
{
    if(pInfo[playerid][pAdminLevel] < 1) return SendClientMessage(playerid,-1,""COL_RED"Not Admin!");
    new Cache:reports = mysql_query(mysql, "SELECT * FROM `reportlog`", true);
    new rows = cache_num_rows(mysql), count = 0;
    SendClientMessage(playerid, -1, "Reports:");
    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), "[#%d] (%s) %s has reported %s! [Reason: %s]", reportid, reportedon, reporter, reported, reportreason);
        SendClientMessage(playerid, RED, showreps);
        count++;
    }
    if(count == 0)
    {
        SendClientMessage(playerid, RED, "There are currently no reports!");
    }
    cache_delete(reports);
    return 1;
}
otherwise, there might be errors in ur logs
Reply


Messages In This Thread
cache_num_row - by Zeus666 - 21.10.2018, 14:13
Re: cache_num_row - by Chyakka - 21.10.2018, 14:21
Re: cache_num_row - by Zeus666 - 21.10.2018, 14:26
Re: cache_num_row - by Chyakka - 21.10.2018, 14:29
Re: cache_num_row - by Zeus666 - 21.10.2018, 14:30
Re: cache_num_row - by ReD_HunTeR - 21.10.2018, 14:37
Re: cache_num_row - by Zeus666 - 21.10.2018, 15:11
Re: cache_num_row - by Zeus666 - 21.10.2018, 15:31
Re: cache_num_row - by ReD_HunTeR - 21.10.2018, 15:33
Re: cache_num_row - by Zeus666 - 21.10.2018, 15:39

Forum Jump:


Users browsing this thread: 1 Guest(s)