Script Name: swearFilter
Script Description: script which can kick and ban player who is swearing on server
Original Author: cooz
Core Version: 2.5.2
KICK_LIMIT = 3;
BAN_LIMIT = 4;
BAN_TIME = 60;
COUNT_METHOD = 0;
LOWER_COUNT = 5;
LISTCOUNT = 6;
var
swearList: array[1..32] of string;
swearCount: array[1..LISTCOUNT] of integer;
i: integer;
procedure ActivateServer();
begin
swearList[1]:='****';
swearList[2]:='*****';
swearList[3]:='*****';
swearList[4]:='****';
swearList[5]:='*******';
swearList[6]:='justin timberlake';
end;
procedure OnPlayerSpeak(Name,Text: string);
begin
 for i:=1 to LISTCOUNT do if ContainsString(LowerCase(Text),swearList[i]) then begin
  swearCount[NametoID(Name)]:=swearCount[NametoID(Name)]+1;
  SayToPlayer(NametoID(Name),'stop swearing or you''ll be banned');
  if((swearCount[NametoID(Name)]>=KICK_LIMIT)and(swearCount[NametoID(Name)]<BAN_LIMIT)) then begin
   //SayToPlayer(NametoID(Name),'i said ya, kick biatch');
   KickPlayer(NametoID(Name));
   break;
  end;
  if swearCount[NametoID(Name)] >= BAN_LIMIT then begin
   //SayToPlayer(NametoID(Name),'that''s ****ing enough, BAN');
   BanPlayer(NametoID(Name),BAN_TIME);
   swearCount[NametoID(Name)]:=0;
   break;
  end;
  if COUNT_METHOD = 0 then break;
 end;
end;
procedure AppOnIdle(Ticks: integer);
begin
 if Ticks mod (3600*LOWER_COUNT) = 0 then begin
  for i:=1 to 32 do swearCount[i]:=swearCount[i]-1;
 end;
end;
procedure OnCommand(ID: integer;Text: string);
begin
 if Text = '/resetfilter' then begin
  for i:=1 to 32 do swearCount[i]:=0;
 end;
end;
first of all: HAHAha forum censored my swearlistÂ
note:
 please remeber to add swears to swearList in
lower case, thank you
features:
- admin commands:
 /resetfilter - it resets cout of swears of each person
- script switches:
 KICK_LIMIT - after how many swears it will kick player ( default: 3 )
 BAN_LIMIT - after how many swears it will ban player ( default: 4 )
 BAN_TIME - ban time in minutes ( default: 60 )
 COUNT_METHOD - choose: 0 - counts sentences, 1 - counts swears in sentense ( default: 0 )
 LOWER_COUNT - how often it will lower count of swears of each person ( default: 5 )
Â
LISTCOUNT -
very important after extending swearList remeber to change this value, it's count of swears in list (in example list: 6)
how does it work:
 with default values it will kick player after 3 sentences containing some swears, next swear of that person will equal to ban for 1h, also it will lower count of swears every 5 minutes
made on request
i hope you like it, enjoy