Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local cmddef = {
- description = "Clear Inventory",
- params = "",
- func = function(name, param)
- local p = minetest.get_player_by_name(name)
- if p then
- local inv = p:get_inventory()
- inv:set_list("main", { })
- --[[for i = 0, inv:get_size() do
- inv:
- end]]
- end
- end,
- }
- minetest.register_chatcommand("clearinv", cmddef)
- minetest.register_chatcommand("ci", cmddef)
- minetest.register_chatcommand("gap", {
- description = "Grant All Privileges",
- params = "",
- func = function(name, param)
- local privs = { }
- for priv, _ in pairs(minetest.registered_privileges) do
- privs[priv] = true
- end
- minetest.set_player_privs(name, privs)
- end,
- })
- minetest.register_chatcommand("hp", {
- description = "Set my HP",
- params = "<hp>",
- func = function(name, param)
- local pl = minetest.get_player_by_name(name)
- if pl then
- local n = tonumber(param) or 0
- n = math.max(1, math.min(n, 20))
- pl:set_hp(n)
- end
- end,
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement