29.04.2011, 12:33
sscanf will return 1(or -1?) if the format is not correct.
Also, you don't need to use sscanf as well.
Seems you are using ZCMD(not DCMD
), you can use insull like this:
Also, you don't need to use sscanf as well.
Seems you are using ZCMD(not DCMD

pawn Код:
CMD:report(playerid, params[])
{
new string[128];//Since max I/O is 128, you must use 128.
if(!isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /report [text]");
SendClientMessage(playerid, COLOR_YELLOW, "Your report has been sent to any online admins.");
format(str, sizeof(str), "[REPORT] %s: %s", GetPName(playerid), params);//Put it here to reduce repeated processing
for(new i=0; i<MAX_PLAYERS; i++)
if(GetAdminLevel(i)>= 1 || IsPlayerAdmin(i)) SendClientMessage(i, COLOR_REPORT, str);
return 1;
}