Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
HybridDog
committed
Aug 20, 2014
0 parents
commit 6c940bc
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## Generic ignorable patterns and files | ||
*~ | ||
.*.swp | ||
debug.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
local players = {} | ||
local timer = 0 | ||
|
||
minetest.register_globalstep(function(dtime) | ||
timer = timer + dtime | ||
if timer >= 2 then | ||
timer = 0 | ||
for _,p in pairs(minetest.get_connected_players()) do | ||
local name = p:get_player_name() | ||
local pos = p:getpos() | ||
if math.abs(pos.x) <= 32000 | ||
and math.abs(pos.y) <= 32000 | ||
and math.abs(pos.z) <= 32000 then | ||
players[name] = pos | ||
else | ||
local pos2 = players[name] or {x=0, y=20, z=0} | ||
p:setpos(pos2) | ||
minetest.chat_send_player(name, "You were too far away.") | ||
end | ||
end | ||
end | ||
end) |