Badword Filter

Description

Whenever a player says a badword (one of the ones listed in BadWordsList.txt) they are optionally kicked, and their number of used warnings is increased. Once they use up all of their warnings, they are either kicked or banned.

Download

Source Code

  1. //config
  2. //number of times a player can curse before getting kicked or banned
  3. 'BadWordsList.txt'; //file which holds the badwords, each seperated with a space
  4. //When a player reaches the curse limit, ban the player? (true or false)
  5. //With each offense, kill the player? (true or false)
  6. //color of messages told to player
  7. BanLength = 15; //minutes a player will be banned for, if the Ban = true;
  8.  
  9. //holders of information
  10. //holds the number of warnings for each player
  11. //contents of badwords file
  12. //credits to DorkeyDear - http://www.soldatforums.com/index.php?topic=27844.0
  13. //load badwords list
  14. 'Cannot find badwords file'//we're making the list of badword's case uppercase so they are case insensitive
  15. ' '//whenever someone says something, check it.
  16. //do we any badwords to check?
  17. //for now, make it false
  18. //check it!
  19. //if it is a bad word, make it known that we cursed
  20. //we're making what they said upercase so the badwords are case insensitive
  21. //saying something naughty?
  22. //increase number of warnings used
  23. //reached limit
  24. //reset limit for this id
  25. //Ban or kick?
  26. //under limit..
  27. //should we kill him / her?
  28. //notify player of this
  29. 'You have been warned for offensive language.''If you curse '' more time(s), you will be ''banned','kicked')+'.'