ReportTime
#3

Quote:
Originally Posted by Richie©
Посмотреть сообщение
Use gettime instead, then you dont need any timers.
pawn Код:
if(gettime() - ReportTime[playerid] < 25) return SendClientMessage(playerid, -1, "You can only report players every 25 seconds!"); // Player has reported a player within the last 25 seconds.

ReportTime[playerid]  = gettime(); //The player has now reported a player
I now did other thing.I did the foreach but now it says that I have 24 seconds.How can I make it so it goes down and down?

pawn Код:
CMD:report(playerid, params[])

{
    new string[128];
    if(!IsPlayerLoggedIn(playerid) || PlayerInfo[playerid][pAsshole] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use command.");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /report [text]");
    if(PlayerInfo[playerid][pRMute] > 0) return SendClientMessage(playerid, COLOR_GREY, "You are muted from reporting.");
    if(AntiAdv(playerid, params)) return 1;
    if(strlen(params) > 128) return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
    if(ReportTime[playerid] > 0)
    {
        format(string, sizeof(string), "You need to wait %d more seconds before making a report message again.", ReportTime[playerid]);
        SendClientMessage(playerid, COLOR_GREY, string);
        return 1;
    }
    SendReportToQue(playerid, params);
    Log("logs/reports.log", string);
    SendClientMessage(playerid, COLOR_ORANGE, "Your report have been sent to the online admins, Please be patient.");
    ReportTime[playerid] = 25;
    SetTimerEx("ReportTimer", 1000, false, "i", playerid);
    foreach(Player, i)
    if(ReportTime[i] > 0)
    {
        ReportTime[i]--;
    }
    return 1;
}
Reply


Messages In This Thread
ReportTime - by Necip - 03.06.2013, 16:56
Re: ReportTime - by Richie© - 03.06.2013, 17:11
Re: ReportTime - by Necip - 03.06.2013, 17:21
Re: ReportTime - by Richie© - 03.06.2013, 17:22
Re: ReportTime - by Pottus - 03.06.2013, 17:43
Re: ReportTime - by Necip - 03.06.2013, 17:48
Re: ReportTime - by Richie© - 03.06.2013, 17:51
Re: ReportTime - by Pottus - 03.06.2013, 17:52
Re: ReportTime - by Necip - 03.06.2013, 18:05
Re: ReportTime - by Scenario - 03.06.2013, 18:11

Forum Jump:


Users browsing this thread: 2 Guest(s)