[MySQL]Reports command error
#1

Problem : It doesn't show the dialog nor the error.

Command:
pawn Код:
CMD:reports(playerid,params[])
{
    if(PlayerInfo[playerid][Admin] >= 1)
    {
        mysql_function_query(cHandle,"SELECT * FROM `reports` ORDER BY `RDate` DESC LIMIT 5", true, "DisplayReports", "d", "playerid");
    }
    else return NotAllowed(playerid);
    return 1;
}
DisplayReports
pawn Код:
public DisplayReports(playerid)
{
    new rows, fields;
    cache_get_data(rows, fields, cHandle);
    if(rows)
    {
        new string[1000], reason[50], reporter[MAX_PLAYER_NAME], reportedplayer[MAX_PLAYER_NAME];
        for(new i =0; i < rows; i++)
        {
            //new mHolder[128];
            cache_get_field_content(i, "Reporter", reporter);
            cache_get_field_content(i, "Name", reportedplayer);
            cache_get_field_content(i, "Reason", reason);
            format(string,sizeof(string),"%s\n%s reported by %s. Reason: %s",string,reportedplayer,reporter,reason);
            ShowPlayerDialog(playerid, DIALOG_REPORTS, DIALOG_STYLE_MSGBOX, "Today's Last 5 reports",string,"Okay","");
        }
    }
    else return SendClientMessage(playerid, -1, ""RED"[REPORTS] "WHITE"There are no reports to be shown.");
    return 1;
}
Reply


Messages In This Thread
[MySQL]Reports command error - by Affan - 26.06.2014, 14:43
Re: [MySQL]Reports command error - by Emmet_ - 28.06.2014, 04:06
Re: [MySQL]Reports command error - by Affan - 28.06.2014, 04:26

Forum Jump:


Users browsing this thread: 1 Guest(s)