Trying to write /reports to file
#8

dude I will kill you ! Isplayeradmin! whats this! here is mine edit it
this one somewhere in your gm
pawn Код:
new Reports[MAX_REPORTS][128];
and this one is like anti spam

pawn Код:
#define MAX_REPORTS 7
pawn Код:
dcmd_report(playerid, params[]) {
    new reported, tmp[128], tmp2[128], Index;       tmp = strtok(params,Index), tmp2 = strtok(params,Index);
    if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /report [playerid] [reason]");
    reported = strval(tmp);
    if(IsPlayerConnected(reported) && reported != INVALID_PLAYER_ID) {
        if(PlayerInfo[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], hour,minute,second; gettime(hour,minute,second);
            GetPlayerName(reported, reportedname, sizeof(reportedname));    GetPlayerName(playerid, reporter, sizeof(reporter));
            format(str, sizeof(str), "||NewReport||  %s(%d) reported %s(%d) Reason: %s |@%d:%d:%d|", reporter,playerid, reportedname, reported, params[strlen(tmp)+1], hour,minute,second);
            MessageToAdmins(COLOR_WHITE,str);
            SaveToFile("ReportLog",str);
            format(str, sizeof(str), "Report(%d:%d:%d): %s(%d) reported %s(%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.");
        } else return SendClientMessage(playerid,red,"ERROR: Must be a valid reason");
    } else return SendClientMessage(playerid, red, "Player is not connected");}
you will something called Level change it to your admin system ! and there is something called message to admins here its is define it
pawn Код:
forward MessageToAdmins(color,const string[]);
public MessageToAdmins(color,const string[]){
    for(new i = 0; i < MAX_PLAYERS; i++){
        if(IsPlayerConnected(i) == 1) if (PlayerInfo[i][Level] >= 1) SendClientMessage(i, color, string);}
    return 1;}
if I help +rep
Reply


Messages In This Thread
Trying to write /reports to file - by Brandondw8 - 14.05.2014, 19:53
Re: Trying to write /reports to file - by KillerStrike23 - 14.05.2014, 19:58
Re: Trying to write /reports to file - by Brandondw8 - 14.05.2014, 20:03
Re: Trying to write /reports to file - by Brandondw8 - 14.05.2014, 20:07
Re: Trying to write /reports to file - by awsomedude - 14.05.2014, 21:00
Re: Trying to write /reports to file - by Brandondw8 - 14.05.2014, 23:28
Re: Trying to write /reports to file - by Brandondw8 - 15.05.2014, 00:32
Re: Trying to write /reports to file - by KillerStrike23 - 15.05.2014, 03:47
Re: Trying to write /reports to file - by Brandondw8 - 15.05.2014, 04:42
Re: Trying to write /reports to file - by Brandondw8 - 15.05.2014, 07:45

Forum Jump:


Users browsing this thread: 1 Guest(s)