[HELP]Dcmd_Report
#6

I've rewritten your command with the newest sscanf. The plugin version which can be found on the forums as well.
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;
}
You have to use the sscanf plugin version! It is faster too!
Reply


Messages In This Thread
[HELP]Dcmd_Report - by Tessar - 12.12.2010, 07:35
Re: [HELP]Dcmd_Report - by Lorenc_ - 12.12.2010, 09:02
Re: [HELP]Dcmd_Report - by Tessar - 12.12.2010, 09:41
Re: [HELP]Dcmd_Report - by Marcel - 12.12.2010, 10:39
Re: [HELP]Dcmd_Report - by Tessar - 12.12.2010, 10:57
Re: [HELP]Dcmd_Report - by Marcel - 12.12.2010, 11:29
Re: [HELP]Dcmd_Report - by Tessar - 12.12.2010, 11:43
Re: [HELP]Dcmd_Report - by Marcel - 12.12.2010, 11:46

Forum Jump:


Users browsing this thread: 3 Guest(s)