12.12.2010, 11:29
I've rewritten your command with the newest sscanf. The plugin version which can be found on the forums as well.
You have to use the sscanf plugin version! It is faster too!
pawn Код:
dcmd_report (playerid, params[])
{
new
pID,
pName[MAX_PLAYER_NAME],
string[230],
pName2[MAX_PLAYER_NAME],
reason[128],
day,
month,
year;
if (sscanf (params, "us[128]", pID, reason))
{
SendClientMessage (playerid, COLOR_RED, "Usage /report [playerid] [reason]");
}
else
{
if (!IsPlayerConnected (pID))
{
SendClientMessage (playerid, COLOR_RED, "This player is not connected!");
return 1;
}
GetPlayerName (playerid, pName, sizeof (pName));
GetPlayerName (pID, pName2, sizeof (pName2));
getdate (year, month, day);
format (string, sizeof (string), "%d/%d/%d: Report: %s [ID: %d] reported %s [ID: %d] for %s", day, month, year, pName, playerid, pName2, pID, reason);
SendmAdminMsg (COLOR_LIGHTRED, string);
SendClientMessage (playerid, COLOR_YELLOW, "Your report has been sent to the online admins!");
return 1;
}
return 1;
}