1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Improve documentation around banning (#9088)

* Fix ban chatcommand description
* Correct ban API documentation
This commit is contained in:
sfan5 2019-11-05 19:24:51 +01:00 committed by GitHub
parent 2907c0f3a2
commit 15a030ec9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 10 deletions

View file

@ -909,8 +909,8 @@ core.register_chatcommand("shutdown", {
})
core.register_chatcommand("ban", {
params = "[<name> | <IP_address>]",
description = "Ban player or show ban list",
params = "[<name>]",
description = "Ban the IP of a player or show the ban list",
privs = {ban=true},
func = function(name, param)
if param == "" then
@ -922,7 +922,7 @@ core.register_chatcommand("ban", {
end
end
if not core.get_player_by_name(param) then
return false, "No such player."
return false, "Player is not online."
end
if not core.ban_player(param) then
return false, "Failed to ban player."
@ -935,7 +935,7 @@ core.register_chatcommand("ban", {
core.register_chatcommand("unban", {
params = "<name> | <IP_address>",
description = "Remove player ban",
description = "Remove IP ban belonging to a player/IP",
privs = {ban=true},
func = function(name, param)
if not core.unban_player_or_ip(param) then