start of limited range chat feature

pull/2/head
Brandon 2014-07-07 21:56:56 -05:00
parent 7da1c1b949
commit fe5336ce66
1 changed files with 11 additions and 9 deletions

View File

@ -7,13 +7,15 @@ end)
]]
chat.local_chat = function(pos,text,radius)
if radius == nil then
radius = 25
end
local oir = minetest.get_objects_inside_radius(pos, radius)
for _,p in pairs(oir) do
if p:is_player() then
minetest.chat_send_player(p:get_player_name(),text)
end
end
if radius == nil then
radius = 25
end
if pos ~= nil then
local oir = minetest.get_objects_inside_radius(pos, radius)
for _,p in pairs(oir) do
if p:is_player() then
minetest.chat_send_player(p:get_player_name(),text)
end
end
end
end