mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-25 02:00:37 +01:00
Merge pull-request #18 by crabman77
"Correction de svol|mvol le crash du serveur" Branch : http://github.com/crabman77/minetest-minetestforfun-server/tree/debug_ambiance
This commit is contained in:
commit
e03603683c
@ -779,21 +779,29 @@ minetest.register_chatcommand("svol", {
|
|||||||
description = "set volume of sounds, default 1 normal volume.",
|
description = "set volume of sounds, default 1 normal volume.",
|
||||||
privs = {server=true},
|
privs = {server=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
SOUNDVOLUME = param
|
if param == "" or tonumber(param) == nil then
|
||||||
|
minetest.chat_send_player(name, "Sound volume not set, param is not an numeric value.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
SOUNDVOLUME = tonumber(param)
|
||||||
-- local player = minetest.get_player_by_name(name)
|
-- local player = minetest.get_player_by_name(name)
|
||||||
-- ambiences = get_ambience(player)
|
-- ambiences = get_ambience(player)
|
||||||
-- stop_sound({}, player)
|
-- stop_sound({}, player)
|
||||||
minetest.chat_send_player(name, "Sound volume set.")
|
minetest.chat_send_player(name, "Sound volume set to " .. param .. ".")
|
||||||
end, })
|
end, })
|
||||||
minetest.register_chatcommand("mvol", {
|
minetest.register_chatcommand("mvol", {
|
||||||
params = "<mvol>",
|
params = "<mvol>",
|
||||||
description = "set volume of music, default 1 normal volume.",
|
description = "set volume of music, default 1 normal volume.",
|
||||||
privs = {server=true},
|
privs = {server=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
MUSICVOLUME = param
|
if param == "" or tonumber(param) == nil then
|
||||||
|
minetest.chat_send_player(name, "Music volume not set, param is not an numeric value")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
MUSICVOLUME = tonumber(param)
|
||||||
-- local player = minetest.get_player_by_name(name)
|
-- local player = minetest.get_player_by_name(name)
|
||||||
-- stop_sound({}, player)
|
-- stop_sound({}, player)
|
||||||
-- ambiences = get_ambience(player)
|
-- ambiences = get_ambience(player)
|
||||||
minetest.chat_send_player(name, "Music volume set.")
|
minetest.chat_send_player(name, "Music volume set to " .. param .. ".")
|
||||||
end, })
|
end, })
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user