Help :S OOC FLOOD :S
#3

pawn Код:
#define FLOOD 2000
First the Global Variable:
pawn Код:
new AFLOOD[MAX_PLAYERS];
Now this one to OnPlayerConnect:
pawn Код:
AFLOOD[playerid] = 0;
pawn Код:
//----------------------------------[ooc]-----------------------------------------------
    if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        if(gPlayerLogged[playerid] == 0)
        {
          SendClientMessage(playerid, COLOR_GREY, "You havent logged in yet !");
          return 1;
        }
            if ((noooc) && PlayerInfo[playerid][pAdmin] < 1)
            {
                SendClientMessage(playerid, COLOR_GRAD2, "OOC Is Disabled By Admin!");
                return 1;
            }
            if(PlayerInfo[playerid][pMuted] == 1)
            {
                SendClientMessage(playerid, TEAM_CYAN_COLOR, " You Are Muted!");
                return 1;
            }
            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, "USAGE: (/o)oc [ooc chat]");
                return 1;
            }
            if (AFLOOD[playerid] == 1 && (PlayerInfo[playerid][pAdmin] < 1))
            {
                format(string, sizeof(string), "Please try again later %d seconds Later!", (FLOOD/10000));
                SendClientMessage(playerid, COLOR_YELLOW, string);
                return 1;

            }
            format(string, sizeof(string), "[OOC] %s: %s " , sendername, result);
            OOCOff(COLOR_OOC,string);
            printf("%s", string);
            if (PlayerInfo[playerid][pAdmin] < 1){AFLOOD[playerid] = 1; SetTimerEx("OOCFLOOD", FLOOD, 0, "i", playerid);}
            }
        return 1;
    }
Now just the public function for the OOCFLOOD
pawn Код:
forward OOCFLOOD(playerid);
public OOCFLOOD(playerid)
{
  AFLOOD[playerid] = 1;
}
Reply


Messages In This Thread
Help :S OOC FLOOD :S - by qwqwqw - 03.05.2010, 12:11
Re: Help :S OOC FLOOD :S - by Peep - 03.05.2010, 13:28
Re: Help :S OOC FLOOD :S - by pierhs - 03.05.2010, 13:43

Forum Jump:


Users browsing this thread: 1 Guest(s)