"OpenCCSensors Player Name Output : i need the name of a player when he comes near to my computer (using occs sensors)
OpenCCSensors Player Name Output
Started by Alu, Jun 02 2013 05:38 PM
2 replies to this topic
#1
Posted 02 June 2013 - 05:38 PM
#2
Posted 03 June 2013 - 11:53 AM
Split into new topic.
I believe you want the Username key from the detailed info of the target. Use ocs/programs/sensorview to confirm.
I believe you want the Username key from the detailed info of the target. Use ocs/programs/sensorview to confirm.
#3
Posted 05 June 2013 - 10:07 PM
try this
os.loadAPI("ocs/apis/sensor")
prox = sensor.wrap("right") -- change to the correct side
while true do
t = prox.getTargets()
for name, details in pairs(t)
if details.Name == "Player" then
local x = prox.getTargetDetails(name)
print(x.Username)
end
end
os.loadAPI("ocs/apis/sensor")
prox = sensor.wrap("right") -- change to the correct side
while true do
t = prox.getTargets()
for name, details in pairs(t)
if details.Name == "Player" then
local x = prox.getTargetDetails(name)
print(x.Username)
end
end
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











