24.06.2013, 04:36
I'm trying to make a report cmd like this:
the player can do
/report [text] or /report [playerid] [report text]
I made this:
But it's kinda buggy .. can anyone help me or tell me what's wrong?
the player can do
/report [text] or /report [playerid] [report text]
I made this:
pawn Код:
CMD:report(playerid, params[])
{
new id, text[128];
if(!sscanf(params, "s[128]", text) && sscanf(params, "us[128]", id, text))
{
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(!sscanf(params, "us[128]", id, 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 return SyntaxMSG(playerid, "/report (Optional[playerid]) [report text]");
return 1;
}