Improve "/tpn"

This commit warns the player when they denied a request.
It also tells players what "/tpn" does, the usage.

Tested with MT/MTG 5.0.1 and works fine (no errors/bugs found).
If there's any bug/error/typo, please tell me, so, I can fix it.
This commit is contained in:
Panquesito7 2019-07-28 23:11:54 -05:00 committed by GitHub
parent b583c5c637
commit 56bdc0e30c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -270,13 +270,17 @@ end
function tpr_deny(name)
if tpr_list[name] then
minetest.chat_send_player(tpr_list[name], S("Teleport request denied."))
name2 = tpr_list[name]
minetest.chat_send_player(name2, S("Teleport request denied."))
minetest.chat_send_player(name, S("You denied the request @1 sent you.", name2))
tpr_list[name] = nil
return
end
if tphr_list[name] then
minetest.chat_send_player(tphr_list[name], S("Teleport request denied."))
elseif tphr_list[name] then
name2 = tphr_list[name]
minetest.chat_send_player(name2, S("Teleport request denied."))
minetest.chat_send_player(name, S("You denied the request @1 sent you.", name2))
tphr_list[name] = nil
else
minetest.chat_send_player(name, S("Usage: /tpn allows you to deny teleport requests sent to you by other players."))
return
end
end