report
#2

pawn Код:
if(strcmp(cmd, "/report", true) == 0)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, ORANGE, "USAGE: /report [playername/id] [reason]");
            SendClientMessage(playerid, ORANGE, "FUNCTION: Will report the specified player to the administrators(online).");
            return 1;
        }
        new targetid = ReturnUser(tmp);
        if(targetid != INVALID_PLAYER_ID)
        {
          GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new reason[128];
            reason = bigstrtok(cmdtext, idx);
            if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /report [playerid] [reason]");
            format(string, sizeof(string), "|- %s reported %s [ Reason: %s ]", sendername,giveplayername,reason);
            SendClientMessageToAdmins(ADMIN_RED, string,1);
            format(string, sizeof(string), "Your report on '%s' has been sent to the current online admins. Thank you.", giveplayername);
            SendClientMessage(playerid, GREEN, string);
        }

        else if(giveplayerid == INVALID_PLAYER_ID)
        {
            format(string, sizeof(string), "%d is not an active player.", giveplayerid);
            SendClientMessage(playerid, RED, string);
        }
        return 1;
    }
by Seif_
Reply


Messages In This Thread
report - by StingeR - 03.03.2009, 18:22
Re: report - by Schock - 03.03.2009, 18:46
Re: report - by StingeR - 04.03.2009, 14:42

Forum Jump:


Users browsing this thread: 1 Guest(s)