OsInviteToGroup

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m
m (Fixed typo on USER_UUID_TO_INVITE (bad copy-pasting!))
 
(15 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
|function_syntax=integer osInviteToGroup(key user)
 
|function_syntax=integer osInviteToGroup(key user)
 
|csharp_syntax=
 
|csharp_syntax=
|description=Invite the given user to the group the object is set to. The group can be a closed user group.
+
|description=Invite the given user to the group the object is set to.<br>
The object owner must have the right to invite new users to the group the object is set to, at the time the object is created.  
+
The object must have a group set and can not be group owned.<br>
The user with the given key has to be online in that region. This is a required limitation to not make group invitation spam possible.
+
The object owner must have the right to invite new users to the group the object is set to.<br>
The user gets a normal group invitation, showing the owner of the object as sender. The invitation can be accepted or rejected and the user can open the corresponding group window. The result is TRUE, if the invitation could be sent, otherwise FALSE.
+
The user with the given key has to be online in that region.<br>
 +
The user gets a normal group invitation, showing the owner of the object as sender. The invitation can be accepted or rejected and the user can open the corresponding group window.<br>
 +
 
 +
Returns TRUE (1), if the invitation could be sent, otherwise FALSE (0).<br>
 +
Since version 0.9.2, it will return 2 if user is already member of the group.
 +
 
 
|threat_level=VeryLow
 
|threat_level=VeryLow
 
|permissions=${OSSL&#124;osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
 
|permissions=${OSSL&#124;osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
 
|delay=0
 
|delay=0
|ossl_example=
+
|ossl_example=<source lang="lsl">
|additional_info=This function was added in 0.7.4-post-fixes   
+
//
 +
// osInviteToGroup Script Exemple
 +
// Author: djphil
 +
//
 +
 
 +
key userID = "<USER_UUID_TO_INVITE>";
 +
 
 +
default
 +
{
 +
    state_entry()
 +
    {
 +
        if (userID == "<USER_UUID_TO_INVITE>" || !osIsUUID(userID))
 +
        {
 +
            llOwnerSay("Please replace <USER_UUID_TO_INVITE> with a valid user uuid");
 +
        }
 +
 
 +
        else
 +
        {
 +
            llSay(PUBLIC_CHANNEL, "Touch to see osInviteToGroup invite you to this object's group.");
 +
        }
 +
    }
 +
 
 +
    touch_start(integer number)
 +
    {
 +
        if (llDetectedKey(0) == llGetOwnerKey(llGetKey()))
 +
        {
 +
            integer result = osInviteToGroup(userID);
 +
 
 +
            if (result == 0) // FALSE
 +
            {
 +
                llOwnerSay("Invitation sent unsuccessfully.");
 +
            }
 +
   
 +
            if (result == 1) // TRUE
 +
            {
 +
                llOwnerSay("Invitation sent successfully.");
 +
            }
 +
 
 +
            if (result == 2)
 +
            {
 +
                llOwnerSay("This user is already a member of this object's group.");
 +
            }
 +
        }
 +
 
 +
        else
 +
        {
 +
            llSay(PUBLIC_CHANNEL, "Sorry, you are not the owner of this object.");
 +
        }
 +
    }
 +
}
 +
</source>
 +
|additional_info=This function was added in 0.7.4-post-fixes<br>
 +
This function may fail during a short time, after changing group roles  
 
}}
 
}}
 +
== See Also ==
 +
* [[osInviteToGroup]]
 +
* [[osEjectFromGroup]]

Latest revision as of 14:49, 17 May 2023

integer osInviteToGroup(key user)
Invite the given user to the group the object is set to.

The object must have a group set and can not be group owned.
The object owner must have the right to invite new users to the group the object is set to.
The user with the given key has to be online in that region.
The user gets a normal group invitation, showing the owner of the object as sender. The invitation can be accepted or rejected and the user can open the corresponding group window.

Returns TRUE (1), if the invitation could be sent, otherwise FALSE (0).
Since version 0.9.2, it will return 2 if user is already member of the group.

Threat Level VeryLow
Permissions ${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Extra Delay 0 seconds
Example(s)
//
// osInviteToGroup Script Exemple
// Author: djphil
//
 
key userID = "<USER_UUID_TO_INVITE>";
 
default
{
    state_entry()
    {
        if (userID == "<USER_UUID_TO_INVITE>" || !osIsUUID(userID))
        {
            llOwnerSay("Please replace <USER_UUID_TO_INVITE> with a valid user uuid");
        }
 
        else
        {
            llSay(PUBLIC_CHANNEL, "Touch to see osInviteToGroup invite you to this object's group.");
        }
    }
 
    touch_start(integer number)
    {
        if (llDetectedKey(0) == llGetOwnerKey(llGetKey()))
        {
            integer result = osInviteToGroup(userID);
 
            if (result == 0) // FALSE
            {
                llOwnerSay("Invitation sent unsuccessfully.");
            }
 
            if (result == 1) // TRUE
            {
                llOwnerSay("Invitation sent successfully.");
            }
 
            if (result == 2)
            {
                llOwnerSay("This user is already a member of this object's group.");
            }
        }
 
        else
        {
            llSay(PUBLIC_CHANNEL, "Sorry, you are not the owner of this object.");
        }
    }
}
Notes
This function was added in 0.7.4-post-fixes

This function may fail during a short time, after changing group roles


[edit] See Also

Personal tools
General
About This Wiki