/report need help
#1

For now, players can spam /report to admins. Can someone help me how to make it delay for a minute?

and admin like /acceptreport and then it will show "Hello, my name is *playername* (ID: #), I'm helping you now" to player that /report

thanks

here's the pwn

pawn Код:
CMD:report(playerid, params[])
{
    new string[128];
    new reporter[MAX_PLAYER_NAME];
    GetPlayerName(playerid, reporter, sizeof(reporter));
    if(!sscanf(params, "s[128]", string))
    {
        SendClientMessage(playerid, COLOR_YELLOW, "Report Anda telah dikirim kepada Admin.");
        if(PlayerInfo[playerid][pAdmin] >= 2)
        {
            if(strlen(string) > 65)
            {
                new string2[63], string3[65];
                strmid(string2, string, 65, strlen(string), 63);
                strmid(string3, string, 0, 65, 65);
                strdel(string, 80, strlen(string));
                format(string, sizeof(string), "Report from %s (ID: %d) %s ... ", reporter, playerid, string3);
                SendToAdmin(COLOR_ORANGE, string);
                format(string, sizeof(string), "Report from %s (ID: %d) ... %s ", reporter, playerid, string2);
                SendToAdmin(COLOR_ORANGE, string);
            }
            else
            {
                format(string, sizeof(string), "Report from %s (ID: %d): %s", reporter, playerid, params);
                SendToAdmin(COLOR_ORANGE, string);
            }
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "PENGGUNAAN: /report [text]");
    }
    return 1;
}
Reply
#2

https://sampwiki.blast.hk/wiki/SetTimerEx
Reply
#3

Can you give me an example please?
Reply
#4

First create a variable like

new bool:reporting[MAX_PLAYERS];

When they do the /report set the:
reporting[playerid] = true;

Add this inside where you want your timer to be at
SetTimerEx("ReportEnabled", 15000, false, "i", playerid);

Then outside
forward ReportEnabled(playerid);
public ReportEnabled(playerid) {
reporting[playerid] = false;
}
Reply
#5

I confused, can you make it for me.. or explain more detail please?
Reply
#6

No not SetTimerEx() crazy scripters....

pawn Код:
new ReportTime[MAX_PLAYERS];

CMD:report(playerid, params[])
{
    if(gettime() - ReportTime[playerid] > 60)
    {
        new string[128];
        new reporter[MAX_PLAYER_NAME];
        GetPlayerName(playerid, reporter, sizeof(reporter));
        if(!sscanf(params, "s[128]", string))
        {
            SendClientMessage(playerid, COLOR_YELLOW, "Report Anda telah dikirim kepada Admin.");
            if(PlayerInfo[playerid][pAdmin] >= 2)
            {
                if(strlen(string) > 65)
                {
                    new string2[63], string3[65];
                    strmid(string2, string, 65, strlen(string), 63);
                    strmid(string3, string, 0, 65, 65);
                    strdel(string, 80, strlen(string));
                    format(string, sizeof(string), "Report from %s (ID: %d) %s ... ", reporter, playerid, string3);
                    SendToAdmin(COLOR_ORANGE, string);
                    format(string, sizeof(string), "Report from %s (ID: %d) ... %s ", reporter, playerid, string2);
                    SendToAdmin(COLOR_ORANGE, string);
                }
                else
                {
                    format(string, sizeof(string), "Report from %s (ID: %d): %s", reporter, playerid, params);
                    SendToAdmin(COLOR_ORANGE, string);
                }
                ReportTime[playerid] = gettime();
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "PENGGUNAAN: /report [text]");
        }
    }
    else SendClientMessage(playerid, COLOR_GREY, "You must wait a minute before sending another report");
    return 1;
}
Reply
#7

Thank you very much! repped

Can you help me with the second one?
admin to /acceptreport and then it will show "Hello, my name is *playername* (ID: #), I'm helping you now" to player that /report
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)