Guest User

Untitled

a guest
Feb 6th, 2015
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. uba.remove_item_conf = function(arena_name,name,itemstring)
  2. print("itemstring "..dump(itemstring))
  3. local conf_file = Settings(uba.mod_path.."/"..arena_name.."/items.conf")
  4. print("path "..dump(uba.mod_path.."/"..arena_name.."/items.conf"))
  5. if conf_file:remove(itemstring) then
  6. conf_file:write()
  7. minetest.chat_send_player(name,"* "..itemstring.." removed from "..arena_name.."/items.conf")
  8. else
  9. minetest.chat_send_player(name,"*Could not remove unknown item")
  10. end
  11. end
  12.  
  13. > console output
  14. > itemstring "default:sword_diamond"
  15. > path "/home/raphael/minetest/bin/../mods/uba/test/items.conf"
  16.  
  17. and finally items.conf after execution
  18.  
  19.  
  20. default:sword_diamond = 4
  21.  
  22. default:sword_wood = 4
Advertisement
Add Comment
Please, Sign In to add comment