24.06.2013, 04:59
pawn Код:
CMD:report(playerid, params[])
{
if(!sscanf(params, "Us[128]", params[0], params[1]))
{
if(!params[0])
{
Reported{playerid} = true;
format(ReportText[playerid], 128, "%s", params[1]);
ReportPlayer[playerid] = INVALID_PLAYER_ID;
SCMEx(playerid, COLOR_CYAN, "You have sent a report: %s", params[1]);
format(mstr, sizeof(mstr), "The player %s[ID:%d] has reported: %s.", GetNameEx(playerid), playerid, params[1]);
AdminsMSG(COLOR_LIGHTRED, mstr);
}
else if(params[0])
{
Reported{playerid} = true;
format(ReportText[playerid], 128, "%s", params[1]);
ReportPlayer[playerid] = id;
SCMEx(playerid, COLOR_CYAN, "You have reported %s[ID:%d]: %s", GetNameEx(id), params[0], params[1]);
format(mstr, sizeof(mstr), "> %s[ID:%d] reported %s[ID:%d]: %s.", GetNameEx(playerid), playerid, GetNameEx(params[0]), params[0], params[1]);
AdminsMSG(COLOR_LIGHTRED, mstr);
}
else return SyntaxMSG(playerid, "/report (Optional[playerid]) [report text]");
return 1;
}
https://sampforum.blast.hk/showthread.php?tid=120356
The part of optional specifiers.