CMD:report(playerid, params[])
{
new text[128], giveplayerid;
if(PlayerInfo[playerid][pAdmin] >= 2 && PlayerInfo[playerid][pAdmin] < 1338)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "You can't submit reports as an administrator.");
return 1;
}
if(JustReported[playerid] > 0)
{
SendClientMessageEx(playerid, COLOR_GREY, "Wait 25 seconds before sending another report!");
return 1;
}
if (sscanf(params, "rs", giveplayerid, text)) return SendClientMessage(playerid, COLOR_GRAD2, "Usage: /report [id] [reason]");
JustReported[playerid]=25;
SendReportToQue(playerid, text[128]);
SendClientMessageEx(playerid, COLOR_YELLOW, "Your report was sent to Administrators.");
return 1;
}
error 032: array index out of bounds (variable "text")
SendReportToQue(playerid, text[128]);
stock SendReportToQue(reportfrom, reportto, report[])
{
new bool:breakingloop = false, newid = INVALID_REPORT_ID;
for(new i=0;i<MAX_REPORTS;i++)
{
if(!breakingloop)
{
if(Reports[i][HasBeenUsed] == 0)
{
breakingloop = true;
newid = i;
}
}
}
if(newid != INVALID_REPORT_ID)
{
strmid(Reports[newid][Report], report, 0, strlen(report), 128);
Reports[newid][ReportFrom] = reportfrom;
Reports[newid][ReportTo] = reportto;
Reports[newid][HasBeenUsed] = 1;
Reports[newid][BeingUsed] = 1;
new string[128];
format(string, sizeof(string), "%s [%i] reported %s (RID: %i): %s", GetPlayerNameEx(reportfrom), reportfrom, GetPlayerNameEx(reportto), reportto, newid, (report));
ABroadCast(COLOR_REPORT,string,2);
}
else
{
ClearReports();
SendReportToQue(reportfrom, reportto, report);
}
if(PlayerInfo[reportfrom][pDonateRank] == 4)
{
new string[128];
format(string, sizeof(string), "~r~Priority Report: ~g~%d", newid);
foreach(Player, i)
{
if(PlayerInfo[i][pAdmin] >= 2)
{
GameTextForPlayer(i, string, 1500, 1);
}
}
}
}
if (sscanf(params, "rs[128]", giveplayerid, text)) return SendClientMessage(playerid, COLOR_GRAD2, "Usage: /report [id] [reason]");
// Specifier "s" needs the size and it becomes: "s[size_here]".
if( giveplayerid != INVALID_PLAYER_ID ) SendReportToQue(playerid, giveplayerid, text);
It should be:
pawn Code:
pawn Code:
|
error 035: argument type mismatch (argument 2)
SendReportToQue(playerid, text);
if( giveplayerid != INVALID_PLAYER_ID ) SendReportToQue(playerid, giveplayerid, text);
SendReportToQue(playerid, text); // Only 2 parameters...
stock SendReportToQue(reportfrom, reportto, report[]) // You have 3 parameters here
stock SendReportToQue(reportfrom, reportto, report[])
{
printf("SendReportToQue(%d, %d, \"%s\")", reportfrom, reportto, report);
// rest of the code
}
if (sscanf(params, "rs[128]", giveplayerid, text)) return SendClientMessage(playerid, COLOR_GRAD2, "Usage: /report [id] [reason]");
// Specifier "s" needs the size and it becomes: "s[size_here]".