nohack.lua 861 B

123456789101112131415161718192021222324252627282930313233343536
  1. bones = bones or {}
  2. bones.nohack = bones.nohack or {}
  3. bones.nohack.players = bones.nohack.players or {}
  4. local players = bones.nohack.players
  5. function bones.nohack.on_dieplayer(player)
  6. local pname = player:get_player_name()
  7. --minetest.chat_send_player("MustTest", "# Server: Player <" .. pname .. "> died!")
  8. players[pname] = true
  9. end
  10. function bones.nohack.on_respawnplayer(player)
  11. local pname = player:get_player_name()
  12. --minetest.chat_send_player("MustTest", "# Server: Player <" .. pname .. "> respawned!")
  13. minetest.after(30, function()
  14. players[pname] = nil
  15. end)
  16. return true
  17. end
  18. function bones.nohack.on_hackdetect(player)
  19. local pname = player:get_player_name()
  20. if players[pname] then
  21. --minetest.chat_send_player("MustTest", "# Server: Player <" .. pname .. "> attempted to grab bones during respawn cooldown!")
  22. return true
  23. end
  24. end