OsAddAgentToGroup
From OpenSimulator
(Difference between revisions)
												
			JeffKelley  (Talk | contribs)  m  | 
			|||
| (6 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
| + | <br />  | ||
| + | <div style="background-color:#FFA500; padding:10px; padding-bottom:5px; border: 1px #FF544F solid">  | ||
| + | Not implemented  | ||
| + | </div>  | ||
| + | |||
{{osslfunc  | {{osslfunc  | ||
|threat_level=None  | |threat_level=None  | ||
| − | |function_syntax=  | + | |function_syntax=osAddAgentToGroup(key AgentID, string GroupName, string RequestedRole)  | 
| − | + | ||
|ossl_example=<source lang="lsl">  | |ossl_example=<source lang="lsl">  | ||
//  | //  | ||
| − | //   | + | // osAddAgentToGroup Script Example  | 
| − | + | ||
| − | + | ||
//  | //  | ||
| + | |||
| + | string GroupToJoin = "Test Group";  | ||
| + | string RoleToJoin = "Everyone";  | ||
default  | default  | ||
{  | {  | ||
| − | + |      state_entry()  | |
     {  |      {  | ||
| − | + |          llSay(PUBLIC_CHANNEL, "Touch to use osAddAgentToGroup to add yourself to a group.");   | |
| + |     }  | ||
| + | |||
| + |     touch_end(integer num)  | ||
| + |     {  | ||
| + |         key AgentID = llDetectedKey(0);  | ||
| + |         osAddAgentToGroup(AgentID, GroupToJoin, RoleToJoin);  | ||
     }  |      }  | ||
}  | }  | ||
</source>  | </source>  | ||
| + | <source lang="lsl">  | ||
| + | //  | ||
| + | // osAddAgentToGroup Script Example  | ||
| + | //  | ||
| + | // Define the group and role to which avatars will be added.  | ||
| + | string GroupToJoin = "Test Group";  | ||
| + | string RoleToJoin = "Everyone";  | ||
| + | |||
| + | default  | ||
| + | {  | ||
| + |     // This event is triggered when the script is initialized.  | ||
| + |     state_entry()  | ||
| + |     {  | ||
| + |         // Send a message in public chat to inform users about the script's functionality.  | ||
| + |         llSay(PUBLIC_CHANNEL, "Touch to use osAddAgentToGroup to add yourself to a group.");  | ||
| + |     }  | ||
| + | |||
| + |     // This event is triggered when an avatar touches the object containing the script.  | ||
| + |     touch_end(integer num)  | ||
| + |     {  | ||
| + |         // Get the unique identifier (key) of the avatar who touched the object.  | ||
| + |         key AgentID = llDetectedKey(0);  | ||
| + | |||
| + |         // Use the osAddAgentToGroup function to add the avatar to a specified group and role.  | ||
| + |         // This allows the avatar to join the group and take on the specified role.  | ||
| + |         osAddAgentToGroup(AgentID, GroupToJoin, RoleToJoin);  | ||
| + |     }  | ||
| + | }  | ||
| + | |||
| + | </source>  | ||
| + | |description=Prerequisites   | ||
| + | * The Group must be created  | ||
| + | * You must have the Group UUID  | ||
| + | * Roles within the group must be defined (default has Everyone & Owners)  | ||
|  | |  | ||
}}  | }}  | ||
Latest revision as of 10:41, 17 February 2024
Not implemented
osAddAgentToGroup(key AgentID, string GroupName, string RequestedRole)
 
 | |
Prerequisites
  | |
| Threat Level | None | 
| Permissions | No permissions specified | 
| Extra Delay | No function delay specified | 
| Example(s) | |
// // osAddAgentToGroup Script Example // string GroupToJoin = "Test Group"; string RoleToJoin = "Everyone"; default { state_entry() { llSay(PUBLIC_CHANNEL, "Touch to use osAddAgentToGroup to add yourself to a group."); } touch_end(integer num) { key AgentID = llDetectedKey(0); osAddAgentToGroup(AgentID, GroupToJoin, RoleToJoin); } } // // osAddAgentToGroup Script Example // // Define the group and role to which avatars will be added. string GroupToJoin = "Test Group"; string RoleToJoin = "Everyone"; default { // This event is triggered when the script is initialized. state_entry() { // Send a message in public chat to inform users about the script's functionality. llSay(PUBLIC_CHANNEL, "Touch to use osAddAgentToGroup to add yourself to a group."); } // This event is triggered when an avatar touches the object containing the script. touch_end(integer num) { // Get the unique identifier (key) of the avatar who touched the object. key AgentID = llDetectedKey(0); // Use the osAddAgentToGroup function to add the avatar to a specified group and role. // This allows the avatar to join the group and take on the specified role. osAddAgentToGroup(AgentID, GroupToJoin, RoleToJoin); } }  | |