minetest.set_player_privs

From Minetest Developer Wiki
Jump to: navigation, search

Syntax

Description

Sets the privileges of the specified player.

  • name — name of the player of which to set the privileges
  • privs — a table containing the new privileges of the player. The keys are privilege names and the values are true. Privileges not specified are removed if the player had them before the call.

Examples

This code grants the “fly” privilege to Example Player without affecting the other privileges:

local playername = "Example Player"
local privs = minetest.get_player_privs(playername)
privs.fly = true
minetest.set_player_privs(playername, privs)

This code revokes all privileges from Example Player:

minetest.set_player_privs("Example Player", {})
Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox