wasplib: add find_player
This commit is contained in:
parent
f693b69999
commit
22e03d384b
@ -7,6 +7,7 @@ ws.c = core
|
|||||||
|
|
||||||
ws.range=4
|
ws.range=4
|
||||||
ws.target=nil
|
ws.target=nil
|
||||||
|
ws.targetpos=nil
|
||||||
|
|
||||||
local nextact = {}
|
local nextact = {}
|
||||||
local ghwason={}
|
local ghwason={}
|
||||||
@ -181,6 +182,13 @@ function ws.get_hud_by_texture(texture)
|
|||||||
return def
|
return def
|
||||||
end
|
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)
|
function ws.display_wp(pos,name)
|
||||||
local ix = #ws.displayed_wps + 1
|
local ix = #ws.displayed_wps + 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user