1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-24 17:50:37 +01:00

debug minetest.register_on_respawnplayer function for special spawn areas

This commit is contained in:
crabman77 2016-01-08 00:53:14 +01:00
parent 0ad6657a72
commit 40b3e17894
2 changed files with 8 additions and 2 deletions

View File

@ -183,6 +183,11 @@ end)
-- respawn player at bed if enabled and valid position is found
minetest.register_on_respawnplayer(function(player)
--MFF DEBUT crabman(8/01/2016 ) respawn player in special area(event) if a spawn is set.
if ((minetest.get_modpath("areas") ~= nil) and (areas:onRespawn(player))) then
return true
end
if not enable_respawn then
return false
end

View File

@ -136,6 +136,7 @@ end
--MFF DEBUT crabman(17/09/2015 ) respawn player in special area(event) if a spawn is set.
--1 party (2 party in beds mod)
local dead_players = {}
minetest.register_on_dieplayer(function(player)
local player_name = player:get_player_name()
@ -147,7 +148,7 @@ minetest.register_on_dieplayer(function(player)
end)
minetest.register_on_respawnplayer(function(player)
function areas:onRespawn(player)
local player_name = player:get_player_name()
if not player_name or not dead_players[player_name] then return false end
local pos = dead_players[player_name]
@ -161,5 +162,5 @@ minetest.register_on_respawnplayer(function(player)
end
end
return false
end)
end
--FIN