SA-MP Forums Archive
How can I change that command to show - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How can I change that command to show (/showthread.php?tid=440367)



How can I change that command to show - yaron0600 - 29.05.2013

How can I change that command to show the report stuff , I mean what the man reported to show that into that dialog ?

Heres the dialog :

Код:
CMD:reports(playerid, params[])
{
 	if(PlayerInfo[playerid][pAdmin] >= 2)
	{
		new reportdialog[2048], itemid = 0;
		for(new i = 0; i < MAX_REPORTS; i++)
		{
			if(Reports[i][BeingUsed] == 1 && itemid < 40)
			{
				ListItemReportId[playerid][itemid] = i;
				itemid++;
				if(strlen((Reports[i][Report])) > 32)
				{
					new firstline[128], secondline[128];
					strmid(firstline, Reports[i][Report], 0, 88);
					strmid(secondline, Reports[i][Report], 88, 128);
					if(strlen(secondline) > 6)
					{
						format(reportdialog, sizeof(reportdialog), "%s%s(ID:%i) | Report: %s", reportdialog, GetPlayerNameEx(Reports[i][ReportFrom]), Reports[i][ReportFrom], i, firstline);
						format(reportdialog, sizeof(reportdialog), "%s%s", reportdialog, secondline);
						ListItemReportId[playerid][itemid] = i;
						itemid++;
					}
					else format(reportdialog, sizeof(reportdialog), "%s%s(ID:%i) | Report: %s", reportdialog, GetPlayerNameEx(Reports[i][ReportFrom]), Reports[i][ReportFrom], i, (Reports[i][Report]));
				}
				else format(reportdialog, sizeof(reportdialog), "%s%s(ID:%i) | Report: %s", reportdialog, GetPlayerNameEx(Reports[i][ReportFrom]), Reports[i][ReportFrom], i, (Reports[i][Report]));

				format(reportdialog, sizeof(reportdialog), "%s\n", reportdialog);
			}
		}
		CancelReport[playerid] = itemid;
		format(reportdialog, sizeof(reportdialog), "%s\n", reportdialog);
		format(reportdialog, sizeof(reportdialog), "%sCancel Reports", reportdialog);
		ShowPlayerDialog(playerid, REPORTSMENU, DIALOG_STYLE_LIST, "Reports", reportdialog, "Accept", "Trash");
	}
}
Код:
	if(dialogid == REPORTSMENU)
	{
	    if(response)
	    {
	        if(CancelReport[playerid] == listitem) return 1;
			new reportid = ListItemReportId[playerid][listitem];
	        if(Reports[reportid][BeingUsed] == 0)
			{
			    SendClientMessageEx(playerid, COLOR_GREY, "   That report ID is not being used!");
			    return 1;
			}
			if(!IsPlayerConnected(Reports[reportid][ReportFrom]))
			{
			    SendClientMessageEx(playerid, COLOR_GREY, "   The reporter has disconnected !");
			    Reports[reportid][ReportFrom] = INVALID_PLAYER_ID;
			    Reports[reportid][BeingUsed] = 0;
			    return 1;
			}
			format(string, sizeof(string), "AdmCmd: %s has accepted the report from %s (ID: %i RID: %i).", GetPlayerNameEx(playerid), GetPlayerNameEx(Reports[reportid][ReportFrom]), Reports[reportid][ReportFrom], reportid);
			ABroadCast(COLOR_ORANGE, string, 2);
			AddReportToken(playerid); // Report Tokens
			if(PlayerInfo[playerid][pAdmin] == 1)
			{
			    SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, "An admin has accepted your report and is reviewing it, you can /reply to send messages to the admin reviewing your report.");
			}
			else
			{
			    format(string, sizeof(string), "%s has accepted your report and is reviewing it, you can /reply to send messages to the admin reviewing your report.", GetPlayerNameEx(playerid));
			    SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string);
			}
			PlayerInfo[playerid][pAcceptReport]++;
			Reports[reportid][ReplyTimerr] = SetTimerEx("ReplyTimer", 30000, 0, "d", reportid);
			Reports[reportid][CheckingReport] = playerid;
			//Reports[reportid][ReportFrom] = INVALID_PLAYER_ID;
			Reports[reportid][BeingUsed] = 0;
			Reports[reportid][TimeToExpire] = 0;
			//strmid(Reports[reportid][Report], "None", 0, 4, 4);
	    }
	    else
	    {
	        if(CancelReport[playerid] == listitem) return 1;
	        new reportid = ListItemReportId[playerid][listitem];
	        if(Reports[reportid][BeingUsed] == 0)
			{
			    SendClientMessageEx(playerid, COLOR_GREY, "   That report ID is not being used!");
			    return 1;
			}
			if(!IsPlayerConnected(Reports[reportid][ReportFrom]))
			{
			    SendClientMessageEx(playerid, COLOR_GREY, "   The reporter has disconnected !");
			    Reports[reportid][ReportFrom] = INVALID_PLAYER_ID;
			    Reports[reportid][BeingUsed] = 0;
			    return 1;
			}
			format(string, sizeof(string), "AdmCmd: %s has trashed the report from %s (RID: %i).", GetPlayerNameEx(playerid), GetPlayerNameEx(Reports[reportid][ReportFrom]), reportid);
			ABroadCast(COLOR_ORANGE, string, 2);
			if(PlayerInfo[playerid][pAdmin] == 1)
			{
			    SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, "An admin has marked your report invalid. It will not be reviewed.");
			}
			else
			{
			    format(string, sizeof(string), "%s has marked your report invalid. It will not be reviewed.", GetPlayerNameEx(playerid));
			    SendClientMessageEx(Reports[reportid][ReportFrom], COLOR_WHITE, string);
			}
			PlayerInfo[playerid][pTrashReport]++;
			CancelReport[playerid] = 0;
			Reports[reportid][ReportFrom] = INVALID_PLAYER_ID;
			Reports[reportid][BeingUsed] = 0;
			Reports[reportid][TimeToExpire] = 0;
			new reportdialog[2048], itemid = 0;
		    for(new i = 0; i < MAX_REPORTS; i++)
			{
				if(Reports[i][BeingUsed] == 1 && itemid < 40)
				{
					ListItemReportId[playerid][itemid] = i;
					itemid++;
					if(strlen((Reports[i][Report])) > 92)
					{
						new firstline[128], secondline[128];
						strmid(firstline, Reports[i][Report], 0, 88);
						strmid(secondline, Reports[i][Report], 88, 128);
						format(reportdialog, sizeof(reportdialog), "%s%s(ID:%i) | Report: %s", reportdialog, GetPlayerNameEx(Reports[i][ReportFrom]), Reports[i][ReportFrom], i, firstline);
						format(reportdialog, sizeof(reportdialog), "%s%s", reportdialog, secondline);
						ListItemReportId[playerid][itemid] = i;
						itemid++;
					}
					else format(reportdialog, sizeof(reportdialog), "%s%s(ID:%i) | Report: %s", reportdialog, GetPlayerNameEx(Reports[i][ReportFrom]), Reports[i][ReportFrom], i, (Reports[i][Report]));

					format(reportdialog, sizeof(reportdialog), "%s\n", reportdialog);
				}
			}
			CancelReport[playerid] = itemid;
			format(reportdialog, sizeof(reportdialog), "%s\n", reportdialog);
			format(reportdialog, sizeof(reportdialog), "%sCancel Reports", reportdialog);
			//SendClientMessageEx(playerid, COLOR_GREEN, "___________________________________________________");
			ShowPlayerDialog(playerid, REPORTSMENU, DIALOG_STYLE_LIST, "Reports", reportdialog, "Accept", "Trash");
			//strmid(Reports[reportid][Report], "None", 0, 4, 4);
	    }
	}