[Mod] Auto kick players on swear word [WIP] [kickoncurse]

iZacZip
Member
 
Posts: 47
Joined: Sat Dec 05, 2015 10:37
Location: Earth?
GitHub: Zippy1
IRC: iZacZip
In-game: iZacZip-Zac-Zippy

[Mod] Auto kick players on swear word [WIP] [kickoncurse]

by iZacZip » Sat May 13, 2017 14:55

Hello all,
I've been looking for a mod that kicks players if they swear.
I couldn't find one, so I decided to make one :) not sure if screenshots
are necessary, but I'm working on them.
The code was originally from AiTechEye's misccmd
mod, but I thought that this particular module of it
needed a bit more attention. So here it is!

Add more (temporary):
Copy this code, paste it into the init.lua file and change the swear words listed in it.
Code: Select all
local badwords_kick_saying_F=1

minetest.register_on_chat_message(function(name, message)
   if badwords_kick_saying_F~=1 then return false end
   msg=message:lower()
   if msg:find("fuck") or
    msg:find("fukc")
      then
      minetest.kick_player(name, "Ey, you. Don't talk like that! It ain't allowed.")
      minetest.chat_send_all(name .. " said a swear word that is not accepted by the server. S/he was kicked.")
      print("badword: <".. name .."> " ..  message)
   else
      return false
   end
end)



DOWNLOADS:
Go to the Github page.
After installation, rename the file from
kickoncurse-master to kickoncurse.
Report an Issue?
Jokes never last twice.
 

User avatar
lag01
Member
 
Posts: 293
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag
 

iZacZip
Member
 
Posts: 47
Joined: Sat Dec 05, 2015 10:37
Location: Earth?
GitHub: Zippy1
IRC: iZacZip
In-game: iZacZip-Zac-Zippy

Re: [Mod] Auto kick players on swear word [WIP] [kickoncurse

by iZacZip » Sat May 13, 2017 17:35

lag01 wrote:Well, i have such mod.
https://forum.minetest.net/viewtopic.php?t=12617
Interesting to look, how you do this.

I see you've used minetest.log. May consider that...
Jokes never last twice.
 


Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 2 guests