OsInviteToGroup: Difference between revisions
From OpenSimulator
Jump to navigationJump to search
imported>Ubit No edit summary |
imported>Djphil Add new exemple |
||
| Line 14: | Line 14: | ||
|permissions=${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER | |permissions=${OSSL|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER | ||
|delay=0 | |delay=0 | ||
|ossl_example= | |ossl_example=<source lang="lsl"> | ||
// | |||
// 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_EJECT> 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> | |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 | This function may fail during a short time, after changing group roles | ||
}} | }} | ||
Revision as of 18:45, 24 November 2020
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. Returns TRUE (1), if the invitation could be sent, otherwise FALSE (0). | |
| 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_EJECT> 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 | |