1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-01-24 00:40:20 +01:00

Merge branch 'master' of github.com:Ombridride/minetest-minetestforfun-server

This commit is contained in:
LeMagnesium 2015-03-15 17:32:23 +01:00
commit 3620fe8610
3 changed files with 8 additions and 8 deletions

View File

@ -144,7 +144,7 @@ function areas:canPlayerAddArea(pos1, pos2, name)
local max_areas = privs.areas_high_limit and local max_areas = privs.areas_high_limit and
self.config.self_protection_max_areas_high or self.config.self_protection_max_areas_high or
self.config.self_protection_max_areas self.config.self_protection_max_areas
if count >= max_areas and minetest.get_player_privs(name)["megabuilder"] == false then if count >= max_areas and minetest.get_player_privs(name)["megabuilder"] ~= true then
return false, "You have reached the maximum amount of" return false, "You have reached the maximum amount of"
.." areas that you are allowed to protect." .." areas that you are allowed to protect."
end end

View File

@ -185,7 +185,7 @@ markers.marker_placed = function( pos, placer, itemstack )
end end
-- make sure the list does not grow too large -- make sure the list does not grow too large
if( n > markers.MAX_MARKERS and minetest.get_player_privs(name)["megabuilder"] == false) then if( n > markers.MAX_MARKERS and minetest.get_player_privs(name)["megabuilder"] ~= true) then
table.remove( markers.positions[ name ], 1 ); table.remove( markers.positions[ name ], 1 );
end end
end end
@ -366,7 +366,7 @@ markers.get_marker_formspec = function(player, pos, error_msg)
* (math.abs( coords[1].z - coords[2].z )+1); * (math.abs( coords[1].z - coords[2].z )+1);
-- check if area is too large -- check if area is too large
if( markers.MAX_SIZE < size and minetest.get_player_privs(name)["megabuilder"] == false) then if( markers.MAX_SIZE < size and minetest.get_player_privs(name)["megabuilder"] ~= true) then
return formspec_info.."Error: You can only protect\nareas of up to "..tostring( markers.MAX_SIZE ).."m^2.\n".. return formspec_info.."Error: You can only protect\nareas of up to "..tostring( markers.MAX_SIZE ).."m^2.\n"..
"Your marked area is "..tostring( size ).." m^2 large.]"; "Your marked area is "..tostring( size ).." m^2 large.]";
end end
@ -456,19 +456,19 @@ markers.marker_on_receive_fields = function(pos, formname, fields, sender)
local add_depth = tonumber( fields['add_depth'] ); local add_depth = tonumber( fields['add_depth'] );
local error_msg = ''; local error_msg = '';
if( not( add_height ) or add_height < 0 or (add_height > markers.MAX_HEIGHT and minetest.get_player_privs(name)["megabuilder"] == false)) then if( not( add_height ) or add_height < 0 or (add_height > markers.MAX_HEIGHT and minetest.get_player_privs(name)["megabuilder"] ~= true)) then
minetest.chat_send_player( name, 'Please enter a number between 0 and '..tostring( markers.MAX_HEIGHT ).. minetest.chat_send_player( name, 'Please enter a number between 0 and '..tostring( markers.MAX_HEIGHT )..
' in the field where the height of your area is requested. Your area will stretch that many blocks '.. ' in the field where the height of your area is requested. Your area will stretch that many blocks '..
'up into the sky from the position of this marker onward.'); 'up into the sky from the position of this marker onward.');
error_msg = 'The height value\nhas to be larger than 0\nand smaller than '..tostring( markers.MAX_HEIGHT ); error_msg = 'The height value\nhas to be larger than 0\nand smaller than '..tostring( markers.MAX_HEIGHT );
elseif( not( add_depth ) or add_depth < 0 or (add_depth > markers.MAX_HEIGHT and minetest.get_player_privs(name)["megabuilder"] == false)) then elseif( not( add_depth ) or add_depth < 0 or (add_depth > markers.MAX_HEIGHT and minetest.get_player_privs(name)["megabuilder"] ~= true)) then
minetest.chat_send_player( name, 'Please enter a number between 0 and '..tostring( markers.MAX_HEIGHT ).. minetest.chat_send_player( name, 'Please enter a number between 0 and '..tostring( markers.MAX_HEIGHT )..
' in the field where the depth of your area is requested. Your area will stretch that many blocks '.. ' in the field where the depth of your area is requested. Your area will stretch that many blocks '..
'into the ground from the position of this marker onward.'); 'into the ground from the position of this marker onward.');
error_msg = 'The depth value\nhas to be larger than 0\nand smaller than '..tostring( markers.MAX_HEIGHT ); error_msg = 'The depth value\nhas to be larger than 0\nand smaller than '..tostring( markers.MAX_HEIGHT );
elseif( add_height + add_depth > markers.MAX_HEIGHT ) and minetest.get_player_privs(name)["megabuilder"] == false then elseif( add_height + add_depth > markers.MAX_HEIGHT ) and minetest.get_player_privs(name)["megabuilder"] ~= true then
minetest.chat_send_player( name, 'Sorry, your area exceeds the height limit. Height and depth added have to '.. minetest.chat_send_player( name, 'Sorry, your area exceeds the height limit. Height and depth added have to '..
'be smaller than '..tostring( markers.MAX_HEIGHT )..'.'); 'be smaller than '..tostring( markers.MAX_HEIGHT )..'.');
error_msg = 'height + depth has to\nbe smaller than '..tostring( markers.MAX_HEIGHT )..'.' error_msg = 'height + depth has to\nbe smaller than '..tostring( markers.MAX_HEIGHT )..'.'

View File

@ -85,14 +85,14 @@ load_sounds_config()
minetest.register_chatcommand("setsound", { minetest.register_chatcommand("setsound", {
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 = {}, privs = {interact=true},
func = sounds.set_sound, func = sounds.set_sound,
}) })
minetest.register_chatcommand("getsound", { minetest.register_chatcommand("getsound", {
params = "", params = "",
description = "print volume sound <music|ambience|mobs|other>", description = "print volume sound <music|ambience|mobs|other>",
privs = {}, 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(sounds.gainplayers[name]) do