mirror of
https://github.com/minetest-mods/teleport-request.git
synced 2025-01-08 14:07:28 +01:00
Add particles, fix sound.
This commit is contained in:
parent
5882f803aa
commit
80fc854a93
28
init.lua
28
init.lua
@ -28,6 +28,28 @@ local function find_free_position_near(pos)
|
|||||||
return pos, false
|
return pos, false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function parti(pos)
|
||||||
|
minetest.add_particlespawner(50, 0.4,
|
||||||
|
{x=pos.x + 0.5, y=pos.y, z=pos.z + 0.5}, {x=pos.x - 0.5, y=pos.y, z=pos.z - 0.5},
|
||||||
|
{x=0, y=5, z=0}, {x=0, y=0, z=0},
|
||||||
|
{x=0, y=5, z=0}, {x=0, y=0, z=0},
|
||||||
|
3, 5,
|
||||||
|
3, 5,
|
||||||
|
false,
|
||||||
|
"tps_portal_parti.png")
|
||||||
|
end
|
||||||
|
|
||||||
|
local function parti2(pos)
|
||||||
|
minetest.add_particlespawner(50, 0.4,
|
||||||
|
{x=pos.x + 0.5, y=pos.y + 10, z=pos.z + 0.5}, {x=pos.x - 0.5, y=pos.y, z=pos.z - 0.5},
|
||||||
|
{x=0, y=-5, z=0}, {x=0, y=0, z=0},
|
||||||
|
{x=0, y=-5, z=0}, {x=0, y=0, z=0},
|
||||||
|
3, 5,
|
||||||
|
3, 5,
|
||||||
|
false,
|
||||||
|
"tps_portal_parti.png")
|
||||||
|
end
|
||||||
|
|
||||||
--Teleport Request System
|
--Teleport Request System
|
||||||
local function tpr_send(sender, receiver)
|
local function tpr_send(sender, receiver)
|
||||||
if receiver == "" then
|
if receiver == "" then
|
||||||
@ -105,8 +127,9 @@ local function tpc_send(player,coordinates)
|
|||||||
-- Admin user (priv "tp_admin") overrides all protection
|
-- Admin user (priv "tp_admin") overrides all protection
|
||||||
if minetest.check_player_privs(pname, {tp_admin=true}) then
|
if minetest.check_player_privs(pname, {tp_admin=true}) then
|
||||||
minetest.chat_send_player(player, 'Teleporting to '..posx..','..posy..','..posz)
|
minetest.chat_send_player(player, 'Teleporting to '..posx..','..posy..','..posz)
|
||||||
minetest.sound_play("tps_portal", {pos = target_coords, gain = 1.0, max_hear_distance = 10})
|
|
||||||
pname:setpos(find_free_position_near(target_coords))
|
pname:setpos(find_free_position_near(target_coords))
|
||||||
|
minetest.sound_play("tps_portal", {pos = target_coords, gain = 1.0, max_hear_distance = 10})
|
||||||
|
parti2(target_coords)
|
||||||
else
|
else
|
||||||
local protected = minetest.is_protected(target_coords,pname)
|
local protected = minetest.is_protected(target_coords,pname)
|
||||||
if protected then
|
if protected then
|
||||||
@ -117,8 +140,9 @@ local function tpc_send(player,coordinates)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
minetest.chat_send_player(player, 'Teleporting to '..posx..','..posy..','..posz)
|
minetest.chat_send_player(player, 'Teleporting to '..posx..','..posy..','..posz)
|
||||||
minetest.sound_play("tps_portal", {pos = target_coords, gain = 1.0, max_hear_distance = 10})
|
|
||||||
pname:setpos(find_free_position_near(target_coords))
|
pname:setpos(find_free_position_near(target_coords))
|
||||||
|
minetest.sound_play("tps_portal", {pos = target_coords, gain = 1.0, max_hear_distance = 10})
|
||||||
|
parti2(target_coords)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user