Ban Mod

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

Ban Mod

by octacian » Mon Jul 18, 2016 15:06

Simple question. How do you do it? I'm new to tables, which is what I'd use (don't know how to insert and delete entries). Most importantly, how do you force the player to leave the game? ...And display a message when banned as well as when they try to log in?
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

User avatar
BrandonReese
Member
 
Posts: 836
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

Re: Ban Mod

by BrandonReese » Mon Jul 18, 2016 15:08

Ban Player function (pretty weak because it's IP based ban)
http://dev.minetest.net/minetest.ban_player

Kick player function, this is what you'll use to disconnect them with a message:
http://dev.minetest.net/minetest.kick_player
 

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

Re: Ban Mod

by octacian » Mon Jul 18, 2016 15:16

That's what I figured. How do I display a message when they try to log in? I'll look at xban or xban2 and see what it does, but if anyone knows that would be great.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

User avatar
BrandonReese
Member
 
Posts: 836
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

Re: Ban Mod

by BrandonReese » Mon Jul 18, 2016 15:20

Kick would be used when you intially ban them. Then you can register a function for on_prejoinplayer (http://dev.minetest.net/minetest.regist ... joinplayer) then you can check the player name against your ban list and if they are banned just return a string in that function stating they are banned and returning the string will deny their access and show them the string you returned. If you don't return a string it lets them in.
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron