User Tools

Site Tools


dev:core:funref:is_protected

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
dev:core:funref:is_protected [2019-10-02 17:38]
82.67.173.193 added "returns" section
dev:core:funref:is_protected [2019-10-02 20:18]
82.67.173.193 convert tabs to spaces
Line 10: Line 10:
  
 ===== Parameters ===== ===== Parameters =====
-  * ''pos'' //(table)//: a Minetest vector position.+  * ''pos'' //(table)//: a Minetest position vector.
   * ''name'' //(string)//: the player name. It does not need to be logged in, but it *needs* to exist in the ''auth.txt'' file.   * ''name'' //(string)//: the player name. It does not need to be logged in, but it *needs* to exist in the ''auth.txt'' file.
  
Line 43: Line 43:
 <file lua is_protected.lua> <file lua is_protected.lua>
 function advtrains.is_protected(pos, name) function advtrains.is_protected(pos, name)
- if not name then +    if not name then 
- error("advtrains.is_protected() called without name parameter!"+        error("advtrains.is_protected() called without name parameter!"
- end +    end 
- if minetest.check_player_privs(name, {protection_bypass=true}) then +    if minetest.check_player_privs(name, {protection_bypass=true}) then 
- --player can bypass protection +        --player can bypass protection 
- return false +        return false 
- end +    end 
- return minetest.is_protected(pos, name)+    return minetest.is_protected(pos, name)
 end end
 </file> </file>
dev/core/funref/is_protected.txt · Last modified: 2020-01-22 10:53 by admin