/report
#1

hello guys
can some one make me /report [id] [reason] command
i need only one filterscript when i go and insert in filterscript folder then my /report cmd working

thx so much bye bye
Reply
#2

I'm not going to spoon feed it to you, but I'll show you how to create one.

Let's start by creating a new stock - SendClientMessageToAdmins.
pawn Код:
stock SendClientMessageToAdmins(color, const message[]) // We create the stock. You'll need the color, and the message that will be sent.
{
    for(new i = 0; i < MAX_PLAYERS; i++) //we loop through the players, to check who's an admin and who is not.
    {
        if(PlayerInfo[i][pAdmin] >= 1) // If they're an admin, they will receive the message.
        {
            SendClientMessage(i, color, message); //You'll need to SendClientMessageToAdmins(color, message.)
        }
    }
    return true;
}
Now that we have our stock, we can easily make a /report command that will send it to all online admins.

pawn Код:
CMD:report(playerid, params[])
{
    new string[128], reason[128]; // We create the string that will be sent to the admins, and the reason.
    if(sscanf(params, "s[128]",reason))return SendClientMessage(playerid, COLOR_WHITE, " USAGE: /report [reason]"); //We make it so they'll need to use /report [reason].
    format(string, sizeof(string), "Report from: %s[ID:%d]:{DBED15} %s", GetName(playerid), playerid, reason); //We format our string, so we can send it to the online administrators.
    SendClientMessageToAdmins(COLOR_TAN, string); //And here's our stock. We SendClientMessageToAdmins our previous string.
    SendClientMessage(playerid, COLOR_TAN, "Your report has been sent."); //we then send a message to the player, saying their report was successfully sent.
    return 1;
}
Reply
#3

hello

not worrking
please make like filtersript

thx
Reply
#4

pawn Код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>

CMD:report(playerid,params[])
{
    new ID,reason[64],string[124],n[2][24];
    if(sscanf(params,"us[64]",ID,reason)) return SendClientMessage(playerid,-1,"/report [id] [reason]");
    if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,-1,"Idiot no connecto");
    GetPlayerName(playerid,n[1],24);
    GetPlayerName(ID,n[0],24);
    format(string,sizeof(string),"%s reported %s. Reason %s",n[1],n[0],reason);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerAdmin(i))
            {
                SendClientMessage(i,-1,string);
            }
        }
    }
    print(string);
    return 1;
}
Reply
#5

pawn Код:
dcmd_report(playerid,params[])
{
    new reported;
    new tmp[256];
    new tmp2[256];
    new Index;
    tmp = strtok(params,Index);
    tmp2 = strtok(params,Index);
    if(!strlen(params)) return
    SendClientMessage(playerid, LIGHTBLUE2, "Usage: /report [PlayerID] [Reason]") &&
    SendClientMessage(playerid, orange, "Attention: Not report anyone without Reason!");
    reported = strval(tmp);

    if(IsPlayerConnected(reported) && reported != INVALID_PLAYER_ID)
     {
        if(AccInfo[reported][Level] == ServerInfo[MaxAdminLevel])
        return SendClientMessage(playerid,red,"ERROR: You cannot report this Administrator");
        if(playerid == reported)
        return SendClientMessage(playerid,red,"ERROR: You Cannot report Yourself");
        if(strlen(params) > 7)
        {
            new reportedname[MAX_PLAYER_NAME], reporter[MAX_PLAYER_NAME], str[128];
            new hour,minute,second;
            gettime(hour,minute,second);
            GetPlayerName(reported, reportedname, sizeof(reportedname));
            GetPlayerName(playerid, reporter, sizeof(reporter));
            format(str, sizeof(str), "REPORT: %s(Id:%d) Reported %s(Id:%d) Reason: %s |Time: %d:%d:%d|", reporter,playerid, reportedname, reported, params[strlen(tmp)+1], hour,minute,second);
            MessageToAdmins(COLOR_WHITE,str);
            SaveIn("ReportLog",str);
            format(str, sizeof(str), "(%d:%d:%d): %s(Id:%d) Reported %s(Id:%d) Reason: %s", hour,minute,second, reporter,playerid, reportedname, reported, params[strlen(tmp)+1]);
            for(new i = 1; i < MAX_REPORTS-1; i++) Reports[i] = Reports[i+1];
            Reports[MAX_REPORTS-1] = str;
            return SendClientMessage(playerid,yellow, "|- Your report has been sent to Online Administrators and saved in File! -|");
        }
        else return SendClientMessage(playerid,red,"ERROR: Invalid Reason!");
    }
    else return ErrorMessages(playerid, 2);
}
Reply
#6

The easiest way, you'll need Command Processor by ******, it's the fastest CP (ZCMD by Zeex is fast too)
pawn Код:
YCMD:report(playerid, params[], help)
{
     #pragma unused help
     new player, playername[MAX_PLAYER_NAME], myname[MAX_PLAYER_NAME], reason[128], string[128];
     if(sscanf(params, "us[128]", player, reason)) return SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /report [playerid] [reason]");
     else if(player == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFFAA, "ERROR: That player is not connected!");
     GetPlayerName(playerid, myname, sizeof(myname));
     GetPlayerName(player, playername, sizeof(playername));
     format(string, sizeof(string), "SUCCESS: You have reported %s for %s", playername, reason);
     SendClientMessage(playerid, 0xFFFFFFAA, string);
     format(string, sizeof(string), "REPORT: %s has been reported for %s by %s!", playername, myname, reason);
     for(new i = 0; i < MAX_PLAYERS; i++)
     {
           if(IsPlayerAdmin(i)) { SendClientMessage(i, 0xFFFFFFAA, string); }
           return true;
     }
     return 1;
}
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)