players that go outside of 30000m now get killed
This commit is contained in:
parent
ff65116cd7
commit
ba3f3e0532
|
@ -3,10 +3,17 @@ local player_lastsound = {}
|
|||
local player_health = {}
|
||||
|
||||
local function step(dtime)
|
||||
for _,player in ipairs(minetest.get_connected_players()) do
|
||||
for _, player in ipairs(minetest.get_connected_players()) do
|
||||
local player_pos=player:getpos()
|
||||
local name=player:get_player_name()
|
||||
|
||||
if player_pos.x < -30000 or player_pos.x > 30000
|
||||
or player_pos.y < -30000 or player_pos.y > 30000
|
||||
or player_pos.z < -30000 or player_pos.z > 30000 then
|
||||
minetest.chat_send_player(name, "Don't go past 30000m in any direction!")
|
||||
player.set_hp(0)
|
||||
end
|
||||
|
||||
if player:get_hp() < player_health[name] then
|
||||
minetest.sound_play(
|
||||
"default_hurt",
|
||||
|
|
Loading…
Reference in New Issue