26.06.2014, 14:43
Problem : It doesn't show the dialog nor the error.
Command:
DisplayReports
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;
}
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;
}