mirror of
https://github.com/minetest-mods/teleport-request.git
synced 2025-01-08 14:07:28 +01:00
Merge branch 'master' of https://github.com/Cat5TV/tps_teleport
This commit is contained in:
commit
5ea58a2075
@ -27,9 +27,10 @@ Accept a user's request to teleport to you or teleport you to them.
|
|||||||
Deny a user's request to teleport to youor teleport you to them.
|
Deny a user's request to teleport to youor teleport you to them.
|
||||||
|
|
||||||
##Contributors:
|
##Contributors:
|
||||||
- [RobbieF](https://minetest.tv)
|
- [RobbieF](https://minetest.tv) | [GitHub](https://github.com/Cat5TV)
|
||||||
- [DonBatman](https://github.com/donbatman)
|
- [DonBatman](https://github.com/donbatman)
|
||||||
- [NathanS21](http://nathansalapat.com/)
|
- [NathanS21](http://nathansalapat.com/)
|
||||||
|
- [Traxie21](https://github.com/Traxie21) The original creater of this mod
|
||||||
- All those who contributed to the original mod (please see init.lua)
|
- All those who contributed to the original mod (please see init.lua)
|
||||||
|
|
||||||
##To Do:
|
##To Do:
|
||||||
@ -41,3 +42,4 @@ Deny a user's request to teleport to youor teleport you to them.
|
|||||||
- Creation of "evade" command /tpe which spawns the player in several random locations nearby before placing them at a final destination ~20 nodes away. For evading attack.
|
- Creation of "evade" command /tpe which spawns the player in several random locations nearby before placing them at a final destination ~20 nodes away. For evading attack.
|
||||||
- Add a handful of coordinates which can be set in config and teleported to by anyone regardless of their protection status (eg., Spawn).
|
- Add a handful of coordinates which can be set in config and teleported to by anyone regardless of their protection status (eg., Spawn).
|
||||||
- Add a privilege which is required in order to use all commands. I haven't added such a thing since it hasn't been needed on our servers, but I imagine it would be useful on other servers who desire to grant these features only to specific players.
|
- Add a privilege which is required in order to use all commands. I haven't added such a thing since it hasn't been needed on our servers, but I imagine it would be useful on other servers who desire to grant these features only to specific players.
|
||||||
|
- Enhance privileges: Make /tpc require a separate privilege than the /tpr or /tphr commands.
|
||||||
|
14
init.lua
14
init.lua
@ -10,7 +10,14 @@ local version = "1.3"
|
|||||||
local tpr_list = {}
|
local tpr_list = {}
|
||||||
local tphr_list = {}
|
local tphr_list = {}
|
||||||
|
|
||||||
minetest.register_privilege("tp_admin", {description = "Admin overrides for tps_teleport.", give_to_singleplayer=false,})
|
minetest.register_privilege("tp_admin", {
|
||||||
|
description = "Admin overrides for tps_teleport.",
|
||||||
|
give_to_singleplayer=false
|
||||||
|
})
|
||||||
|
minetest.register_privilege("tp_tpc", {
|
||||||
|
description = "Allow player to teleport to coordinates (if permitted by area protection).",
|
||||||
|
give_to_singleplayer=true
|
||||||
|
})
|
||||||
|
|
||||||
local function find_free_position_near(pos)
|
local function find_free_position_near(pos)
|
||||||
local tries = {
|
local tries = {
|
||||||
@ -131,6 +138,7 @@ local function tpc_send(player,coordinates)
|
|||||||
minetest.sound_play("whoosh", {pos = target_coords, gain = 0.5, max_hear_distance = 10})
|
minetest.sound_play("whoosh", {pos = target_coords, gain = 0.5, max_hear_distance = 10})
|
||||||
parti2(target_coords)
|
parti2(target_coords)
|
||||||
else
|
else
|
||||||
|
if minetest.check_player_privs(pname, {tp_tpc=true}) then
|
||||||
local protected = minetest.is_protected(target_coords,pname)
|
local protected = minetest.is_protected(target_coords,pname)
|
||||||
if protected then
|
if protected then
|
||||||
if not areas:canInteract(target_coords, player) then
|
if not areas:canInteract(target_coords, player) then
|
||||||
@ -143,6 +151,10 @@ local function tpc_send(player,coordinates)
|
|||||||
pname:setpos(find_free_position_near(target_coords))
|
pname:setpos(find_free_position_near(target_coords))
|
||||||
minetest.sound_play("whoosh", {pos = target_coords, gain = 0.5, max_hear_distance = 10})
|
minetest.sound_play("whoosh", {pos = target_coords, gain = 0.5, max_hear_distance = 10})
|
||||||
parti2(target_coords)
|
parti2(target_coords)
|
||||||
|
else
|
||||||
|
minetest.chat_send_player(player, "Error: You do not have permission to teleport to coordinates.")
|
||||||
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user