OsGetGender

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Created page with "{{osslfunc |threat_level=None |function_syntax=string osGetGender(key id) |csharp_syntax=LSL_String osGetGender(LSL_KEY id) |ossl_example=<source lang="lsl"> // // Example of ...")
 
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{osslfunc
 
{{osslfunc
 
|threat_level=None
 
|threat_level=None
 +
|permissions=true
 +
|delay=0
 
|function_syntax=string osGetGender(key id)
 
|function_syntax=string osGetGender(key id)
|csharp_syntax=LSL_String osGetGender(LSL_KEY id)
+
 
 +
|description=Returns a string with one of the following values: "male", "female", or "unknown".
 +
 
 +
This value is determined by the value selected for the avatar shape in the appearance dialog in the user's viewer.
 +
 
 +
If that value cannot be found for any reason (avatar is not in the region, improperly formatted key, etc.), "unknown" is returned.
 +
 
 +
|additional_info=This function was added in 0.8.2-post-fixes
 +
 
 
|ossl_example=<source lang="lsl">
 
|ossl_example=<source lang="lsl">
 
//
 
//
// Example of osGetGender.
+
// osGetGender Script Example
 
//
 
//
 +
 
default
 
default
 
{
 
{
 +
    // The touch_start event is triggered when an object is touched by an avatar.
 
     touch_start(integer total_number)
 
     touch_start(integer total_number)
 
     {
 
     {
 +
        // Retrieve the gender of the avatar that touched the object using osGetGender().
 +
        // llDetectedKey(0) returns the key of the avatar that touched the object.
 
         string gender = osGetGender(llDetectedKey(0));
 
         string gender = osGetGender(llDetectedKey(0));
         llSay(0, "Your gender is:" + gender);
+
 
 +
        // Display the gender of the avatar.
 +
         llSay(0, "Your gender is: " + gender);
 
     }
 
     }
 
}
 
}
 
</source>
 
</source>
|description=Returns a string with one of the following values: "male", "female", or "unknown".
 
|
 
 
}}
 
}}

Latest revision as of 13:12, 3 March 2024

string osGetGender(key id)
Returns a string with one of the following values: "male", "female", or "unknown".

This value is determined by the value selected for the avatar shape in the appearance dialog in the user's viewer.

If that value cannot be found for any reason (avatar is not in the region, improperly formatted key, etc.), "unknown" is returned.

Threat Level None
Permissions Use of this function is always allowed by default
Extra Delay 0 seconds
Example(s)
//
// osGetGender Script Example
//
 
default
{
    // The touch_start event is triggered when an object is touched by an avatar.
    touch_start(integer total_number)
    {
        // Retrieve the gender of the avatar that touched the object using osGetGender().
        // llDetectedKey(0) returns the key of the avatar that touched the object.
        string gender = osGetGender(llDetectedKey(0));
 
        // Display the gender of the avatar.
        llSay(0, "Your gender is: " + gender);
    }
}
Notes
This function was added in 0.8.2-post-fixes
Personal tools
General
About This Wiki