Who: Difference between revisions

From Second Life Wiki
Jump to navigation Jump to search
No edit summary
m <lsl> tag to <source>
Line 3: Line 3:
== Function ==
== Function ==


<lsl>
<source lang="lsl2">
string Who(key id)
string Who(key id)
{
{
     return "secondlife:///app/agent/" + (string)id + "/inspect";
     return "secondlife:///app/agent/" + (string)id + "/inspect";
}
}
</lsl>
</source>


== Example ==
== Example ==


<lsl>
<source lang="lsl2">
string Who(key id)
string Who(key id)
{
{
Line 25: Line 25:
     }
     }
}
}
</lsl>
</source>


[[Category:LSL Examples]]
[[Category:LSL Examples]]

Revision as of 18:17, 24 January 2015

A simple 'llKey2Name' user-function supporting Viewer URI Name Space.

Function

<source lang="lsl2"> string Who(key id) {

   return "secondlife:///app/agent/" + (string)id + "/inspect";

} </source>

Example

<source lang="lsl2"> string Who(key id) {

   return "secondlife:///app/agent/" + (string)id + "/inspect";

}

default {

   touch_start(integer num)
   {
       llSay(0, "Touched by " + Who(llDetectedKey(0)) + "." );
   }

} </source>