[HELP] /report
#2

pawn Код:
CMD:report(playerid, params[])
{
    new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME], str[128], reason, iD;
    if (sscanf(params, "dz", iD, reason)) return SendClientMessage(playerid, COLOR_GREY, "SYNTAX:/report [ID] [Reason]");
    if (iD == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "This Player is not online.");
    if (playerid == iD) return SendClientMessage(playerid, COLOR_RED, "You can't report yourself.");
    GetPlayerName(playerid, pName, sizeof(pName));
    GetPlayerName(iD, aName, sizeof(aName));
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            new zName[MAX_PLAYER_NAME], pFile[256];
            GetPlayerName(i, zName, sizeof(zName));
            format(pFile, sizeof(pFile), "Users\%s.ini", zName); //not needed but leave it there to avoid errors
            if (IsPlayerAdmin(i) || dini_Int(pFile, "AdminLevel") >= 1)
            {
                format(str, sizeof(str), "%s(%d) has reported %s(%d) for: %s", pName, playerid, aName, iD, reason);
                SendClientMessage(i, COLOR_LEMON, str);
            }
        }
    }
    return 1;
}
^^. Just change the COLOR's to your one to avoid undefined errors
Reply


Messages In This Thread
[HELP] /report - by Amine_Mejrhirrou - 22.06.2011, 21:23
Re: [HELP] /report - by Tachibana - 22.06.2011, 21:40
Re : [HELP] /report - by Amine_Mejrhirrou - 22.06.2011, 21:44
Re: Re : [HELP] /report - by Tachibana - 22.06.2011, 21:47
Re : [HELP] /report - by Amine_Mejrhirrou - 22.06.2011, 21:49
Re: Re : [HELP] /report - by Tachibana - 22.06.2011, 21:51
Re : [HELP] /report - by Amine_Mejrhirrou - 22.06.2011, 22:15
Re: Re : [HELP] /report - by Tachibana - 22.06.2011, 22:15

Forum Jump:


Users browsing this thread: 1 Guest(s)