Official Soldat Forums
Server Talk => Scripting Releases => Topic started by: cooz on November 07, 2006, 01:00:05 pm
-
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 ;D
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
-
very nice, i'll modify it for my purposes and test it
-
how i can mix two scripts?
like procedure OnPlayerSpeak(Name,Text: string);
" if Text = '!joinA' then Command('/setteam1 '+IntToStr(NameToID(Name))); "
with swearFilter ?
-
Edit ScriptA and put your changes from ScriptB into ScriptA... and read this sticky (http://forums.soldat.pl/index.php?topic=7516.0).
-
justin timberlake is swearing??
-
justin timberlake is swearing??
Please try to keep posting to on topic discussion.
-
justin timberlake is swearing??
Please try to keep posting to on topic discussion.
In the swearlist (which cooz says was censured by the forum) it says justin timberlake, which is ment to be a swear but due to the forum's swearfilter it was censored.
-
justin timberlake is swearing??
that's just a joke, sorry if i offended you with that
-
Ready for a stupid question :P. Where do i put this scripts?
-
Into your server's scripts directory (NetworkCore.pas). Also read: http://forums.soldat.pl/index.php?topic=7516.0
But you should only install this script, if you have the time to nurture it... there are too many bugs inside.
-
also read this if you don't know how to install scripts: http://forums.soldat.pl/index.php?topic=11622.0
-
Aaahh now i get it. I see it's a relative new feature. i never heard of this type of scripting :D. Ty guys for helping me out.
Regards Mr X