Jump to content

Bad Language Detector


Scooby

Recommended Posts

I wrote this for the Public Gambling Script earlier

Ive modified it so u guys can use it in ur scripts.

Its set to mute people for 60 seconds upon use of a banned word.

!Banword

!Unbanword

!banwords

Add or Remove words, Its set for Rcon Level 5 admins, But can be changed to how u want it.

 
on *:SIGNAL:mta.command: {
 if (($3 == !banword) || ($3 == !unbanword)) {
   pgs.banword $1-
 }
 elseif ($3 == !banwords) mta.text $1 There are currently $lines(pgs.banwords.txt) banned words
}

alias pgs.banword {
 if ($mta.level($1,$2) < 5) mta.pm $1 $2 Error: Level 5 Admins Only!
 elseif ($3 == !banword) {
   if (!$4) mta.pm $1 $2 Error: !banword 
   else {
     var %a = 1,%b = $lines(pgs.banwords.txt)
     while (%a <= %b) {
       if ($4 iswm $read(pgs.banwords.txt,%a)) {
         mta.pm $1 $2 Error: Word Already Banned!
         !halt
       }
       !inc %a
     }
     !write pgs.banwords.txt $4
     mta.text $1 $+(',$4,') added to banned words list
   }
 }
 elseif ($3 == !unbanword) {
   if (!$4) mta.pm $1 $2 Error: !unbanword 
   else {
     var %a = 1,%b = $lines(pgs.banwords.txt)
     while (%a <= %b) {
       if ($4 iswm $read(pgs.banwords.txt,%a)) {
         !write -ds $+ $4 pgs.banwords.txt
         mta.text $1 $+(',$4,') removed from banned words list
         %a = $calc(%b + 2)
       }
       !inc %a
     }
     if (%a == $calc(%b + 1)) mta.pm $1 $2 Error: $4 Is Not Banned.
   }
 }
}

alias pgs.bannedwords {
 var %a = 1,%b = $3-,%c = $lines(pgs.banwords.txt) 
 while (%a <= %c) {
   if ($read(pgs.banwords.txt,%a) iswm %b) {
     ;punsihment for use of a banned word
     mta.pm $1 $2 $+(',$read(pgs.banwords.txt,%a),') Is A Banned Word! Muted For 60 Secs
     mta.mute $1 $2
     .timerunmute $+ $2 1 60 mta.unmute $1 $2
     %a = %c
   }
   !inc %a
 }
}

on *:SIGNAL:mta.text: {
 pgs.bannedwords $1-
}

If youre unsure how to add this to your existing script, just paste it into a new blank script and load it seperately, it will work just the same.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...