24.06.2013, 05:11
Try it like this, I can't really test it but I'm pretty sure it should work.
pawn Код:
CMD:report(playerid, params[])
{
new id, text[128];
if(!isnull(params))
{
sscanf(params, "us[128]", id, text);
if(id != INVALID_PLAYER_ID)
{
Reported{playerid} = true;
format(ReportText[playerid], 128, "%s", params);
ReportPlayer[playerid] = INVALID_PLAYER_ID;
SCMEx(playerid, COLOR_CYAN, "You have sent a report: %s", params);
format(mstr, sizeof(mstr), "The player %s[ID:%d] has reported: %s.", GetNameEx(playerid), playerid, params);
AdminsMSG(COLOR_LIGHTRED, mstr);
}
else
{
if(!isnull(text))
{
Reported{playerid} = true;
format(ReportText[playerid], 128, "%s", params);
ReportPlayer[playerid] = id;
SCMEx(playerid, COLOR_CYAN, "You have reported %s[ID:%d]: %s", GetNameEx(id), id, params);
format(mstr, sizeof(mstr), "> %s[ID:%d] reported %s[ID:%d]: %s.", GetNameEx(playerid), playerid, GetNameEx(id), id, params);
AdminsMSG(COLOR_LIGHTRED, mstr);
}
else SyntaxMSG(playerid, "/report (Optional[playerid]) [report text]");
}
}
else SyntaxMSG(playerid, "/report (Optional[playerid]) [report text]");
return 1;
}