how to make report time limit cmd?
#2

pawn Код:
//TOP
new rTime[MAX_PLAYERS];

if(strcmp(cmd, "/report", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "Use: /report [text]");
                return 1;
            }
            if(rTime[playerid] == 1) return SendClientMessage(playerid, COLOR_GRAD2, "You must wait 2 minutes until your next report!");
            format(string, sizeof(string), "Report od %s: %s", sendername, (result));
            ABroadCast(COLOR_YELLOW,string,1);
            SendClientMessage(playerid, COLOR_YELLOW, "Your report message send to admins.");
            rTime[playerid] = 1;
            SetTimerEx("Report", 120000, 0, "%d", playerid);
      }
      return 1;
    }
//==================================================

forward Report(playerid);
public Report(playerid)
{
  rTime[playerid] = 0;
}
Reply


Messages In This Thread
how to make report time limit cmd? - by buonggiorno - 11.01.2010, 08:15
Re: how to make report time limit cmd? - by [HiC]TheKiller - 11.01.2010, 08:20
Re: how to make report time limit cmd? - by buonggiorno - 11.01.2010, 08:25
Re: how to make report time limit cmd? - by jamesb93 - 11.01.2010, 08:35
Re: how to make report time limit cmd? - by buonggiorno - 11.01.2010, 08:39
Re: how to make report time limit cmd? - by jamesb93 - 11.01.2010, 08:41
Re: how to make report time limit cmd? - by buonggiorno - 11.01.2010, 08:44

Forum Jump:


Users browsing this thread: 3 Guest(s)