wasplib: add find_player

master
cora 2021-09-04 18:31:12 +02:00
parent f693b69999
commit 22e03d384b
1 changed files with 8 additions and 0 deletions

View File

@ -7,6 +7,7 @@ ws.c = core
ws.range=4
ws.target=nil
ws.targetpos=nil
local nextact = {}
local ghwason={}
@ -181,6 +182,13 @@ function ws.get_hud_by_texture(texture)
return def
end
function ws.find_player(name)
for k, v in ipairs(minetest.localplayer.get_nearby_objects(500)) do
if v:get_name() == name then
return v:get_pos(),v
end
end
end
function ws.display_wp(pos,name)
local ix = #ws.displayed_wps + 1