This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
dev:core:funref:is_protected [2019-10-02 17:27] 82.67.173.193 created |
dev:core:funref:is_protected [2020-01-22 10:53] (current) admin ↷ Page moved from reference:advtrains:is_protected to dev:core:funref:is_protected |
||
---|---|---|---|
Line 10: | Line 10: | ||
===== Parameters ===== | ===== Parameters ===== | ||
- | * '' | + | * '' |
* '' | * '' | ||
+ | |||
+ | ===== Returns ===== | ||
+ | True if the node is protected and the player cannot bypass this protection, false otherwise. | ||
===== Errors and warnings ===== | ===== Errors and warnings ===== | ||
Line 40: | Line 43: | ||
<file lua is_protected.lua> | <file lua is_protected.lua> | ||
function advtrains.is_protected(pos, | function advtrains.is_protected(pos, | ||
- | if not name then | + | |
- | error(" | + | error(" |
- | end | + | end |
- | if minetest.check_player_privs(name, | + | if minetest.check_player_privs(name, |
- | --player can bypass protection | + | --player can bypass protection |
- | return false | + | return false |
- | end | + | end |
- | return minetest.is_protected(pos, | + | return minetest.is_protected(pos, |
end | end | ||
</ | </ |