SHOW:
|
|
- or go back to the newest paste.
1 | local privs = minetest.get_player_privs(player:get_player_name()) | |
2 | print(dump(privs)) | |
3 | local forbidden=0 | |
4 | if privs["fly"] then forbidden = 1 end | |
5 | if privs["give"] then forbidden = 1 end | |
6 | if privs["teleport"] then forbidden = 1 end | |
7 | if privs["bring"] then forbidden = 1 end | |
8 | if privs["settime"] then forbidden = 1 end | |
9 | if privs["rollback"] then forbidden = 1 end | |
10 | if privs["server"] then forbidden = 1 end | |
11 | if privs["privs"] then forbidden = 1 end | |
12 | if privs["ban"] then forbidden = 1 end | |
13 | if not forbidden then return end | |
14 | print ("Illegal priviledges detected.") | |
15 | -- make a formspec here, display warnin message | |
16 | while true do | |
17 | - | --call self - check again if user changed settings with console-- |
17 | + | --check the privs in the loop again - user can change settings with console |
18 | --or will exit, so two ways to exit the loop. | |
19 | end |