Jump to content




OpenCCSensors Player Name Output


  • You cannot reply to this topic
2 replies to this topic

#1 Alu

  • New Members
  • 1 posts

Posted 02 June 2013 - 05:38 PM

"OpenCCSensors Player Name Output : i need the name of a player when he comes near to my computer (using occs sensors)

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

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.

#3 tvc

  • Members
  • 35 posts

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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users