1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-04-01 18:20:39 +02:00

fix conflict name with death_messages

change var name sounds to soundset in soundset mod
adapt ambience mod to new name in sounset
This commit is contained in:
crabman77 2015-04-01 01:55:09 +02:00
parent 91b0f25735
commit 3618b1c014
2 changed files with 82 additions and 61 deletions

View File

@ -491,10 +491,10 @@ local play_sound = function(player, list, number, is_music)
local gain = 1.0 local gain = 1.0
if list[number].gain ~= nil then if list[number].gain ~= nil then
if is_music then if is_music then
gain = list[number].gain*sounds.get_gain(player_name, "music") gain = list[number].gain*soundset.get_gain(player_name, "music")
--minetest.chat_send_all("gain music: " .. gain ) --minetest.chat_send_all("gain music: " .. gain )
else else
gain = list[number].gain*sounds.get_gain(player_name, "ambience") gain = list[number].gain*soundset.get_gain(player_name, "ambience")
--minetest.chat_send_all("gain sound: " .. gain ) --minetest.chat_send_all("gain sound: " .. gain )
end end
end end
@ -520,7 +520,7 @@ local stop_sound = function(still_playing, player)
local list = cave local list = cave
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -530,7 +530,7 @@ local stop_sound = function(still_playing, player)
local list = cave_frequent local list = cave_frequent
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -540,7 +540,7 @@ local stop_sound = function(still_playing, player)
local list = swimming_frequent local list = swimming_frequent
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -550,7 +550,7 @@ local stop_sound = function(still_playing, player)
local list = beach local list = beach
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -560,7 +560,7 @@ local stop_sound = function(still_playing, player)
local list = beach_frequent local list = beach_frequent
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -570,7 +570,7 @@ local stop_sound = function(still_playing, player)
local list = desert local list = desert
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -580,7 +580,7 @@ local stop_sound = function(still_playing, player)
local list = desert_frequent local list = desert_frequent
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -590,7 +590,7 @@ local stop_sound = function(still_playing, player)
local list = night local list = night
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -600,7 +600,7 @@ local stop_sound = function(still_playing, player)
local list = night_frequent local list = night_frequent
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -610,7 +610,7 @@ local stop_sound = function(still_playing, player)
local list = day local list = day
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -620,7 +620,7 @@ local stop_sound = function(still_playing, player)
local list = day_frequent local list = day_frequent
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -630,7 +630,7 @@ local stop_sound = function(still_playing, player)
local list = music local list = music
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -640,7 +640,7 @@ local stop_sound = function(still_playing, player)
local list = flowing_water local list = flowing_water
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -650,7 +650,7 @@ local stop_sound = function(still_playing, player)
local list = flowing_water2 local list = flowing_water2
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -660,7 +660,7 @@ local stop_sound = function(still_playing, player)
local list = lava local list = lava
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -670,7 +670,7 @@ local stop_sound = function(still_playing, player)
local list = lava2 local list = lava2
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -680,7 +680,7 @@ local stop_sound = function(still_playing, player)
local list = water local list = water
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -690,7 +690,7 @@ local stop_sound = function(still_playing, player)
local list = water_surface local list = water_surface
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
played_on_start = false played_on_start = false
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
@ -701,7 +701,7 @@ local stop_sound = function(still_playing, player)
local list = water_frequent local list = water_frequent
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
-- minetest.chat_send_all("list.on_stop " .. list.on_stop ) -- minetest.chat_send_all("list.on_stop " .. list.on_stop )
played_on_start = false played_on_start = false
end end
@ -716,7 +716,7 @@ local stop_sound = function(still_playing, player)
-- minetest.chat_send_all("handler flying " ) -- minetest.chat_send_all("handler flying " )
if list.on_stop ~= nil then if list.on_stop ~= nil then
-- minetest.chat_send_all("onstop flying" ) -- minetest.chat_send_all("onstop flying" )
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
played_on_start = false played_on_start = false
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
@ -727,7 +727,7 @@ local stop_sound = function(still_playing, player)
local list = splashing_water local list = splashing_water
if list.handler[player_name] ~= nil then if list.handler[player_name] ~= nil then
if list.on_stop ~= nil then if list.on_stop ~= nil then
minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player_name, "ambience")}) minetest.sound_play(list.on_stop, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player_name, "ambience")})
end end
minetest.sound_stop(list.handler[player_name]) minetest.sound_stop(list.handler[player_name])
list.handler[player_name] = nil list.handler[player_name] = nil
@ -756,7 +756,7 @@ minetest.register_globalstep(function(dtime)
-- end -- end
if ambience.on_start ~= nil and played_on_start == false then if ambience.on_start ~= nil and played_on_start == false then
played_on_start = true played_on_start = true
minetest.sound_play(ambience.on_start, {to_player=player:get_player_name(),gain=0.5*sounds.get_gain(player:get_player_name(), "ambience")}) minetest.sound_play(ambience.on_start, {to_player=player:get_player_name(),gain=0.5*soundset.get_gain(player:get_player_name(), "ambience"))
end end
-- minetest.chat_send_all("ambience: " ..ambience ) -- minetest.chat_send_all("ambience: " ..ambience )
-- if ambience.on_start ~= nil and played_on_start_flying == false then -- if ambience.on_start ~= nil and played_on_start_flying == false then

View File

@ -1,36 +1,36 @@
minetest.log("action","[mod soundset] Loading...") minetest.log("action","[mod soundset] Loading...")
sounds = {} soundset = {}
sounds.file = minetest.get_worldpath() .. "/sounds_config.txt" soundset.file = minetest.get_worldpath() .. "/sounds_config.txt"
sounds.gainplayers = {} soundset.gainplayers = {}
sounds.tmp = {} soundset.tmp = {}
local function save_sounds_config() local function save_sounds_config()
local input = io.open(sounds.file, "w") local input = io.open(soundset.file, "w")
if input then if input then
input:write(minetest.serialize(sounds.gainplayers)) input:write(minetest.serialize(soundset.gainplayers))
input:close() input:close()
else else
minetest.log("action","echec d'ouverture (mode:w) de " .. sounds.file) minetest.log("action","echec d'ouverture (mode:w) de " .. soundset.file)
end end
end end
local function load_sounds_config() local function load_sounds_config()
local file = io.open(sounds.file, "r") local file = io.open(soundset.file, "r")
if file then if file then
sounds.gainplayers = minetest.deserialize(file:read("*all")) soundset.gainplayers = minetest.deserialize(file:read("*all"))
file:close() file:close()
end end
if sounds.gainplayers == nil or type(sounds.gainplayers) ~= "table" then if soundset.gainplayers == nil or type(soundset.gainplayers) ~= "table" then
sounds.gainplayers = {} soundset.gainplayers = {}
end end
end end
load_sounds_config() load_sounds_config()
sounds.set_sound = function(name, param) soundset.set_sound = function(name, param)
if param == "" then if param == "" then
minetest.chat_send_player(name, "/setsound <music|ambience|mobs|other> <number>") minetest.chat_send_player(name, "/setsound <music|ambience|mobs|other> <number>")
return return
@ -57,22 +57,22 @@ sounds.set_sound = function(name, param)
value = 100 value = 100
end end
if sounds.gainplayers[name][param_name] == value then if soundset.gainplayers[name][param_name] == value then
minetest.chat_send_player(name, "volume " .. param_name .. " already set to " .. value) minetest.chat_send_player(name, "volume " .. param_name .. " already set to " .. value)
return return
end end
sounds.gainplayers[name][param_name] = value soundset.gainplayers[name][param_name] = value
minetest.chat_send_player(name, "sound " .. param_name .. " set to " .. value) minetest.chat_send_player(name, "sound " .. param_name .. " set to " .. value)
save_sounds_config() save_sounds_config()
end end
sounds.get_gain = function(name, sound_type) soundset.get_gain = function(name, sound_type)
if name == nil or name == "" then if name == nil or name == "" then
return 1 return 1
end end
local gain = sounds.gainplayers[name][sound_type] local gain = soundset.gainplayers[name][sound_type]
if gain == nil then if gain == nil then
return 1 return 1
end end
@ -90,17 +90,22 @@ local formspec = "size[6,6]"..
"image_button[1.6,2;1,1;soundset_dec.png;vambience;-]".. "image_button[1.6,2;1,1;soundset_dec.png;vambience;-]"..
"label[2.7,2.2;%s]".. "label[2.7,2.2;%s]"..
"image_button[3.5,2;1,1;soundset_inc.png;vambience;+]".. "image_button[3.5,2;1,1;soundset_inc.png;vambience;+]"..
"label[0,3.2;OTHER]"..
"image_button[1.6,3;1,1;soundset_dec.png;vother;-]"..
"label[2.7,3.2;%s]"..
"image_button[3.5,3;1,1;soundset_inc.png;vother;+]"..
"button_exit[0.5,5.2;1.5,1;abort;Abort]".. "button_exit[0.5,5.2;1.5,1;abort;Abort]"..
"button_exit[4,5.2;1.5,1;abort;Ok]" "button_exit[4,5.2;1.5,1;abort;Ok]"
local on_show_settings = function(name, music, ambience) local on_show_settings = function(name, music, ambience, other)
if not sounds.tmp[name] then if not soundset.tmp[name] then
sounds.tmp[name] = {} soundset.tmp[name] = {}
end end
sounds.tmp[name]["music"] = music soundset.tmp[name]["music"] = music
sounds.tmp[name]["ambience"] = ambience soundset.tmp[name]["ambience"] = ambience
minetest.show_formspec( name, "soundset:settings", string.format(formspec, tostring(music), tostring(ambience) )) soundset.tmp[name]["other"] = other
minetest.show_formspec( name, "soundset:settings", string.format(formspec, tostring(music), tostring(ambience), tostring(other) ))
end end
@ -108,18 +113,20 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname == "soundset:settings" then if formname == "soundset:settings" then
local name = player:get_player_name() local name = player:get_player_name()
if not name then return end if not name then return end
local fmusic = sounds.tmp[name]["music"] local fmusic = soundset.tmp[name]["music"]
local fambience = sounds.tmp[name]["ambience"] local fambience = soundset.tmp[name]["ambience"]
local fother = soundset.tmp[name]["other"]
if fields["abort"] == "Ok" then if fields["abort"] == "Ok" then
if sounds.gainplayers[name]["music"] ~= fmusic or sounds.gainplayers[name]["ambience"] ~= fambience then if soundset.gainplayers[name]["music"] ~= fmusic or soundset.gainplayers[name]["ambience"] ~= fambience or soundset.gainplayers[name]["other"] ~= fother then
sounds.gainplayers[name]["music"] = fmusic soundset.gainplayers[name]["music"] = fmusic
sounds.gainplayers[name]["ambience"] = fambience soundset.gainplayers[name]["ambience"] = fambience
soundset.gainplayers[name]["other"] = fother
save_sounds_config() save_sounds_config()
end end
sounds.tmp[name] = nil soundset.tmp[name] = nil
return return
elseif fields["abort"] == "Abort" then elseif fields["abort"] == "Abort" then
sounds.tmp[name] = nil soundset.tmp[name] = nil
return return
elseif fields["vmusic"] == "+" then elseif fields["vmusic"] == "+" then
if fmusic < 100 then if fmusic < 100 then
@ -149,14 +156,28 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
fambience = 0 fambience = 0
end end
end end
elseif fields["vother"] == "+" then
if fother < 100 then
fother = fother +5
if fother > 100 then
fother = 100
end
end
elseif fields["vother"] == "-" then
if fother > 0 then
fother = fother -5
if fother < 0 then
fother = 0
end
end
elseif fields["quit"] == "true" then elseif fields["quit"] == "true" then
sounds.tmp[name] = nil soundset.tmp[name] = nil
return return
else else
return return
end end
on_show_settings(name, fmusic, fambience) on_show_settings(name, fmusic, fambience, fother)
end end
end) end)
@ -169,7 +190,7 @@ if (minetest.get_modpath("unified_inventory")) then
action = function(player) action = function(player)
local name = player:get_player_name() local name = player:get_player_name()
if not name then return end if not name then return end
on_show_settings(name, sounds.gainplayers[name]["music"], sounds.gainplayers[name]["ambience"]) on_show_settings(name, soundset.gainplayers[name]["music"], soundset.gainplayers[name]["ambience"], soundset.gainplayers[name]["other"])
end, end,
}) })
end end
@ -180,7 +201,7 @@ minetest.register_chatcommand("soundset", {
privs = {interact=true}, privs = {interact=true},
func = function(name, param) func = function(name, param)
if not name then return end if not name then return end
on_show_settings(name, sounds.gainplayers[name]["music"], sounds.gainplayers[name]["ambience"]) on_show_settings(name, soundset.gainplayers[name]["music"], soundset.gainplayers[name]["ambience"], soundset.gainplayers[name]["other"])
end end
}) })
@ -190,7 +211,7 @@ minetest.register_chatcommand("soundsets", {
params = "<music|ambience|mobs|other> <number>", params = "<music|ambience|mobs|other> <number>",
description = "Set volume sound <music|ambience|mobs|other>", description = "Set volume sound <music|ambience|mobs|other>",
privs = {interact=true}, privs = {interact=true},
func = sounds.set_sound, func = soundset.set_sound,
}) })
minetest.register_chatcommand("soundsetg", { minetest.register_chatcommand("soundsetg", {
@ -199,7 +220,7 @@ minetest.register_chatcommand("soundsetg", {
privs = {interact=true}, privs = {interact=true},
func = function(name, param) func = function(name, param)
local conf = "" local conf = ""
for k, v in pairs(sounds.gainplayers[name]) do for k, v in pairs(soundset.gainplayers[name]) do
conf = conf .. " " .. k .. ":" .. v conf = conf .. " " .. k .. ":" .. v
end end
minetest.chat_send_player(name, "sounds conf " .. conf) minetest.chat_send_player(name, "sounds conf " .. conf)
@ -209,8 +230,8 @@ minetest.register_chatcommand("soundsetg", {
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
local name = player:get_player_name() local name = player:get_player_name()
if sounds.gainplayers[name] == nil then if soundset.gainplayers[name] == nil then
sounds.gainplayers[name] = { ["music"] = 50, ["ambience"] = 50, ["mobs"] = 50, ["other"] = 50 } soundset.gainplayers[name] = { ["music"] = 50, ["ambience"] = 50, ["mobs"] = 50, ["other"] = 50 }
end end
end) end)