need help with this - 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: need help with this (
/showthread.php?tid=635987)
need help with this -
Stormfire - 17.06.2017
Code:
CMD:reports(playerid)
{
if (adlvl[playerid] < 1) return 0;
static info[150 * (MAX_REPORTS+1)];
info[0] = EOS;
for (new i; i < MAX_REPORTS; i++)
{
if (g_Report[i][E_REPORT_VALID])
{
if (g_ReportChecked[playerid][i])
format(info, sizeof (info), "%s("COLOR_GREEN"Read"COLOR_WHITE") %s reported against %s | %s\n", info, g_Report[i][E_REPORT_AGAINST_NAME], g_Report[i][E_REPORT_FROM_NAME], ReturnTimelapse(g_Report[i][E_REPORT_TIMESTAMP], gettime()));
else
format(info, sizeof (info), "%s("COLOR_ORANGE"Unread"COLOR_WHITE") %s reported against %s | %s\n", info, g_Report[i][E_REPORT_AGAINST_NAME], g_Report[i][E_REPORT_FROM_NAME], ReturnTimelapse(g_Report[i][E_REPORT_TIMESTAMP], gettime()));
}
}
if (!info[0])
return SendClientMessage(playerid, COLOR_RED, "Error: No reports found in log.");
Dialog_Show(playerid, DIALOG_REPORTS_LIST, DIALOG_STYLE_LIST, "Reports list", info, "Select", "Cancel");
return 1;
}
how to fix this
Code:
BvG.pwn(19254) : error 001: expected token: "-string end-", but found "-identifier-"
BvG.pwn(19254) : warning 217: loose indentation
BvG.pwn(19254) : error 001: expected token: "-string end-", but found "-identifier-"
BvG.pwn(19254) : warning 215: expression has no effect
BvG.pwn(19254) : error 001: expected token: ";", but found "-integer value-"
BvG.pwn(19254) : fatal error 107: too many error messages on one line
Code:
format(info, sizeof (info), "%s("COLOR_GREEN"Read"COLOR_WHITE") %s reported against %s | %s\n", info, g_Report[i][E_REPORT_AGAINST_NAME], g_Report[i][E_REPORT_FROM_NAME], ReturnTimelapse(g_Report[i][E_REPORT_TIMESTAMP], gettime()));
this line
Re: need help with this -
kalanerik99 - 18.06.2017
1: In your script press CTRL+A to select all and then press SHIFT+TAB multiple times. This will fix loose identation
2:
Code:
CMD:reports(playerid)
{
if (adlvl[playerid] < 1) return 0;
static info[150 * (MAX_REPORTS+1)];
info[0] = EOS;
for (new i; i < MAX_REPORTS; i++)
{
if (g_Report[i][E_REPORT_VALID])
{
if (g_ReportChecked[playerid][i])
{
format(info, sizeof (info), "%s("COLOR_GREEN"Read"COLOR_WHITE") %s reported against %s | %s\n", info, g_Report[i][E_REPORT_AGAINST_NAME], g_Report[i][E_REPORT_FROM_NAME], ReturnTimelapse(g_Report[i][E_REPORT_TIMESTAMP], gettime()));
}
else
{
format(info, sizeof (info), "%s("COLOR_ORANGE"Unread"COLOR_WHITE") %s reported against %s | %s\n", info, g_Report[i][E_REPORT_AGAINST_NAME], g_Report[i][E_REPORT_FROM_NAME], ReturnTimelapse(g_Report[i][E_REPORT_TIMESTAMP], gettime()));
}
}
}
if (!info[0])
return SendClientMessage(playerid, COLOR_RED, "Error: No reports found in log.");
Dialog_Show(playerid, DIALOG_REPORTS_LIST, DIALOG_STYLE_LIST, "Reports list", info, "Select", "Cancel");
return 1;
}