OsAvatarType

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Created page with "integer osAvatarType(key avatarKey) Returns: < 0 in case of error 0 if avatar not found 1 if it is a normal avatar 2 if it is a NPC Threat Level This function does not d...")
 
 
(7 intermediate revisions by one user not shown)
Line 1: Line 1:
integer osAvatarType(key avatarKey)
+
{{osslfunc
Returns:
+
|function_syntax=integer osAvatarType(key avatarKey)<br>
< 0 in case of error
+
integer osAvatarType(string avatarFirstName, string avatarLastName)
0 if avatar not found
+
1 if it is a normal avatar
+
2 if it is a NPC
+
  
 +
|csharp_syntax=
 +
|description=Returns the type of a avatar in region:
  
Threat Level This function does not do a threat level check
+
* < 0 in case of error
Permissions Use of this function is always allowed by default
+
* 0 if avatar not found in region
Delay 0 seconds
+
* 1 if it is a normal avatar
 +
* 2 if it is a NPC
 +
 
 +
 
 +
|threat_level=ignored
 +
|permissions=true
 +
|delay=0
 +
|ossl_example=<source lang="lsl">
 +
 
 +
// This script listens for a key on channel 1 which will then
 +
// tell you the avatar type
 +
 
 +
// This is the default state definition
 +
default
 +
{
 +
    // This function is called when the script enters the default state
 +
    state_entry()
 +
    {
 +
        // Setting up a listener on channel 1, listening for any message from the owner
 +
        llListen(1, "", llGetOwner(), "");   
 +
    }
 +
 +
    // This function is called when the script receives a message on the specified channel
 +
    listen(integer channel, string name, key id, string message)
 +
    {
 +
        // Checking if the message was received on channel 1
 +
        if (channel == 1)
 +
        {
 +
            // Calling osAvatarType function to determine the type of the avatar
 +
            llOwnerSay(osAvatarType((key)message));
 +
        } 
 +
    }
 +
}
 +
 
 +
 
 +
</source>
 +
|additional_info=This function was added in 0.9.2.0
 +
}}

Latest revision as of 02:07, 7 March 2024

integer osAvatarType(key avatarKey)

integer osAvatarType(string avatarFirstName, string avatarLastName)

Returns the type of a avatar in region:
  • < 0 in case of error
  • 0 if avatar not found in region
  • 1 if it is a normal avatar
  • 2 if it is a NPC
Threat Level This function does not do a threat level check
Permissions Use of this function is always allowed by default
Extra Delay 0 seconds
Example(s)
// This script listens for a key on channel 1 which will then
// tell you the avatar type
 
// This is the default state definition
default
{
    // This function is called when the script enters the default state
    state_entry()
    {
        // Setting up a listener on channel 1, listening for any message from the owner
        llListen(1, "", llGetOwner(), "");    
    }
 
    // This function is called when the script receives a message on the specified channel
    listen(integer channel, string name, key id, string message)
    {
        // Checking if the message was received on channel 1
        if (channel == 1)
        {
            // Calling osAvatarType function to determine the type of the avatar
            llOwnerSay(osAvatarType((key)message));
        }   
    }
}
Notes
This function was added in 0.9.2.0


Personal tools
General
About This Wiki